ZhangZe

Computer World--Linux, BSD

博客园 首页 新随笔 联系 管理

http://tiger506.blog.51cto.com/318536/400185/

http://lustlost.blog.51cto.com/2600869/943110

 

1.echo 1 > /proc/sys/net/ipv4/ip_forward

2.两个网卡,一个eth0接外网地址192.168.8.0/24,一个wlan0接内网地址192.168.1.0/24

3.是需要一条规则,还是两条iptables规则

  //所有从内网192.168.1.0发送的包都转发到eth0上???

  iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24(source address)  -j MASQUERDE

  //错误,eth0是外网地址192.168.8.0网段,自己转发给自己?显然不对

  iptables -t nat -A POSTROUTING -o eth0 -s 192.168.8.0/24 -j MASQUERDE

4.其他无线设备连接到wlan0,使用192.168.1.0/24网段上的ip地址上网。

 

 

iptables -t nat --list

posted on 2014-07-18 14:46  ze_zhang  阅读(232)  评论(0)    收藏  举报