查看網關的方法


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM