分布式路由场景
相关配置修改:
- 1,neutron.conf文件
router_distributed = True - 2,l3_agent.ini文件
网络节点
agent_mode = dvr_snat
计算节点
agent_mode = dvr - 3,m2_conf.ini
[ml2]
enable_distributed_routing = True
[ovs]
bridge_mappings = physnet1:br-ex
创建虚拟机,配置浮动ip网络后会发现如下改变:
1,计算节点多了两个namespace
fip-da5b385a-0a5f-4b11-8c7b-20792d1aa7c0
用于本节点中的配置了浮动ip的vm访问外网,具体可以看该namespace中的iptables的nat规则。
[root@compute01 neutron-l3-agent]# ip netns exec fip-da5b385a-0a5f-4b11-8c7b-20792d1aa7c0 ifconfig
fg-3ee6f569-0f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 202.95.237.56 netmask 255.255.255.0 broadcast 202.95.237.255
inet6 fe80::f816:3eff:fe33:7d71 prefixlen 64 scopeid 0x20<link>
ether fa:16:3e:33:7d:71 txqueuelen 1000 (Ethernet)
RX packets 696666 bytes 52502651 (50.0 MiB)
RX errors 0 dropped 2 overruns 0 frame 0
TX packets 6561 bytes 825105 (805.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
fpr-23a420aa-7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.93.95 netmask 255.255.255.254 broadcast 0.0.0.0
inet6 fe80::f43d:13ff:fe64:887 prefixlen 64 scopeid 0x20<link>
ether f6:3d:13:64:08:87 txqueuelen 1000 (Ethernet)
RX packets 223 bytes 23594 (23.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 277 bytes 25816 (25.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
qrouter-23a420aa-705a-46e1-b9e3-60c7a4456cbe
配置了内网的端口,用于同个租户的所有计算机节点上的虚拟机内网之间的相互通信。所有节点上qrouter名称都一致,包括网络节点。
这里还有一个作用是获取metadata信息(namespace中的iptables可以看到),发送给neutron-meta-agent服务。
[root@compute01 neutron-l3-agent]# ip netns exec qrouter-23a420aa-705a-46e1-b9e3-60c7a4456cbe ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
qr-143275dd-f7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::f816:3eff:fe22:97e6 prefixlen 64 scopeid 0x20<link>
ether fa:16:3e:22:97:e6 txqueuelen 1000 (Ethernet)
RX packets 6267 bytes 727072 (710.0 KiB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 6742 bytes 741667 (724.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
rfp-23a420aa-7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.93.94 netmask 255.255.255.254 broadcast 0.0.0.0
inet6 fe80::1cfa:7fff:feec:e38e prefixlen 64 scopeid 0x20<link>
ether 1e:fa:7f:ec:e3:8e txqueuelen 1000 (Ethernet)
RX packets 275 bytes 25720 (25.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 222 bytes 23552 (23.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
以上两个namespace中的fpr-23a420aa-7口用来绑定两个namespace之间的数据转发。
2,网络节点上路由的namespace
snat-23a420aa-705a-46e1-b9e3-60c7a4456cbe
用于之配置了内网ip,没有配置浮动ip的虚拟机的外网访问。
[root@network01 neutron-l3-agent]# ip netns exec snat-23a420aa-705a-46e1-b9e3-60c7a4456cbe ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
qg-c85b7e80-77: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 202.95.237.54 netmask 255.255.255.0 broadcast 202.95.237.255
inet6 fe80::f816:3eff:fe59:a287 prefixlen 64 scopeid 0x20<link>
ether fa:16:3e:59:a2:87 txqueuelen 1000 (Ethernet)
RX packets 698740 bytes 52493856 (50.0 MiB)
RX errors 0 dropped 37 overruns 0 frame 0
TX packets 2010 bytes 136731 (133.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
sg-6e44f654-c6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet 10.0.0.4 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::f816:3eff:feb5:dfbc prefixlen 64 scopeid 0x20<link>
ether fa:16:3e:b5:df:bc txqueuelen 1000 (Ethernet)
RX packets 51 bytes 3898 (3.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 49 bytes 4756 (4.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
qrouter-23a420aa-705a-46e1-b9e3-60c7a4456cbe
如果网络节点上启动了虚拟机,可以用来做租户虚拟机之间的通信。这里还有一个作用是获取metadata信息(namespace中的iptables可以看到),发送给neutron-meta-agent服务。
[root@network01 neutron-l3-agent]# ip netns exec qrouter-23a420aa-705a-46e1-b9e3-60c7a4456cbe ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
qr-143275dd-f7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::f816:3eff:fe22:97e6 prefixlen 64 scopeid 0x20<link>
ether fa:16:3e:22:97:e6 txqueuelen 1000 (Ethernet)
RX packets 23 bytes 2110 (2.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11 bytes 774 (774.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0