Linux下修改网卡IP、DNS和网关
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=ppy
GATEWAY=192.168.1.1
三、重新启动网络配置
/etc/init.d/network restart
DNS:
编辑/etc/resolv.conf