标签:eth 问题 uid device etc net eth0 str centos
编辑文件 /etc/sysconfig/network-scripts/ifcfg-eth0
1 [root@CentOS root123456]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 2 3 DEVICE=eth0 4 HWADDR=00:0C:29:CC:88:ED 5 TYPE=Ethernet 6 UUID=4c569b9b-3fd0-40a6-97f3-2d1456d64b4e 7 ONBOOT=yes 8 NM_CONTROLLED=yes 9 #BOOTPROTO=dhcp <==从此往下编辑 10 BOOTPROTO=none <==其实关键字只有dhcp,可手动输入none或static 11 IPADDR=192.168.1.124 12 NETMASK=255.255.255.0 13 GATWAY=192.168.1.254
有个问题就是能连上Xshell,但貌似不能上外网如果你检查以下路由就会发现没有配置成功
1 [root@CentOS ~]# route -n 2 Kernel IP routing table 3 Destination Gateway Genmask Flags Metric RefUse Iface 4 192.168.1.0 0.0.0.0 255.255.255.0 U 1 00 eth0 5 192.168.122.0 0.0.0.0 255.255.255.0 U 0 00 virbr0
IP生效:
1 /sbin/ifdown eth0 2 /sbin/ifup eth0
通知网关更新信息: /etc/init.d/network restart
配置DNS:
1 vi /etc/resolv.conf 2 nameserver 202.96.134.133
标签:eth 问题 uid device etc net eth0 str centos
原文地址:http://www.cnblogs.com/fallenmoon/p/6744043.html