|
发表于 2009-5-29 21:59:28
|
显示全部楼层
需要开启iptables
在/etc/sysctl.conf中加入net/ipv4/ip_forward=1开启ip地址转发
把连到windows的那块网卡设定ip,比如192.168.0.1
iptables的规则是 -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
-A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -s 192.168.0.0/24 -j ACCEPT
然后在windows中设置Network Connections -> Local Area Connection Properties -> Internet Protocol(TCP/IP)。Alternate Configuration -> User configured:
IP address:192.168.0.2
Subnet mask:255.255.255.0
Default gateway:192.168.0.1
我是这么弄的。不一定对,但至少能用吧。 |
|