OpenvSwitch Port Mirror in OpenStack Neutron
来源:互联网 发布:jquery easing.js下载 编辑:程序博客网 时间:2024/05/16 09:11
- 前言
最近使用搭建了一个基于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 show47a7cda2-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转换后的样子
- 首先,创建类型为veth的interface
ip link add type vethip link set veth0 upip link set veth1 up
- 其次,把这个veth0添加到br-tun上面
ovs-vsctl add-port br-tun "veth0"
- 然后,创建port mirror
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-5ef0424734f2controller : []datapath_id : "0000763d30188d40"datapath_type : systemexternal_ids : {}fail_mode : secureflood_vlans : []flow_tables : {}ipfix : []mirrors : [d2bcbe65-ae4c-4b88-9172-cf84dae39d0e]name : br-tunnetflow : []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
- 最后,使用tcpdump来查看veth0上的package(我一般会把output输出到cap文件,然后用wireshark查看,非常直观)
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
0 0
- OpenvSwitch Port Mirror in OpenStack Neutron
- OpenStack neutron-openvswitch-agent 启动分析
- openstack网络节点中neutron-openvswitch错误
- openstack neutron-plugin-openvswitch-agent start 报错
- OpenStack O版 neutron-openvswitch-agent 的一个bug
- openstack neutron源码分析(四)--------port的创建流程
- Openvswitch手册(4): Mirror
- Openvswitch手册(4): Mirror
- neutron openvswitch agent
- Openstack Neutron
- Neutron印象4:neutron-openvswitch-agent
- neutron-openvswitch-agent crash error!
- Neutron总结-openvswitch+vlan网络
- Neutron总结-openvswitch+vxlan网络
- Neutron OpenvSwitch agent工作原理
- Neutron总结-openvswitch+vlan网络
- OpenStack网络Openvswitch详解
- 【neutron】OpenStack Neutron -- 学习资料
- 文件内容的简单比较(C++)
- jQuery22(替换元素,包裹元素)
- 设计模式六大原则
- Insertion Sort and Merge Sort
- jQuery23(获取radiobuttomvalue及选中)
- OpenvSwitch Port Mirror in OpenStack Neutron
- HDU 1358 Period
- NHibernate的几种查询方式
- 那年声明理解不了定义与初始化(一)
- 01背包问题一维空间优化的理解
- 开头很艰难,但也要写下去
- apache commons io 2.2(二)Filter部分
- 算法导论例程——计数排序
- #ifdef __cplusplus extern "C" { #endif //一段代码 #ifdef __cplusplus } #endif