求助, Linode 上的 iptables 无法添加规则

2014-12-08 20:54:07 +08:00
 DFC
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 也是如此,这是怎么回事?
3921 次点击
所在节点    Linux
10 条回复
webjin
2014-12-08 20:59:34 +08:00
这种语法是redhat系列
orvice
2014-12-08 21:00:41 +08:00
Debian中iptables命令输完之后会立刻生效,不用重启。
webjin
2014-12-08 21:01:26 +08:00
我知道ubuntu关闭防火墙的是
webjin
2014-12-08 21:01:33 +08:00
ufw disable
webjin
2014-12-08 21:02:40 +08:00
bitwing
2014-12-08 21:09:52 +08:00
Debian 系的 iptables 默认应该是开启的,而且不在 service 中显示。iptables kernel2.4 以上都是默认自带的。
iptables -t nat -L 查看 nat 表规则,默认查看的是 filter 表。
DFC
2014-12-08 22:59:18 +08:00
@bitwing 原来不是 iptables 问题,
var/syslog
Dec 8 22:53:36 FF1 pptpd[4389]: MGR: Bad IP address (10.10.10.2-200#015) in config file!

etc/pptpd.conf
localip 10.10.10.1
remoteip 10.10.10.2-200
不知道哪卡住了
gouera
2014-12-08 23:15:10 +08:00
看6楼的,你命令打错了。。默认是查看filter表的。你添加的是nat表的规则,要用iptables -t nat -L 来查看。。。
你这应该是设置vpn的转发吧。。记得sysctl 里面的ipv4转发的值也要修改哦。
DFC
2014-12-08 23:19:34 +08:00
@gouera
恩,不是 iptables 的问题,pptpd 没启动起来。
DFC
2014-12-09 00:11:46 +08:00
解决了,是 Notepad++ 的保存格式问题,pptpd.conf 不能正确读取导致启动后没监听1723端口

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/152447

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX