版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
首先使用route -n查看路由表
route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 1.1.1.1 0.0.0.0 UG 100 0 0 enp5s0f0 10.2.0.0 172.20.3.254 255.255.0.0 UG 0 0 0 enp5s0f1
然后查看工作的网卡:
ip add 1: lo:mtu 65536 qdisc noqueue state UNKNOWN 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 2: enp5s0f0:mtu 1500 qdisc mq state UP qlen 1000 link/ether f4:ce:46:b0:3e:82 brd ff:ff:ff:ff:ff:ff inet 1.1.1.1/27 brd 139.220.242.63 scope global enp5s0f0 valid_lft forever preferred_lft forever inet 1.1.1.31/32 scope global enp5s0f0 valid_lft forever preferred_lft forever 3: enp5s0f1:mtu 1500 qdisc mq state UP qlen 1000 link/ether f4:ce:46:b0:3e:83 brd ff:ff:ff:ff:ff:ff inet 172.20.3.64/24 brd 172.20.3.255 scope global enp5s0f1 valid_lft forever preferred_lft forever inet 172.20.3.66/32 scope global enp5s0f1 valid_lft forever preferred_lf