分布式路由場景
相關(guān)配置修改:
- 1叹放,neutron.conf文件
router_distributed = True - 2店煞,l3_agent.ini文件
網(wǎng)絡(luò)節(jié)點(diǎn)
agent_mode = dvr_snat
計(jì)算節(jié)點(diǎn)
agent_mode = dvr - 3座咆,m2_conf.ini
[ml2]
enable_distributed_routing = True
[ovs]
bridge_mappings = physnet1:br-ex
創(chuàng)建虛擬機(jī)暗膜,配置浮動ip網(wǎng)絡(luò)后會發(fā)現(xiàn)如下改變:
1绵载,計(jì)算節(jié)點(diǎn)多了兩個namespace
fip-da5b385a-0a5f-4b11-8c7b-20792d1aa7c0
用于本節(jié)點(diǎn)中的配置了浮動ip的vm訪問外網(wǎng)饲梭,具體可以看該namespace中的iptables的nat規(guī)則期吓。
[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
配置了內(nèi)網(wǎng)的端口早歇,用于同個租戶的所有計(jì)算機(jī)節(jié)點(diǎn)上的虛擬機(jī)內(nèi)網(wǎng)之間的相互通信。所有節(jié)點(diǎn)上qrouter名稱都一致讨勤,包括網(wǎng)絡(luò)節(jié)點(diǎn)箭跳。
這里還有一個作用是獲取metadata信息(namespace中的iptables可以看到),發(fā)送給neutron-meta-agent服務(wù)潭千。
[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之間的數(shù)據(jù)轉(zhuǎn)發(fā)谱姓。
2,網(wǎng)絡(luò)節(jié)點(diǎn)上路由的namespace
snat-23a420aa-705a-46e1-b9e3-60c7a4456cbe
用于之配置了內(nèi)網(wǎng)ip,沒有配置浮動ip的虛擬機(jī)的外網(wǎng)訪問。
[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
如果網(wǎng)絡(luò)節(jié)點(diǎn)上啟動了虛擬機(jī)刨晴,可以用來做租戶虛擬機(jī)之間的通信屉来。這里還有一個作用是獲取metadata信息(namespace中的iptables可以看到),發(fā)送給neutron-meta-agent服務(wù)狈癞。
[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