CentOS 网络问题

安装CentOS Live CD版后,进行手动配置IP,及dns.

问题1:/etc/resolv.conf文件被重置。
问题2:重启服务器后 网络不通,总需要network restart一下。
Shutting down interface eth0:  Error: Device 'eth0' (/org/freedesktop/NetworkManager/Devices/0) disconnecting failed: This device is not active                                                           [FAILED]
Shutting down interface eth1:  Error: Device 'eth1' (/org/freedesktop/NetworkManager/Devices/1) disconnecting failed: This device is not active                                                           [FAILED]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  RTNETLINK answers: File exists  [  OK  ]
Bringing up interface eth1:  RTNETLINK answers: File exists


1.关于DNS:
 在/etc /sysconfig/network-scripts/ifcfg-eth0里面最后加上dns的设置


2.centos6.x下Error: Connection activation failed: Device not managed by NetworkManager解决办法
1) chkconfig NetworkManager off
2) chkconfig network on
3) service NetworkManager stop
4) service network start


其它网络操作



1.IP配置
vi /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1
HWADDR=84:8F:69:E1:E4:40
TYPE=Ethernet
UUID=d5feb3fa-6080-4d8d-b96b-3051140ea337
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
BROADCAST=10.10.4.255
IPADDR=10.10.4.75
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0
NETWORK=10.10.4.0


2.网关
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=controller.shome
NETWORKING=yes
GATEWAY=10.10.4.1


即时生效:
# route add default gw 10.10.4.1 dev em1


3.修改DNS
vi /etc/resolv.conf 
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 202.115.160.39
nameserver 202.115.160.36


4.重启网络
service network restart
/etc/init.d/network restart


5.双网卡 ssh
改成
vi /etc/ssh/sshd_config
 ListenAddress 外网ip
 ListenAddress 内网ip
 service sshd restart

你可能感兴趣的:(CentOS网络)