查看网关的方法

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

posted @ 2020-09-20 10:45  努力吧阿团  阅读(919)  评论(0)    收藏  举报