今天发现创建实例无法访问外部网络,我使用的桥接模式,openstack在eth0创建br0网卡,通过eth0与外部通信。
检查发现br0 MAC与eth0 MAC不一致,理论上说br0的MAC是学习eth0的,并且与eth0 MAC保持一致。
[root@node11 ~]# ifconfig br0 | grep HWaddr
br0 Link encap:Ethernet HWaddr FE:16:3E:50:37:BD
[root@node11 ~]# ifconfig eth0 | grep HWaddr
eth0 Link encap:Ethernet HWaddr 9C:B6:54:95:4D:48
解决办法如下:
[root@node11 ~]# brctl addif br0 eth0
[root@node11 ~]# service network restart
Shutting down interface br1: [ OK ]
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
Bringing up interface br1: [ OK ]
[root@node11 ~]# ifconfig br0 | grep HWaddr
br0 Link encap:Ethernet HWaddr 9C:B6:54:95:4D:48
[root@node11 ~]# ifconfig eth0 | grep HWaddr
eth0 Link encap:Ethernet HWaddr 9C:B6:54:95:4D:48
[root@node11 ~]#