在192.168.0.2上把eth0(你的网卡)的default gateway设成192.168.0.1
在192.168.0.1上, 开起IP FORWARDing和设定NAT.
下面是我用的一个script的相关部分, 你需要设定其他一些防火墙规则, 保护你的内网. .我的192.168.0.1通过ppp0 上网, 通过eth0和其它内网机器互连.
# enable ip forwarding.
echo 1 >; /proc/sys/net/ipv4/ip_forward
//其他防火墙规则....
//.......
# Set up IP FORWARDing and Masquerading
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
参考:
http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/IP-Masquerade-HOWTO.html