求助, Linode 上的 iptables 无法添加规则
- 0次
- 2021-07-14 12:59:29
- idczone
iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -o eth0 -j MASQUERADE 后 iptables -L 查看是空的没有规则,service iptables status 提示 unrecognized service。
然后
apt-get install iptables
Reading package lists... Done
Building dependency tree
Reading state information... Done
iptables is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
系统也装了 iptables
摸不到头脑,以为系统问题(Debian 7 32bit)试了 Ubuntu 10.04 32bit 也是如此,这是怎么回事?
这种语法是redhat系列
Debian中iptables命令输完之后会立刻生效,不用重启。
我知道ubuntu关闭防火墙的是
ufw disable
http://www.cnblogs.com/bronte/articles/1828246.html
Debian 系的 iptables 默认应该是开启的,而且不在 service 中显示。iptables kernel2.4 以上都是默认自带的。
iptables -t nat -L 查看 nat 表规则,默认查看的是 filter 表。
原来不是 iptables 问题,
var/syslog
Dec 8 22:53:36 FF1 pptpd[4389]: MGR: Bad IP address (10.10.10.2-200in config file!
etc/pptpd.conf
localip 10.10.10.1
remoteip 10.10.10.2-200
不知道哪卡住了
看6楼的,你命令打错了。。默认是查看filter表的。你添加的是nat表的规则,要用iptables -t nat -L 来查看。。。
你这应该是设置vpn的转发吧。。记得sysctl 里面的ipv4转发的值也要修改哦。
恩,不是 iptables 的问题,pptpd 没启动起来。
解决了,是 Notepad++ 的保存格式问题,pptpd.conf 不能正确读取导致启动后没监听1723端口