哎!摘不定NAT

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
tuzhyu
帖子: 2
注册时间: 2007-02-24 10:17
送出感谢: 0
接收感谢: 0

哎!摘不定NAT

#1

帖子 tuzhyu » 2007-03-05 13:38

主机是ubuntu6.10 双网卡eth1接ADSL eth0接内网。客户机是win2003 能互ping通。

已经做了以下步骤

luck@luck-desktop:/proc/sys/net/ipv4$ echo 1 |sudo tee /proc/sys/net/ipv4/ip_forward
1

iptables 内容如下

luck@luck-desktop:/proc/sys/net/ipv4$ sudo iptables-save
# Generated by iptables-save v1.3.5 on Mon Mar 5 13:37:12 2007
*nat
:PREROUTING ACCEPT [962:72842]
:POSTROUTING ACCEPT [31:3333]
:OUTPUT ACCEPT [38:4071]
-A POSTROUTING -s 192.168.0.0/255.255.255.0 -o ppp0 -j MASQUERADE
COMMIT
# Completed on Mon Mar 5 13:37:12 2007
# Generated by iptables-save v1.3.5 on Mon Mar 5 13:37:12 2007
*filter
:INPUT ACCEPT [4337:1251601]
:FORWARD ACCEPT [37904:31718157]
:OUTPUT ACCEPT [2074:285599]
-A FORWARD -s 192.168.0.0/255.255.255.0 -o ppp0 -j ACCEPT
-A FORWARD -d 192.168.0.0/255.255.255.0 -i ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Mon Mar 5 13:37:12 2007


luck@luck-desktop:~$ netstat -rn
内核 IP 路由表
Destination Gateway Genmask Flags MSS Window irtt Iface
222.217.241.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
luck@luck-desktop:~$

请问这样还差那里没有设置好?
头像
5451vs5451
帖子: 345
注册时间: 2006-07-14 18:56
来自: Apple Valley, Planet Tux, Linux System
送出感谢: 0
接收感谢: 0

#2

帖子 5451vs5451 » 2007-03-05 15:09

win client的网关
回复

回到 “服务器基础应用”