详细内容传送门:官方:http://docs.openvswitch.org/en/latest/tutorials/ovs-conntrack/
知乎:https://zhuanlan.zhihu.com/p/25089778
个人blog:https://zhaozhanxu.com/categories/
CT相关内容。
1. match部分,ct_state,ct_zone,ct_mark,ct_label
2. action部分,
commit,提交一个新的connection给connection tracker模块
table,fork一份pipeline,报文copy一份送给connection tracker,然后从当前指定table重入
zone,制定connection zone,具体作用未知
exec,执行action,setfield ct_mark和ct_label。要和commit一起使用。
Currently, connection tracking is only available on Linux kernels with the nf_conntrackmodule loaded.
ovs说明的例子
The following flows provide an example of how toimplement a simple firewall that allows new connections from port 1 to port 2, and onlyallows established connections to send traffic from port 2 to port 1:
table=0,priority=1,action=drop 低优先级丢弃
table=0,priority=10,arp,action=normal arp放行
table=0,priority=100,ip,ct_state=-trk,action=ct(table=1) 没有被追踪过的报文,进入connection tracker然后进入table 1
table=1,in_port=1,ip,ct_state=+trk+new,action=ct(commit),2 被追踪过且新的,1口的报文,进行commit操作,同时从2发出
table=1,in_port=1,ip,ct_state=+trk+est,action=2 被追踪过,已经建立的connection,直接从2发出
table=1,in_port=2,ip,ct_state=+trk+new,action=drop 被追踪过,2口进的,是新connection,丢弃
table=1,in_port=2,ip,ct_state=+trk+est,action=1 被追踪过,2口进,已经建立的connection,从1出