配置默认网关

走远了吗. 提交于 2019-12-05 04:00:35

第一生效文件:/etc/sysconfig/network-scripts/ifcfg-eth0

[root@newname ~]# grep -i gate /etc/sysconfig/network-scripts/ifcfg-eth3GATEWAY=192.168.0.1

 

第二生效文件:/etc/sysconfig/network

[root@newname ~]# grep -i gate /etc/sysconfig/network
GATEWAY=192.168.0.1

 

[root@oldboy ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.2.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth3
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth3
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth3
[root@oldboy ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.2.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth3
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth3
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth3
[root@oldboy ~]# 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!