这个bug以前遇到过,当时认为是自己配置的问题。
使用centos的NetworkManager给eth0配置多个网卡。
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=08:00:27:52:86:B2
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.0.171
PREFIX=24
GATEWAY=192.168.0.254
IPADDR2=10.10.10.2
PREFIX2=8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
运行ip a
显示
eth0 Link encap:Ethernet HWaddr 08:00:27:52:86:B2
inet addr:192.168.0.171 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe52:86b2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:991 errors:0 dropped:0 overruns:0 frame:0
TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10000
RX bytes:135022 (131.8 KiB) TX bytes:10381 (10.1 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:32 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1920 (1.8 KiB) TX bytes:1920 (1.8 KiB)
只有一块网卡
删除NetworkManager
yum remove NetworkManager NetworkManager-gnome NetworkManager-glib
还是使用老办法,创建ifcfg-eth0的虚拟配置文件
# cd /etc/sysconfig/network-scripts
# cp ifcfg-eth0 ifcfg-eth0:0
# vi ifcfg-eth0:0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.11
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet
重启网络
# /etc/init.d/network restart
或者
service network restart
阅读(505) | 评论(0) | 转发(0) |