ovs qinq

网络拓扑

h1 -- eth1- s3 -eth2 -- eth1- s4 -eth2 -- h2

h1-eth0<->s3-eth1 (OK OK) dot1q-tunnel tag=100
s3-eth2<->s4-eth1 (OK OK) trunk=100 trunk=100
s4-eth2<->h2-eth0 (OK OK) dot1q-tunnel tag=100

dpctl add-flow action=normal

ovs-vsctl set port s3-eth2 VLAN_mode=trunk
ovs-vsctl set port s3-eth2 trunk=100

ovs-vsctl set port s4-eth1 VLAN_mode=trunk
ovs-vsctl set port s4-eth1 trunk=100

ovs-vsctl set port s3-eth1 vlan_mode=dot1q-tunnel tag=100
ovs-vsctl set port s4-eth2 vlan_mode=dot1q-tunnel tag=100

ovs-vsctl add-port <bridge name> <port name>  
ovs-vsctl set interface <port name> type=patch  
ovs-vsctl set interface <port name> options:peer=<peer name>

vlan创建:
ip link add link h1-eth0 name eth0.5 type vlan id 5
ip -d link show eth0.5
ip addr add 10.0.0.5/24 dev eth0.5
ip link set dev eth0.5 up

ip link add link h2-eth0 name eth0.5 type vlan id 5
ip -d link show eth0.5
ip addr add 10.0.0.6/24 dev eth0.5
ip link set dev eth0.5 up

vconfig add eth0 5
ip addr add 10.0.0.5/24 dev eth0.5

ifconfig eth0.5 down
vconfig rem eth0.5

 

wireshark抓包:
Frame 39: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface s3-eth2, id 0
Ethernet II, Src: 6e:09:21:b9:aa:dd (6e:09:21:b9:aa:dd), Dst: 3a:8f:88:ae:4a:10 (3a:8f:88:ae:4a:10)
IEEE 802.1ad, ID: 100
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 5
Internet Protocol Version 4, Src: 10.0.0.2, Dst: 10.0.0.5
Internet Control Message Protocol

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值