标签:
最近使用搭建了一个基于VXLAN的OpenStack 环境,发现要去dump ovs interfaces的包其实还是蛮麻烦的,
经过多番努力,找到了如下的在openstack下网络环境的一些trouble shooting的方法。
除了常见的工具如:ping, host, traceroute, tcpdump, ip neighbor, arp, arping, 还可以使用port mirror来完成ovs 包的dump。
我的环境里面有两个nodes,node1 启用了Nova和Neutron,node2只启用了Nova相关服务。
Node1的ovs环境:
sudo ovs-vsctl show 47a7cda2-1263-485a-8ae4-1be7cf53ed44 Bridge br-tun fail_mode: secure Port "veth0" Interface "veth0" Port patch-int Interface patch-int type: patch options: {peer=patch-tun} Port br-tun Interface br-tun type: internal Port "vxlan-0a674d0e" Interface "vxlan-0a674d0e" type: vxlan options: {df_default="true", in_key=flow, local_ip="10.103.77.13", out_key=flow, remote_ip="10.103.77.14"} Bridge br-int fail_mode: secure Port "tapb5e83be9-f9" tag: 2 Interface "tapb5e83be9-f9" type: internal Port "qvo42d126bc-e1" tag: 2 Interface "qvo42d126bc-e1" Port int-br-ex Interface int-br-ex type: patch options: {peer=phy-br-ex} Port patch-tun Interface patch-tun type: patch options: {peer=patch-int} Port br-int Interface br-int type: internal Bridge br-ex Port "eth1" Interface "eth1" Port br-ex Interface br-ex type: internal Port phy-br-ex Interface phy-br-ex type: patch options: {peer=int-br-ex} ovs_version: "2.0.2"
我要做的是dump出br-tun上patch-int这个interface的所有packages, 以便看到package在经过br-tun转换后的样子
ip link add type veth
ip link set veth0 up
ip link set veth1 up
ovs-vsctl add-port br-tun "veth0"
ovs-vsctl -- set Bridge br-tun mirrors=@m -- --id=@veth0 get Port veth0 -- --id=@patch-int get Port patch-int -- --id=@br-tun get Port br-tun -- --id=@m create Mirror name=veth select-src-port=@br-tun,@patch-int select-dst-port=@br-tun,@patch-int output-port=@veth0
成功后会输出一个mirror的id,你可以使用
ovs-vsctl list bridge
查看mirror是否在outout里面
_uuid : 18303d75-8715-408d-b9d7-5ef0424734f2 controller : [] datapath_id : "0000763d30188d40" datapath_type : system external_ids : {} fail_mode : secure flood_vlans : [] flow_tables : {} ipfix : [] mirrors : [d2bcbe65-ae4c-4b88-9172-cf84dae39d0e] name : br-tun netflow : [] other_config : {} ports : [3eb258b0-f9db-4dfa-bbd5-697162f26142, 6755f9ce-a8fa-4b52-ba3a-06c798e12b9b, c45bbbd7-6baf-4774-b0e4-493d74ae0589, ffcf5619-baaf-469a-bb2d-9016ede95c92] protocols : ["OpenFlow10"] sflow : [] status : {} stp_enable : false
sudo tcpdump -i veth0 -vv -ne -w veth0.cap
使用wireshark查看你会发现,这些package已经是被translate成普通而不是VXLAN的package了,所以看不到vxlan的tunnel id了
参考资料:
VXLAN:https://tools.ietf.org/pdf/rfc7348.pdf
Neutron Troubleshooting:http://docs.openstack.org/openstack-ops/content/network_troubleshooting.html
OpenvSwitch Port Mirror in OpenStack Neutron
标签:
原文地址:http://www.cnblogs.com/sting2me/p/4849851.html