[ovs-discuss] packet_type=legacy_l3 gre tunnel does not work
Yousong Zhou
yszhou4tech at gmail.com
Wed Oct 17 13:01:46 UTC 2018
I tried to use ip-over-gre with openvswitch 2.8.4, but no "ip proto
47" traffic can be seen with tcpdump. Later I added a WARN_ON_ONCE(1)
line just before the "goto drop" statement in ovs_vport_send() and it
was triggered right away thus pinpointed the problem.
It looks to me openvswitch linux kernel datapath always create
ARPHRD_IPGRE device and never set dev->type to ARPHRD_NONE. Please
correct me if this is not the case. The ovs-vswitchd.conf.db doc says
setting packet_type=legacy_l3 should work. I am trying to figure
what's the missing piece.
--- vport.c.orig 2018-10-17 12:51:22.484824861 +0000
+++ vport.c 2018-10-17 12:51:24.873798775 +0000
@@ -541,8 +541,10 @@ void ovs_vport_send(struct vport *vport,
}
break;
case ARPHRD_ETHER:
- if (mac_proto != MAC_PROTO_ETHERNET)
+ if (mac_proto != MAC_PROTO_ETHERNET) {
+ WARN_ON_ONCE(1);
goto drop;
+ }
break;
default:
goto drop;
Below is a short snippet of how I added the port and flow in case it may help.
ovs-vsctl add-port br0 tun0 -- set interface tun0 type=gre
options:remote_ip=flow options:key=flow options:packet_type=legacy_l2
ofport_request=2
ovs-ofctl add-flow br0
'priority=100,in_port=veth1cus,ip,nw_dst=10.8.1.0/24,actions=set_tunnel:128,set_field:10.0.2.196->tun_dst,output:tun0'
[root at h0g0 ~]# ovs-dpctl show
system at ovs-system:
lookups: hit:19553 missed:3 lost:1
flows: 1
masks: hit:19555 total:1 hit/pkt:1.00
port 0: ovs-system (internal)
port 1: gre_sys (gre: packet_type=ptap)
port 2: br0 (internal)
port 3: veth1cus
[root at h0g0 ~]# ovs-dpctl dump-flows
recirc_id(0),in_port(3),eth(),eth_type(0x0800),ipv4(dst=10.8.1.0/255.255.255.0,tos=0/0x3,frag=no),
packets:19569, bytes:1917762, used:0.043s,
actions:set(tunnel(tun_id=0x80,dst=10.0.2.196,ttl=64,flags(df|key))),pop_eth,1
Regards,
yousong
More information about the discuss
mailing list