我是靠谱客的博主 默默咖啡豆,最近开发中收集的这篇文章主要介绍ovs 实验,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

ovs tunnel test:

VxLAN:


VM1:
ifconfig eth0 192.168.2.12

ovs-vsctl add-br br0

ifconfig br0 10.1.1.2 up

ovs-vsctl add-port br0 vxlan0 -- set interface vxlan0 type=vxlan options:local_ip=192.168.2.12 options:remote_ip=192.168.2.13 option:key=5000

iptables -I INPUT -p udp --dport 4789 -j ACCEPT

VM2:
ifconfig eth0 192.168.2.13

ovs-vsctl add-br br0
ifconfig br0 10.1.1.3 up

ovs-vsctl add-port br0 vxlan0 -- set interface vxlan0 type=vxlan options:local_ip=192.168.2.13 options:remote_ip=192.168.2.12 option:key=5000

iptables -I INPUT -p udp --dport 4789 -j ACCEPT

ping from br0 on VM1 to br0 on VM2.

tcpdump -i eth0 -v -w vxlan.pcap
tftp -p -r gre.pcap 192.168.1.16

gre:


VM1:
ifconfig eth0 192.168.2.12

ovs-vsctl add-br br0

ifconfig br0 10.1.1.2 up

ovs-vsctl add-port br0 gre0 -- set interface gre0 type=gre option:remote_ip=192.168.2.13

/etc/init.d/firewall stop

VM2:
ifconfig eth0 192.168.2.13

ovs-vsctl add-br br0
ifconfig br0 10.1.1.3 up

ovs-vsctl add-port br0 gre0 -- set interface gre0 type=gre option:remote_ip=192.168.2.12

/etc/init.d/firewall stop

ping from br0 on VM1 to br0 on VM2.

tcpdump -i eth0 -v -w gre.pcap
tftp -p -r gre.pcap 192.168.1.16

ovs vlan test:

ovs-vsctl add-br br0
ifconfig br0 up
ovs-vsctl add-port br0 eth0
ovs-vsctl set port eth0 tag=1


ovs-vsctl add-br br1
ifconfig br1 up
ovs-vsctl add-port br1 eth1
ovs-vsctl add-port br1 eth2
ovs-vsctl set port eth1 tag=1
ovs-vsctl set port eth2 tag=2

ovs-vsctl add-port br0 patch_to_br1 -- set interface patch_to_br1 type=patch options:peer=patch_to_br0
ovs-vsctl add-port br1 patch_to_br0 -- set interface patch_to_br0 type=patch options:peer=patch_to_br1

ovs-vsctl set port patch_to_br1 VLAN_mode=trunk
ovs-vsctl set port patch_to_br0 VLAN_mode=trunk

ovs-vsctl set port patch_to_br1 trunk=1,2
ovs-vsctl set port patch_to_br0 trunk=1,2


connect eth0 eth1 eth2 with pc or ixia 1, 2, 3. ip is 192.168.2.12,192.168.2.13,192.168.2.14.


send one pkt from ixia to eth0, tcpdump -i br0/br1 -xxxx can see packet with vlan tag 1, pkt vlan tag1 is removed when captured on ixia2(eth1 output), pkt can not captured on ixia3
(pkt with vlan tag1 is dropped by eth2).

on pc1, ping 192.168.2.13 is ok, ping 192.168.2.14 is fail. tcpdump eth0 and eth1 can see pkts without vlan tag,tcpdump eth2 none pkt.
tcpdump br0/br1 can see none pkt. because fdb has learn and pkt will not go to bridge.
ovs-vsctl set bridge br0 flood-vlans=1,2
ovs-vsctl set bridge br1 flood-vlans=1,2

will dump vlan tag pkts on br0/br1 again.

ps: other command

ovs-vsctl set port eth2 trunk=1,2
ovs-vsctl remove port eth2 trunk 1,2
ovs-vsctl remove port eth2 tag 2
ovs-vsctl set bridge br0 flood-vlans=1,2
ovs-vsctl set bridge br1 flood-vlans=1,2

最后

以上就是默默咖啡豆为你收集整理的ovs 实验的全部内容,希望文章能够帮你解决ovs 实验所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(35)

评论列表共有 0 条评论

立即
投稿
返回
顶部