网卡配置路径 :/etc/sysconfig/network-scripts/ifcfg-interface-name
ifconfig XX up ;ifconfig XX down
ifup XX ;ifdown XX
====================================================================
em2专线配置
DEVICE=em2
TYPE=Ethernet
UUID=e29c3d0f-9e1a-41f0-970a-735e7b7423e9
ONBOOT=no
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=144.33.6X.66
PREFIX=24
NETMASK=255.255.255.252
GATEWAY=144.33.6X.65
DNS1=61.177.7.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System em2"
HWADDR=F0:1F:AF:E6:49:FB
em1:略
==================================================================
添加路由:
访问9.234.5.X 都走gw 144.33.6X.66 这个网关 则用专线的配置就起作用了
默认访问走电信的 default网关
**********************************************
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
9.234.5.0 144.33.6X.65 255.255.255.0 UG 1 0 0 em2
172.18.11.0 * 255.255.255.0 U 1 0 0 em1
144.33.6.0 * 255.255.255.0 U 1 0 0 em2
default 172.18.1X1.254 0.0.0.0 UG 0 0 0 em1
*******************************************
route add -net 9.234.5.0 netmask 255.255.255.0 gw 144.33.6X.66 metric 1 dev em2
删除
rout del -net XXXXXX netmask XXXXXX
======================================================================================