route -n
[root@nfs ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.122.0.1 0.0.0.0 UG 0 0 0 ens34 10.122.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens34
ip route show
[root@nfs ~]# ip route show default via 10.122.0.1 dev ens34 10.122.0.0/24 dev ens34 proto kernel scope link src 10.122.0.110
netstat -r
[root@nfs ~]# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default gateway 0.0.0.0 UG 0 0 0 ens34 10.122.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens34 link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens34
more /etc/network/interfaces
查看配置文件
此方法適用於Debian/Ubuntu
more /etc/sysconfig/network-scripts/ifcfg-eth0
查看配置文件
此方法適用於Red Hat/Centos
轉載於:https://blog.csdn.net/x356982611/article/details/82260987