码迷,mamicode.com
首页 > 其他好文 > 详细

配置默认网关

时间:2019-11-21 12:13:33      阅读:91      评论:0      收藏:0      [点我收藏+]

标签:oldboy   ifcfg-eth   use   span   pre   table   scripts   网关   name   

第一生效文件:/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 ~]# 

 

配置默认网关

标签:oldboy   ifcfg-eth   use   span   pre   table   scripts   网关   name   

原文地址:https://www.cnblogs.com/zoe233/p/11904375.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!