Centos 网卡配置
主要配置文件:
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network
/etc/resolv.conf
网卡配置:
## vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static HWADDR=00:07:E9:05:E8:B4 #对应网卡的mac地址 IPADDR=192.168.100.11 NETMASK=255.255.255.0 ONBOOT="yes"
配置网关:
## vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost.localdomain GATEWAY=192.168.100.1 #网关地址,根据需要修改
配置路由:
## vi /etc/resolv.conf search localdomain nameserver 8.8.8.8 #Google域名服务器 nameserver 8.8.4.4 #Google域名服务器
重启网络配置,配置生效:
service network restart