[[email protected] sysconfig]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0 link-local * 255.255.0.0 U 1004 0 0 br0 10.0.0.0 * 255.0.0.0 U 0 0 0 br0 default 10.100.2.1 0.0.0.0 UG 0 0 0 br0
本机的IP是10.100.2.15 目标机的IP是10.100.0.98
增加一条路由:(这里我做了网桥如果不做网桥的话,可以直接在eth0上面)
sh-4.1# route add -net 10.100.2.0/24 br0 sh-4.1# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0 10.100.2.0 * 255.255.255.0 U 0 0 0 br0 link-local * 255.255.0.0 U 1004 0 0 br0 10.0.0.0 * 255.0.0.0 U 0 0 0 br0 default 10.100.2.1 0.0.0.0 UG 0 0 0 br0
还是不行,但删除下面这条路由后,成功了,但还不知是为什么
[[email protected] ~]# route del del -net 10.0.0.0/8 br0 [[email protected] ~]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0 10.100.2.0 * 255.255.255.0 U 0 0 0 br0 link-local * 255.255.0.0 U 1004 0 0 br0 default 10.100.2.1 0.0.0.0 UG 0 0 0 br0
时间: 2024-09-27 15:56:00