查看网关的方法


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