由 needshare 在 07-06-2004 13:56 发表:
急用!就是搞不定!
我公司是一个LAN,网段是192.168.1.0/24
通过一个adsl拨号上网的
现在iptables的法则是iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -j MASQUERADE
通过它来使下面的机子上网的
现在我就想把这个网段的192.168.1.1,192.168.1.2,192.168.1.3这三台机子上网
其余的机子不能上网
我的iptables法则该怎么写?
我现在写的是
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.1 -j MASQUERADE
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.2 -j MASQUERADE
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.3 -j MASQUERADE iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.0/24 -j DROP
这样还是不行嘛。那三台机子也不能上了?
由 Snoopy 在 07-21-2004 03:18 发表:
将最后一句最先运行再运行三条看看
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.1 -j MASQUERADE
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.2 -j MASQUERADE
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.3 -j MASQUERADE
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
由 Xbird 在 07-21-2004 09:37 发表:
为什么 -d 而不是 -s ?