[ovs-dev] How can I add flows to allow traffic go in/out gre port

Jesse Gross jesse at nicira.com
Sun May 13 16:03:42 UTC 2012


On Sat, May 12, 2012 at 1:28 AM, gong ys <gong_ys2004 at yahoo.com.cn> wrote:
> Hi,
>
> Thanks for the answers. I confirm that the "ovs-ofctl --strict del-flows br-tun priority=1" works.
>
> Here I have another question about gre port traffic:
>
> I have two machines with two bridges on each host. They are connected by one Ethernet core directly:
>
> br-int ---- br-tun   <----------------------> br-tun ------br-int
>
> HostA:
> [root at robinlinux ~]# ovs-vsctl show
>     Bridge br-tun
>         Port patch-int
>             Interface patch-int
>                 type: patch
>                 options: {peer=patch-tun}
>         Port br-tun
>             Interface br-tun
>                 type: internal
>         Port "gre-0"
>             Interface "gre-0"
>                 type: gre
>                 options: {remote_ip="192.168.1.90"}
>     Bridge br-int
>         Port br-int
>             tag: 1
>             Interface br-int
>                 type: internal
>         Port patch-tun
>             Interface patch-tun
>                 type: patch
>                 options: {peer=patch-int}
>
>
> I set br-int to have ip 8.8.8.1/24
>
> HostB:
> Bridge br-tun
>         Port patch-int
>             Interface patch-int
>                 type: patch
>                 options: {peer=patch-tun}
>         Port br-tun
>             Interface br-tun
>                 type: internal
>         Port "gre-0"
>             Interface "gre-0"
>                 type: gre
>                 options: {remote_ip="192.168.1.91"}
>     Bridge br-int
>         Port br-int
>             tag: 1
>             Interface br-int
>                 type: internal
>         Port patch-tun
>             Interface patch-tun
>                 type: patch
>                 options: {peer=patch-int}
>
>
> I set br-int to have ip 8.8.8.2/24
>
> Flows on hosta, (hostb has the same):
>
> [root at robinlinux ~]# ovs-ofctl dump-flows br-int
> NXST_FLOW reply (xid=0x4):
>  cookie=0x0, duration=2029.793s, table=0, n_packets=184, n_bytes=38048, priority=1 actions=NORMAL
>
>
> [root at robinlinux ~]# ovs-ofctl dump-flows br-tun
> NXST_FLOW reply (xid=0x4):
>  cookie=0x0, duration=2067.207s, table=0, n_packets=0, n_bytes=0, priority=3,tun_id=0x1 actions=mod_vlan_vid:1,output:1
>  cookie=0x0, duration=2067.23s, table=0, n_packets=48, n_bytes=11448, priority=4,in_port=1,dl_vlan=1 actions=set_tunnel:0x1,NORMAL
>  cookie=0x0, duration=446.121s, table=0, n_packets=8, n_bytes=592, priority=1 actions=drop
>
> [root at robinlinux ~]# ovs-ofctl show br-tun
> OFPT_FEATURES_REPLY (xid=0x1): ver:0x1, dpid:000082d76143ef41
> n_tables:255, n_buffers:256
> features: capabilities:0xc7, actions:0xfff
>  1(patch-int): addr:5a:a4:82:bd:a5:21
>      config:     0
>      state:      0
>  4(gre-0): addr:7a:1b:ac:9b:d7:08
>      config:     0
>      state:      0
>  LOCAL(br-tun): addr:82:d7:61:43:ef:41
>      config:     PORT_DOWN
>      state:      LINK_DOWN
> OFPT_GET_CONFIG_REPLY (xid=0x3): frags=normal miss_send_len=0
>
>
> How can I add flows to allow traffic go in/out gre port?

It's just like any other port.  If you want to send traffic to it,
write a flow to output to its port number.  If your existing flows
aren't matching, presumably its because the match is wrong, not the
action.


More information about the dev mailing list