如你梦想和现实只是一步之遥,那么我觉得这一步就应该是执着和笨蛋式的坚持了吧。

Centos6设置固定IP

linux 独孤九剑 123℃

需要修改的问题就:
1、配置需要修改的文件
# 配置主要用到文件
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/resolv.conf

2、修改/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1

3、修改/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:41:66:5D # 修改成自己机器的
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.208
NETNASK=255.255.255.0
GATEWAY=192.168.1.1

DNS1=192.168.1.1

4、修改/etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1

重启:
网卡启动时报Connection activation failed: Device not managed by NetworkManager的错误解决
新装的CentOS6.0服务器,启动网络服务时报如下错误:
[root@localhost network-scripts]# service network restart
Shutting down interface eth0: Device state: 3 (disconnected)
[ OK ]
Shutting down interface eth2: [ OK ]
Shutting down interface eth5: Device state: 3 (disconnected)
[ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/12
[ OK ]
Bringing up interface eth1: Error: Connection activation failed: Device not managed by NetworkManager
[FAILED]

[root@localhost network-scripts]# chkconfig network off
[root@localhost network-scripts]# chkconfig network on
[root@localhost network-scripts]# service NetworkManager stop
Stopping NetworkManager daemon: [ OK ]
[root@localhost network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
问题解决。

参考:
https://segmentfault.com/a/1190000003052837
https://blog.csdn.net/shabaodou/article/details/8048535

PS: 服务器页面生成花费时间 0.14秒 查询 42 次

转载请注明:KEEP3YUE » Centos6设置固定IP

喜欢 (0)