DVR介绍
后续补充,我还没完全搞明白原理
DVR配置
这里说明一下,我的controller node和network node在同一台机器上
controller节点 [[email protected] ~(keystone_admin)]# vim /etc/neutron/neutron.conf # 添加如下配置选项 router_distributed = True [[email protected] ~(keystone_admin)]# vim /etc/neutron/plugins/ml2/ml2_conf.ini # 网络采用ml2+vxlan,配置如下 [ml2] type_drivers = flat,vxlan,vlan,gre tenant_network_types = vxlan mechanism_drivers = openvswitch,l2population [ml2_type_flat] [ml2_type_vlan] [ml2_type_gre] [ml2_type_vxlan] vni_ranges = 1:1000 vxlan_group = 239.1.1.1 [agent] l2_population = True tunnel_types = vxlan enable_distributed_routing = True [ovs] enable_tunneling = True tunnel_type = vxlan integration_bridge = br-int local_ip = 10.0.0.162 [securitygroup] firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver enable_security_group = True enable_ipset = True [[email protected] ~(keystone_admin)]# vim /etc/neutron/l3_agent.ini [DEFAULT] interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver ovs_use_veth = True use_namespaces = True external_network_bridge = br-ex router_delete_namespaces = True agent_mode = dvr_snat # 虚拟机snat上外网走network node 的L3
compute节点 [[email protected] ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini # 网络采用ml2+vxlan,配置如下 [ml2] type_drivers = flat,vxlan,vlan,gre tenant_network_types = vxlan mechanism_drivers = openvswitch,l2population [ml2_type_flat] [ml2_type_vlan] [ml2_type_gre] [ml2_type_vxlan] vni_ranges = 1:1000 vxlan_group = 239.1.1.1 [agent] l2_population = True tunnel_types = vxlan enable_distributed_routing = True [ovs] enable_tunneling = True tunnel_type = vxlan integration_bridge = br-int local_ip=10.0.0.2 [securitygroup] firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver enable_security_group = True enable_ipset = True [[email protected] ~]# vim /etc/neutron/l3_agent.ini # compute node也要起l3-agent,记住还要add-br br-ex,add-port br-ex eth2这些 [DEFAULT] interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver ovs_use_veth = True use_namespaces = True external_network_bridge = br-ex router_delete_namespaces = True agent_mode = dvr # floating ip直接走compute node的l3 [[email protected] ~]# vim /etc/neutron/metadata_agent.ini # compute node也起了l3,所以会有找metadata的问题 [DEFAULT] auth_url = http://controller-162:35357/v2.0 auth_region = regionOne admin_tenant_name = service admin_user = neutron admin_password = neutron nova_metadata_ip = controller-162 # controller node的metadata地址(nova-api接管metadata服务) metadata_proxy_shared_secret = meta_pass
DVR功能
先来看下controller node的namespace
[[email protected] ~(keystone_admin)]# ip netns qdhcp-f8876645-352e-48d2-b96c-304cb8de805f snat-ac4a4d9b-27c7-492b-824a-ae384710ab2a # 虚拟机上外网专门的snat,单独出来的namespace qrouter-ac4a4d9b-27c7-492b-824a-ae384710ab2a
[[email protected] ~]# ip netns qrouter-ac4a4d9b-27c7-492b-824a-ae384710ab2a # qrouter-xxxxxxx 跟上面一样的哦,floating ip的dnat规则在这里 # 我在dashboard上面绑定floating ip的时候找不到port,后台命令行可以绑定,不懂是不是bug。 [[email protected] ~(keystone_admin)]# nova floating-ip-associate test-5 172.16.101.2 # 绑定floating ip,出现了下面这个东东 [[email protected] ~]# ip netns fip-53f6877e-2f46-43e3-93b7-7e22786cacb2 # 暂时还不知道是什么东东,明天再看看
参考链接
https://wiki.openstack.org/wiki/Neutron/DVR/HowTo
https://wiki.openstack.org/wiki/Neutron/DVR#Juno_and_Distributed_Routing
http://www.openstack.cn/p2510.html
时间: 2024-10-11 09:52:34