谢谢指点。不过现在的路由表内容是
[root@centos ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 lo
default 192.168.0.153 0.0.0.0 UG 0 0 0 eth0
也不可以。
删掉网关route del default后
[root@centos ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 lo
还是在192.168.1.151上仅可以ping 192.168.0.153,不可以ping通192.168.0.2。依旧request time out 。
检查[root@centos ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos.dtl.com.cn
ifconfig结果是
[root@centos ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:F1:E6:19:03
inet addr:192.168.0.153 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:f1ff:fee6:1903/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6024 errors:0 dropped:0 overruns:0 frame:0
TX packets:1354 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:532134 (519.6 KiB) TX bytes:185409 (181.0 KiB)
eth1 Link encap:Ethernet HWaddr 00:00:E8:18:9B:5E
inet addr:192.168.1.154 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::200:e8ff:fe18:9b5e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2122 errors:0 dropped:0 overruns:0 frame:0
TX packets:151 errors:3 dropped:0 overruns:0 carrier:6
collisions:0 txqueuelen:1000
RX bytes:167987 (164.0 KiB) TX bytes:14444 (14.1 KiB)
Interrupt:10 Base address:0xcc00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1160 (1.1 KiB) TX bytes:1160 (1.1 KiB)