- 论坛徽章:
- 0
|
dl380机器,装的linux,主板自带的2个网卡
eth0设置ip:134.224.1.75 ,mask:255.255.255.128,gw:134.224.1.1
eth1设置ip:10.0.0.2,mask:255.255.255.0,gw:10.0.0.1
eth1和防火墙直接相连,通过10.0.0.1,映射了一个外网IP出去;
设置好后
#netstat -r
Destination Gateway Genmask Flags MSS Window irtt Iface
134.224.1.0 * 255.255.255.128 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth1
这样的话外网能够通过映射的ip访问此台主机,但是这台主机没法通过134.224.1.1去访问内网的机器,
加了个route add default gw 134.224.1.1后变成
Destination Gateway Genmask Flags MSS Window irtt Iface
134.224.1.0 * 255.255.255.128 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 134.224.1.1 0.0.0.0 UG 0 0 0 eth0
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth1
这样的话外网就访问不了,但是内网我又能访问了。。。。
请问该如何设置,才能外网能访问此台服务器,此台服务器也能访问内网其他机器 |
|