- 论坛徽章:
- 0
|
我在公司分配有一个内网地址192.168.2.147,公司网关是192.168.2.1,可以用此访问internet,现在有两台电脑,如何用其中一台做路由器,让两台都可以访问internet?
拓扑图:
van1 (eth0)---------(eth1) van0 (eth0)------- 交换机 ------- 网关(192.168.2.1) --.....internet......
van0 和van1 都是linux,其中van0 用两张网卡做路由,eth0使用公司分配那个ip,三张网卡配置如下:
van0:
eth0: ip 192.168.2.147
netmask 255.255.255.0
gateway 192.168.2.1
eth1: ip 10.10.10.1
van1:
eth0: ip 10.10.10.5
netmask 255.255.255.0
gateway 10.10.10.1
van0和van1的路由表我改成这样了:
[root@van0 root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
[root@van1 root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 10.10.10.1 0.0.0.0 UG 0 0 0 eth0
************
通过如上配置,现在情况是:van1和van0的三张网卡可以互ping,并且van0可以访问internet,但是van1始终出不去。请问要如何配置路由表啊?
望指教!
!
我已经把转发打开了(在van0 上打开ech0 1 > /proc/sys/net/ipv4/ip_forward),但是tracepath显示到10.10.10.1就断了:
[root@van1 root]# tracepath 192.168.2.1
1: van1 (10.10.10.5) 0.096ms pmtu 1500
1: 10.10.10.1 (10.10.10.1) 0.365ms
1: 10.10.10.1 (10.10.10.1) 0.342ms
2: no reply
3: no reply
4: no reply
5: no reply
6: no reply |
|