作者:Liping Mao 发表于:2014-09-10
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明
目前在Juno版本的trunk中已经合入了DVR相关的代码,我的理解是在Juno版本中DVR是一个experimental feature。最好需要稳定一个版本以后再上生产环境。之前写过一篇博文是DVR相关的,当时代码还没有实现,与实际的实现有一些出入。当前的DVR的实现是基于VXLAN的。关于VXLAN的优势,有时间会写一些体会,今天暂且不谈。
建议先看一下以下文档,对DVR有一些了解:
https://docs.google.com/presentation/d/1ktCLAdglpKdsC--fQ2F_c2d3X1u-lyRGGUzRu9ITuWo/edit#slide=id.g2b6a14e30_036
https://docs.google.com/presentation/d/1ktCLAdglpKdsC--fQ2F_c2d3X1u-lyRGGUzRu9ITuWo/edit#slide=id.g2b6a14e30_030
然后起了两个私有网络和一个DVR 路由器,拓扑如下:
再看一下虚机private2-compute2-VM的IP和路由:
最终会转发到br-int的qvo4e843b99-fb:
root@dvr-compute1:~# ovs-vsctl show
67f121bd-cca7-41c2-95ab-23ed85d1305b
Bridge br-tun
Port patch-int
Interface patch-int
type: patch
options: {peer=patch-tun}
Port "vxlan-0ae09f91"
Interface "vxlan-0ae09f91"
type: vxlan
options: {df_default="true", in_key=flow, local_ip="10.224.159.141", out_key=flow, remote_ip="10.224.159.145"}
Port "vxlan-0ae09f88"
Interface "vxlan-0ae09f88"
type: vxlan
options: {df_default="true", in_key=flow, local_ip="10.224.159.141", out_key=flow, remote_ip="10.224.159.136"}
Port br-tun
Interface br-tun
type: internal
Bridge br-int
fail_mode: secure
Port "qvo111517d8-c5"
tag: 2
Interface "qvo111517d8-c5"
Port patch-tun
Interface patch-tun
type: patch
options: {peer=patch-int}
Port "qr-001d0ed9-01"
tag: 2
Interface "qr-001d0ed9-01"
type: internal
Port br-int
Interface br-int
type: internal
Port "qr-ddbdc784-d7"
tag: 1
Interface "qr-ddbdc784-d7"
type: internal
Port "qvo4e843b99-fb"
tag: 1
Interface "qvo4e843b99-fb"
Bridge br-ex
Port br-ex
Interface br-ex
type: internal
Port "fg-081d537b-06"
Interface "fg-081d537b-06"
type: internal
ovs_version: "2.0.2"
fip-fbd46644-c70f-4227-a414-862a00cbd1d2
qrouter-0fbb351e-a65b-4790-a409-8fb219ce16aa
qdhcp-401f678d-4518-446c-9a33-cd2fb054c104
qdhcp-db755841-0764-4a8f-b962-8df008ce6330
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
qr-001d0ed9-01 Link encap:Ethernet HWaddr fa:16:3e:69:b4:05
inet addr:10.0.2.1 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::f816:3eff:fe69:b405/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:35 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropp