centos 6.4在配置kvm bridge方式时网卡配置注意事项

[root@localhost ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
#UUID=5f2e4125-b409-4402-b167-91ca2d4bbf4c
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=00:0C:29:2D:22:8E
#IPADDR=172.16.10.10
#PREFIX=16
#GATEWAY=172.16.10.2
#DNS1=172.16.10.2
#DOMAIN=8.8.8.8
#DEFROUTE=yes
#IPV4_FAILURE_FATAL=yes
IPV6INIT=no
BRIDGE=br0
NAME="System eth0"

 

注意这里的NM_CONTROLLED=yes一定要打开,如果不打开,使用ifconfig命令就看不到eth0这块网卡了。

 

[root@localhost ~]# more /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=00:0C:29:2D:22:8E
IPADDR=172.16.10.10
PREFIX=24
GATEWAY=172.16.10.2
DNS1=172.16.10.2
DOMAIN=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
TYPE=Bridge
NAME="br0"

 

在br0(桥接网卡)里面的NM_CONTROLLED=no一定要关闭,否则service network restart的时候br0接口起不起来,通过ifconfig也无法看到br0接口。

 

ifconfig命令显示如下:

[root@localhost ~]# ifconfig
br0       Link encap:Ethernet  HWaddr 00:0C:29:2D:22:8E 
          inet addr:172.16.10.10  Bcast:172.16.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe2d:228e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9372 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1147 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1352733 (1.2 MiB)  TX bytes:154833 (151.2 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:29:2D:22:8E 
          inet6 addr: fe80::20c:29ff:fe2d:228e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10744 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1218 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1702523 (1.6 MiB)  TX bytes:149631 (146.1 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:2D:22:98 
          inet6 addr: fe80::20c:29ff:fe2d:2298/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9328 errors:0 dropped:0 overruns:0 frame:0
          TX packets:178 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1581075 (1.5 MiB)  TX bytes:52271 (51.0 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:54 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4742 (4.6 KiB)  TX bytes:4742 (4.6 KiB)

vnet0     Link encap:Ethernet  HWaddr FE:54:00:2E:E6:E1 
          inet6 addr: fe80::fc54:ff:fe2e:e6e1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8100 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:300 (300.0 b)  TX bytes:1366254 (1.3 MiB)

vnet1     Link encap:Ethernet  HWaddr FE:54:00:BA:F6:0B 
          inet6 addr: fe80::fc54:ff:feba:f60b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8070 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:386 (386.0 b)  TX bytes:1361594 (1.2 MiB)

 

总结:在centos 6.4下配置桥接模式时,eth0(实际网卡)里面的NM_CONTROLLED=yes,br0(桥接网卡)里面的NM_CONTROLLED=no。配置后service network restart,使用ifconfig命令查看相关的接口是否active。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值