Linux下修改網卡IP和網關
建議通過終端字符方式下來修改
一修改IP地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.1.255
IPADDR=192.168.1.33
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
USERCTL=no
PEERDNS=no
TYPE=Ethernet
~
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.2.34
NETMASK=255.255.255.0
USERCTL=no
PEERDNS=no
TYPE=Ethernet
NETWORK=192.168.2.0
BROADCAST=192.168.2.255
二修改網關
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=Aaron
GATEWAY=192.168.1.1
三重新啟動網絡配置
/etc/init.d/network restart