在openstack essex+quantum+vlan模式中,基于VLAN获取IP是个问题,今天实验成功,贴下步聚如下:
1、建立基于VLAN的PORT
ovs-vsctl add-port br33 vifvlan40br33 tag=40 -- set Interface vifvlan40br33 type=internal
2、设置此PORT的地址
ifconfig vifvlan40br33 10.50.50.1/24
3、建立DHCP
/usr/sbin/dnsmasq --strict-order --bind-interfaces=vifvlan40br33 --conf-file= --domain=novalocal --pid-file=/var/lib/nova/networks/nova-gw-wgz.pid --listen-address=10.50.50.1 --except-interface=lo --dhcp-range=10.50.50.2,static,120s --dhcp-lease-max=256 --dhcp-hostsfile=/var/lib/nova/networks/nova-gw-wgz.conf --leasefile-ro
(此处要注意,没加如下参数--dhcp-script=/usr/bin/nova-dhcpbridge)
4、设定DHCP分配参数
cat nova-gw-wgz.conf
fa:16:3e:75:3f:43,host-10.50.50.50.novalocal,10.50.50.50
fa:16:3e:1e:d4:90,host-10.50.50.51.novalocal,10.50.50.51
fa:16:3e:25:f8:5b,host-10.50.50.52.novalocal,10.50.50.52
5、重启两台物理机上虚机效果。