現在eth0已經可以ping到外部主機了...但eth1卻ping不到內部主機!
底下是我的interfaces設定!
- 代碼: 選擇全部
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
address 61.64.118.xxx
netmask 255.255.255.0
network 61.64.118.0
broadcast 61.64.118.255
gateway 61.64.118.254
auto eth1
iface eth1 inet static
address 192.168.0.2
netmask 255.255.255.0
network 61.64.118.0
broadcast 61.64.118.255
至於nat部分...我是參考無痛起步法做了幾個設定!
載入相關 kernel module
modprobe ip_tables
echo "modprobe ip_tables" >> /etc/modules
更改相關設定檔
/etc/sysctl.conf
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See sysctl.conf (5) for information.
#
net/ipv4/ip_forward=1
執行相關指令
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
然後下/etc/init.d/iptables save active!
下lsmod有看到iptables的東東!
至/proc/sys/net/ipv4/ip_forward看到的數值也是"1"
WIN主機的網路設定如下!
address 192.168.0.3
netmask 255.255.255.0
gateway 192.168.0.2
真是奇怪...不知道是不是哪邊設定出了問題...
請大家幫小弟看看......thx