Hi Bilal, I think you might be looking for "tun_id" field matching. It is described in http://www.openvswitch.org/support/dist-docs/ovs-fields.7.txt Tunnel ID Field Name: tun_id (aka tunnel_id)
William gave a sound advice. However, consider the following. A controller creates rules for you. Thus, a tunnel OF port ID might be dynamic. The "in_port" might not help. The "tun_id" matching is good enough. As it says in the docs for the "tun_id" field: "Prerequisites: none". This means you can match on it without having input port. Regards, Paul From: ovs-discuss-boun...@openvswitch.org <ovs-discuss-boun...@openvswitch.org> on behalf of William Tu <u9012...@gmail.com> Sent: Monday, May 28, 2018 9:25 PM To: Bilal Saleem Cc: ovs-discuss@openvswitch.org Subject: Re: [ovs-discuss] GRE key rules On Mon, May 28, 2018 at 1:33 PM, Bilal Saleem <mb...@nyu.edu> wrote: > Hi, > > I am working on simple topology as follows: > C > / | \ > Veth ports-----S1 -- S2 -- S3 ---- H1 > \ / > S4 > I am sending raw packets cooked with GRE headers on Veth ports. I want to > create rules based on GRE key value like this: > match2 = parser.OFPMatch(in_port=2, eth_dst=dst, eth_type=0x0800, > ip_proto=47, grekey=XXXXX) > S1 will decide where to send the packet based on gre key information. > I'm not familiar with ryu controller, but OVS supports GRE key options, you can set it using ovs-vsctl, for example: ovs-vsctl add-port br0 gre123 -- set Interface gre123 type=gre \ options:remote_ip=1.1.2.92 options:key=456 ofport_request=3 for creating an OpenFlow rule matching gre key, see Tunnel ID field in man ovs-fields(7) for example: ovs-ofctl add-flow br0 "in_port=2,tunnel_id=456, actions=1" Regards, William _______________________________________________ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss discuss Info Page - Open vSwitch mail.openvswitch.org To see the collection of prior postings to the list, visit the discuss Archives.. Using discuss: To post a message to all the list members, send email to ovs-discuss@openvswitch.org. _______________________________________________ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss