| ||||||||
| 一个简单的应用:我的机器IP是192.168.1.240,期望访问另一个局域网的 首先需要将到达192.168.1.2:80的包顺利转给192.168.0.109,因 iptables -t nat -A PREROUTING -s 192.168.1.0/24 -d 192.168.1.2 -p tcp --dport 80 -j DNAT --to 192.168.0.109:80 乍一看这应该没什么问题了,可是接下来问题是发现我的包是到0.109了,可是我的机 iptables -t nat -A POSTROUTING -d 192.168.0.109 --dport 80 -o eth1 -j SNAT --to 192.168.0.2 当然别忘了echo 1 > /proc/sys/net/ipv4/ip_forward,最好连/etc/sy | ||||||||
| comments: Leave a comment |
