Last active
September 22, 2015 22:06
-
-
Save joestringer/ffc6154c548ba0578643 to your computer and use it in GitHub Desktop.
Autotest flows for basic multi-stage pipeline using conntrack zones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dnl Allow traffic from local stack to ns0. Only allow neighbour discovery, | |
dnl return traffic from ns0 back to the local stack. | |
AT_DATA([flows.txt], [dnl | |
dnl default | |
table=0,priority=1,action=drop | |
table=0,priority=10,arp,action=normal | |
dnl Load the output port to REG0 | |
table=0,priority=100,ip,in_port=LOCAL,action=load:1->NXM_NX_REG0[[0..15]],goto_table:1 | |
table=0,priority=100,ip,in_port=1,action=load:65534->NXM_NX_REG0[[0..15]],goto_table:1 | |
dnl Ingress pipeline | |
dnl - Allow all connections from LOCAL port (commit and proceed to egress) | |
dnl - All other connections go through conntracker using the input port as | |
dnl a connection tracking zone. | |
table=1,priority=150,in_port=LOCAL,ip,ct_state=+trk+new,action=ct(commit,zone=OXM_OF_IN_PORT[[0..15]]),goto_table:2 | |
table=1,priority=100,ip,action=ct(table=2,zone=OXM_OF_IN_PORT[[0..15]]) | |
table=1,priority=1,action=drop | |
dnl Egress pipeline | |
dnl - Allow all connections from LOCAL port (commit and skip to output) | |
dnl - Allow other established connections to go through conntracker using | |
dnl output port as a connection tracking zone. | |
table=2,priority=150,in_port=LOCAL,ip,ct_state=+trk+new,action=ct(commit,zone=NXM_NX_REG0[[0..15]]),goto_table:4 | |
table=2,priority=100,ip,ct_state=+trk+est,action=ct(table=3,zone=NXM_NX_REG0[[0..15]]) | |
table=2,priority=1,action=drop | |
dnl Only allow established traffic from egress ct lookup | |
table=3,priority=100,ip,ct_state=+trk+est,action=goto_table:4 | |
table=3,priority=1,action=drop | |
dnl output table | |
table=4,priority=100,ip,action=output:NXM_NX_REG0[[]] | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment