默认网关设置
第一生效文件
[ root @ old boy~] # grep-I gate/etc/sys config/network-scripts/if CFG-eth 0
网关=192.168.1.1
第二生效文件
[ root @ old boy~] # grep-I gate/etc/sys config/network
网关=192.168.1.1
第三,命令行有限,暂时生效
显示网关命令: route-n和netstat -n (两个命令都显示网关) )。
[root@oldboy ~]# route -n
kernel IP路由表
destinationgatewaygenmaskflagsmetricrefuseiface
192.168.1.0.0.0.0255.255.255.0 u 00 eth 0
169.254.0.0.0.0.0255.255.0.0 u 10020 eth 0
0.0.0.0192.168.1.10.0.0 ug00 eth 0
[root@oldboy ~]# netstat -rn
kernel IP路由表
目标网关掩码smsswindowirttiface
192.168.1.0.0.0.0255.255.255.0 u 00 eth 0
169.254.0.0.0.0.0255.255.0.0 u 00 eth 0
0.0.0.0192.168.1.10.0.0 ug00 eth 0
路由添加默认GW 192.168.1.1
路由戴尔默认GW 192.168.1.1
route功能很多,不仅仅是配置默认网关、网络(静态)路由。