我configuration了3个网卡。 其中一个是局域网卡,另外一个是万网卡。
eth0 Link encap:Ethernet HWaddr 00:50:56:00:30:da inet addr:5.xx1 Bcast:5.xx3 Mask:255.255.255.248 inet6 addr: fe80::250:56ff:fe00:30da/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4898 errors:0 dropped:0 overruns:0 frame:0 TX packets:5410 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:461542 (461.5 KB) TX bytes:970151 (970.1 KB) eth1 Link encap:Ethernet HWaddr de:8d:6a:0c:af:05 inet addr:10.0.0.254 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::dc8d:6aff:fe0c:af05/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:50 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2950 (2.9 KB) TX bytes:468 (468.0 B) eth2 Link encap:Ethernet HWaddr 00:50:56:00:32:f7 inet addr:5.xx2 Bcast:5.xx3 Mask:255.255.255.248 inet6 addr: fe80::250:56ff:fe00:32f7/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2619 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:217904 (217.9 KB) TX bytes:960 (960.0 B)
路由表:
Destination Gateway Genmask Flags Metric Ref Use Iface default static.225.150. 0.0.0.0 UG 0 0 0 eth0 localnet * 255.255.255.248 U 0 0 0 eth0 localnet * 255.255.255.248 U 0 0 0 eth2 10.0.0.0 * 255.255.255.0 U 0 0 0 eth1
我可以ping通或从eth0连接。 不过,我想通过eth2的IP地址与服务器相连。 我不能通过eth2 ping和ssh。 eth0和eth2的ip地址使用相同的网关地址。 所以,这些IP地址是相同的子网。 因此,我使用两个接口卡的Mac地址限制为IP地址。
有什么可能做错了?
你现在正在做的事情根本无法工作,没有什么可能通过eth2路由。 在同一networking中使用2个网卡有两种方式:
路由是最简单的:保留默认路由,并通过eth2添加特定路由,以便通过它到达的主机。 绑定更加灵活,但需要在服务器和交换机上进行设置。