Openstack 网络类型 vxlan -> vlan

Controller节点:
# vi /etc/neutron/plugins/ml2/ml2_conf.ini
修改前(vxlan):

[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = openvswitch,l2population
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[ml2_type_vlan]
#network_vlan_ranges = provider:1:1000
[ml2_type_vxlan]
vni_ranges = 1:1000
[securitygroup]
enable_ipset = true

修改后(vlan):

[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vlan
mechanism_drivers = openvswitch,l2population
extension_drivers = port_security
external_network_type = flat
[ml2_type_flat]
flat_networks = public
[ml2_type_vlan]
network_vlan_ranges = default:1:3000
[ml2_type_vxlan]
# vni_ranges = 1:1000
[securitygroup]
enable_ipset = true

# vi /etc/neutron/plugins/ml2/openvswitch_agent.ini

[agent]
tunnel_types = 
l2_population = True
[ovs]
bridge_mappings = public:br-provider,default:br-em2
local_ip = 10.0.0.11
[securitygroup]
firewall_driver = iptables_hybrid

新增网桥br-em2:

# ovs-vsctl add-br br-em2

将网卡1加入br-em2网桥:

# ovs-vsctl add-port br-em2 eth1

配置网桥IP地址:

# ifconfig eth1 0.0.0.0
# ifconfig br-em2 up
# ifconfig br-em2 10.0.0.11/24

重启计算及网络:

# systemctl restart openstack-nova-api.service
# systemctl restart neutron-*

Compute节点:
# vi /etc/neutron/plugins/ml2/openvswitch_agent.ini

[ovs]
local_ip = 10.0.0.21
bridge_mappings = default:br-em2
[agent]
tunnel_types = 
l2_population = True

新增网桥br-em2:

# ovs-vsctl add-br br-em2

将网卡1加入br-em2网桥:

# ovs-vsctl add-port br-em2 eth1

配置网桥IP地址:

# ifconfig eth1 0.0.0.0
# ifconfig br-em2 up
# ifconfig br-em2 10.0.0.21/24

重启计算及网络:

# systemctl restart openstack-nova-compute.service
# systemctl restart neutron-openvswitch-agent.service

*rc.local文件:
# vi /etc/rc.local

Controller:
# ifconfig eth0 0.0.0.0
# ifconfig eth1 0.0.0.0
# ifconfig br-provider 管理口IP
# ifconfig br-em2 10.0.0.11/24
# route add default gw 管理口网关

Compute:
# ifconfig eth1 0.0.0.0
# ifconfig br-em2 10.0.0.21/24

授权:
# chmod +x /etc/rc.local

注意:
以上步骤,先修改配置文件,再创建网桥(创建网桥之前先启ovs服务,否则会导致网桥不可用)配置网桥,最后重启网络和计算服务,

相关推荐