![多个网络接口无法正常工作](https://linux22.com/image/199196/%E5%A4%9A%E4%B8%AA%E7%BD%91%E7%BB%9C%E6%8E%A5%E5%8F%A3%E6%97%A0%E6%B3%95%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C.png)
我的 Linux CentOS 上有两个网络接口。当我尝试通过外部网络访问网络服务器时以太币0它工作正常。但是当我尝试通过以下方式访问时以太币1它给了我时间。
这是路线:
[root@fe fe]# ip route list
default via 192.168.10.1 dev eth0 proto dhcp metric 101
default via 192.168.18.1 dev eth1 proto dhcp metric 102
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.237 metric 101
192.168.18.0/24 dev eth1 proto kernel scope link src 192.168.18.14 metric 102
这是ip a
命令产生
[fe@fe ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether d2:ce:a3:6d:a2:f4 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.237/24 brd 192.168.10.255 scope global dynamic noprefixroute eth0
valid_lft 416sec preferred_lft 416sec
inet6 fe80::d0ce:a3ff:fe6d:a2f4/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 8a:be:5d:40:8b:34 brd ff:ff:ff:ff:ff:ff
inet 192.168.18.14/24 brd 192.168.18.255 scope global dynamic noprefixroute eth1
valid_lft 3584sec preferred_lft 3584sec
inet6 fe80::88be:5dff:fe40:8b34/64 scope link noprefixroute
valid_lft forever preferred_lft forever
我可以使用 tcpdump 确认 ETH1 收到请求。
[root@fe fe]# tcpdump -i eth1 port 80
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
22:04:57.763317 IP 43.224.168.199.50770 > fe.lan.http: Flags [S], seq 2609591301, win 64240, options [mss 1412,nop,wscale 8,nop,nop,sackOK], length 0
22:04:57.764527 IP 43.224.168.199.50771 > fe.lan.http: Flags [S], seq 821872254, win 64240, options [mss 1412,nop,wscale 8,nop,nop,sackOK], length 0
22:04:58.021494 IP 43.224.168.199.50772 > fe.lan.http: Flags [S], seq 3220097528, win 64240, options [mss 1412,nop,wscale 8,nop,nop,sackOK], length 0