CentOS 6.x启动时激活网卡

安装CentOS 6.x操作系统后,开机时发现没有网络,最后发现系统启动时未激活网卡 - 因为只有在激活状态的网卡才能去连接网络,进行网络通讯。

执行“ifconfig“命令发现只有lo网卡,并没有eth0。
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1  (Local Loopback)
        RX packets 53404  bytes 12295751 (11.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 53404  bytes 12295751 (11.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


执行service network restart重启网络服务,发现命令提示中并没有开启eth0的提示。


修改网卡配置文件“vi /etc/sysconfig/network-scripts/ifcfg-eth0“,将“ONBOOT=no”改为“ONBOOT=yes”,指明在系统启动时激活网卡,保存退出。


重启网络服务,这时,命令提示中就会出现开启eth0的信息。
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.214.37  netmask 255.255.240.0  broadcast 172.17.223.255
        ether 00:16:3e:03:ec:62  txqueuelen 1000  (Ethernet)
        RX packets 16407439  bytes 3187553009 (2.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 95865826  bytes 8299737224 (7.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1  (Local Loopback)
        RX packets 53414  bytes 12297269 (11.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 53414  bytes 12297269 (11.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



再次输入“ifconfig“命令检查一下,OK,大功告成。

详情请见:http://blog.csdn.net/liang19890820/article/details/52108979

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值