Linux查看网关命令

1 查看网卡配置文件

cat /etc/sysconfig/network-scripts/ifcfg-eth0

注意1:如果网卡配置是动态获取的,通过这种方式可能看不到;

注意2:在查看配置网络之前我们先要知道centos的网卡名称是什么,centos7不再使用ifconfig命令,可通过命令ip addr 查看,如图,网卡名为eth0

 

 

 

2 通过ip命令

 ip route show

 

 

 

3 通过route命令

route -n

 

 

 

4 通过netstat命令

netstat -rn

 

 

 

 

posted @ 2022-01-18 19:06  joshua317  阅读(1496)  评论(0编辑  收藏  举报