深度的 iptables 调试日志如何查看
Tofloor
poster avatar
呆了个呆
deepin
2018-01-29 04:04
Author
debian 下在 iptables 中添加
  1. iptables -t raw -A OUTPUT -p icmp -j TRACE
  2. iptables -t raw -A PREROUTING -p icmp -j TRACE
Copy the Code
后,可以在 /var/log/kern.log 中看到 ping 的日志,今天配置网络不通,想看看日志,结果打开日志一看,没任何反应。。。我的 rsyslog 服务器开启的,请问官方这个日志是没保存还是在别的地方,应该如何查看?
Reply Favorite View the author
All Replies
avatar
iminto
deepin
2018-01-29 05:08
#1
本帖最后由 iminto 于 2018-1-28 21:11 编辑

兄弟,现在的Linux一般不用iptables了,用的firewalld服务。另外看日志也多用journalctl 了。。

你看的都是10年前的东西了
Reply View the author
avatar
呆了个呆
deepin
2018-01-29 05:44
#2
你说的是真的?为什么我一搜 iptables 都是 debian 系统,而一搜 firewalld 都是 CentOS?你到底是哪个发行版本的用户?
Reply View the author
avatar
RucLinux
deepin
2018-01-29 07:06
#3
cat /etc/sysconfg/iptables
iptables -F
service iptables save
service iptables restart
Reply View the author
Comments
w113124
2018-01-29 07:19
只有红帽子系列的才有 /etc/sysconfg 目录。其次,我说的是没有日志,不是说iptables有问题
avatar
呆了个呆
deepin
2018-01-29 07:18
#4
两个回复的人都是 CentOS 版本的。。。
Reply View the author
avatar
呆了个呆
deepin
2018-01-30 18:47
#5
https://bbs.deepin.org/user/48640 这个问题应该问谁,你帮我 at  一下吧,现在调试 iptables 不方便
Reply View the author
avatar
呆了个呆
deepin
2018-01-30 18:49
#6
https://bbs.deepin.org/user/35000 原来又换人了啊,这个问题你帮我 at  一下谁负责的,现在调试 iptables 不方便
Reply View the author
avatar
186******60
deepin
2018-01-30 19:41
#7
干嘛不用UFW,图形化界面简单易懂易设置
Reply View the author
avatar
rdlg
deepin
2018-01-30 19:44
#8
开了其他防火墙没 可能规则有冲突
如果没有冲突 cat /proc/net/netfilter/nf_log 看看
Reply View the author
avatar
呆了个呆
deepin
2018-01-31 21:47
#9
本帖最后由 w113124 于 2018-1-31 14:00 编辑
https://bbs.deepin.org/post/152555
开了其他防火墙没 可能规则有冲突
如果没有冲突 cat /proc/net/netfilter/nf_log 看看 ...

多谢,我已经弄好了,原来是没有加载那个日志模块:
  1. rmmod nfnetlink_log
  2. modprobe nf_log_ipv4
Copy the Code
上面那个模块不知道有没有影响,我是先移除了发现还是不正常后再试的,就没有加回去
Reply View the author
avatar
rdlg
deepin
2018-02-01 02:03
#10
https://bbs.deepin.org/post/152555
多谢,我已经弄好了,原来是没有加载那个日志模块:
上面那个模块不知道有没有影响,我是先移除了发现还是 ...

这个是基于netlink的
如果没用到的话 移除是没有影响的 以后需要加回来就行了
Reply View the author
avatar
tmacy
deepin
2018-02-01 06:35
#11
我也用的是rsyslog,不过没遇到你这个情况,一般看kern.log需要sudo权限。你说的模块我这边没有见到呀
Reply View the author
avatar
呆了个呆
deepin
2018-02-01 17:53
#12
https://bbs.deepin.org/post/152555
我也用的是rsyslog,不过没遇到你这个情况,一般看kern.log需要sudo权限。你说的模块我这边没有见到呀 ...

内核模块管理是用 lsmod rmmod modprobe 这些命令,不过不能乱用。你说的什么模块没见到?
Reply View the author
avatar
tmacy
deepin
2018-02-01 21:14
#13
https://bbs.deepin.org/post/152555
内核模块管理是用 lsmod rmmod modprobe 这些命令,不过不能乱用。你说的什么模块没见到? ...

你上面说的那几个模块。我的rsyslog是正常使用的啊
Reply View the author