由 wewi 在 01-31-2004 15:40 发表:
我也有一个iptables的问题
做网关的机器是每次启动后采用手工adsl拨号的方式上网的,我在iptables的*filter前面增加了以下设置
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
后面的[0:0]不知道是啥意思,我就照抄了
每次电脑启动用iptables -t nat -L -n检查会有nat的一条规则,但有的时候电脑启动会发现网关没有用了,检查一下发现这条规格没有了,编辑iptables发现*nat的内容全部丢失,iptables好像回复到默认设置了。这个究竟是怎么回事?
由 Snoopy 在 01-31-2004 15:53 发表:
加到/etc/rc.local
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then will I begin to under
由 wewi 在 01-31-2004 16:08 发表:
是不是将这条命令加到rc.local里?
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
问题它不是每次启动都这样的,如果iptables正常的话,运行这条命令不就重复了吗?
由 Snoopy 在 01-31-2004 16:29 发表:
你要保存,
要不写个简单又简单脚本,放到/etc/rc.local
或是save起来
或者将规则直接放到/etc/rc.local里去
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then will I begin to under
由 wewi 在 01-31-2004 19:15 发表:
我不是这个意思,我在iptables里增加了*nat部分,保存好了,一般情况