-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
northd: Add option to enable conntrack for the LSP whose peer is l3dgw_port #226
Conversation
ef238fd
to
7651944
Compare
It looks the CI environment has problems @dceara |
This is the error the CI is hitting: https://github.com/ovn-org/ovn/actions/runs/7017869125/job/19092070388?pr=226#step:8:2991 That's because of your change here: That's an invalid xml there. I suspect that once that's fixed the builds will succeed too. Regards, |
e508224
to
474bdfa
Compare
@dceara hi, I do not know why Cirrus CI failed. Could you give me any suggestions?
|
474bdfa
to
2d1f05e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shylou, thanks for the PR, the approach looks OK overall, I did leave some comments though.
On the functionality itself, @numansiddique had added the code to skip router ports from conntrack to avoid extra recirculations with the idea that firewall rules are normally applied on VIF ports only.
When your option is configured we now support a different type of behavior. That's fine, i think, but I wanted to double check with Numan to see what he thinks too.
Its fine with me too to add this option. Thanks |
@numansiddique thanks for your review! |
eac2f44
to
518ec54
Compare
@dceara @numansiddique hi,please review this new patch. |
@shylou This needs a very small rebase (minor conflict in the NEWS file). Also, please address @numansiddique's comment about changing the option name from "enable_conntrack" to something else; maybe we can call it |
@dceara OK! I will upgrade it as soon as possible. |
5c61d2f
to
674f396
Compare
993db39
to
4abd3a3
Compare
@dceara @numansiddique please feel free to review the new patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks OK to me, I left a few more minor comments. I'll wait for @numansiddique to comment too.
By default, OVN skips the conntrack process for router type LSP within a LS. It seems unnecessary for the LSP whose peer is l3dgw_port. Therefore, we introduce an option named 'enable_router_port_acl', which defaults to false and can be set to true to enable conntrack for the LSP whose peer is l3dgw_port. And then we can implement a gateway stateful firewall by dgw with stateful ACL. For example: prelude: R1-S1 is a l3dgw_port ovn-nbctl pg-add pg_dgw ovn-nbctl pg-set-ports pg_dgw S1-R1 ovn-nbctl acl-add pg_dgw from-lport 1002 "inport == @pg_dgw && ip4" allow-related ovn-nbctl acl-add pg_dgw to-lport 1003 "outport == @pg_dgw && ip4" allow-related ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1 enable_router_port_acl=true NOTE: this option only works for the LSP whose peer is l3dgw_port. Signed-off-by: Xie Liu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test it but this looks OK to me.
In case this goes in:
|
@@ -2843,6 +2860,13 @@ join_logical_ports(const struct sbrec_port_binding_table *sbrec_pb_table, | |||
"port %s is a switch port", op->key); | |||
} | |||
} | |||
} else if (op->nbsp && !lsp_is_router(op->nbsp)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. I don't think we can just ignore and remove this "else if".
@dceara Wdyt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@numansiddique I guess you meant "I think we can just ignore and remove.." right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I meant the same. Sorry for the typo
By default, OVN skips the conntrack process for router type LSP within a LS. It seems unnecessary for the LSP whose peer is l3dgw_port. Therefore, we introduce an option named 'enable_router_port_acl', which defaults to false and can be set to true to enable conntrack for the LSP whose peer is l3dgw_port. And then we can implement a gateway stateful firewall by dgw with stateful ACL. For example: prelude: R1-S1 is a l3dgw_port ovn-nbctl pg-add pg_dgw ovn-nbctl pg-set-ports pg_dgw S1-R1 ovn-nbctl acl-add pg_dgw from-lport 1002 "inport == @pg_dgw && ip4" allow-related ovn-nbctl acl-add pg_dgw to-lport 1003 "outport == @pg_dgw && ip4" allow-related ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1 enable_router_port_acl=true NOTE: this option only works for the LSP whose peer is l3dgw_port. Submitted-at: ovn-org#226 Signed-off-by: Xie Liu <[email protected]> Acked-by: Dumitru Ceara <[email protected]> Signed-off-by: Numan Siddique <[email protected]>
By default, OVN skips the conntrack process for router type LSP within a LS. It seems unnecessary for the LSP whose peer is l3dgw_port. Therefore, we introduce an option named 'enable_router_port_acl', which defaults to false and can be set to true to enable conntrack for the LSP whose peer is l3dgw_port. And then we can implement a gateway stateful firewall by dgw with stateful ACL. For example: prelude: R1-S1 is a l3dgw_port ovn-nbctl pg-add pg_dgw ovn-nbctl pg-set-ports pg_dgw S1-R1 ovn-nbctl acl-add pg_dgw from-lport 1002 "inport == @pg_dgw && ip4" allow-related ovn-nbctl acl-add pg_dgw to-lport 1003 "outport == @pg_dgw && ip4" allow-related ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1 enable_router_port_acl=true NOTE: this option only works for the LSP whose peer is l3dgw_port. Submitted-at: ovn-org#226 Signed-off-by: Xie Liu <[email protected]> Acked-by: Dumitru Ceara <[email protected]> Signed-off-by: Numan Siddique <[email protected]>
Submitted the patch with the below changes to the ovs-dev mailing list. Once the CI passes I'll apply this patch. https://patchwork.ozlabs.org/project/ovn/patch/[email protected]/
|
By default, OVN skips the conntrack process for router type LSP within a LS. It seems unnecessary for the LSP whose peer is l3dgw_port. Therefore, we introduce an option named 'enable_router_port_acl', which defaults to false and can be set to true to enable conntrack for the LSP whose peer is l3dgw_port. And then we can implement a gateway stateful firewall by dgw with stateful ACL. For example: prelude: R1-S1 is a l3dgw_port ovn-nbctl pg-add pg_dgw ovn-nbctl pg-set-ports pg_dgw S1-R1 ovn-nbctl acl-add pg_dgw from-lport 1002 "inport == @pg_dgw && ip4" allow-related ovn-nbctl acl-add pg_dgw to-lport 1003 "outport == @pg_dgw && ip4" allow-related ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1 enable_router_port_acl=true NOTE: this option only works for the LSP whose peer is l3dgw_port. Submitted-at: ovn-org#226 Signed-off-by: Xie Liu <[email protected]> Acked-by: Dumitru Ceara <[email protected]> Signed-off-by: Numan Siddique <[email protected]> Signed-off-by: 0-day Robot <[email protected]>
Patch applied - 9a0f307 Closing the PR |
By default, OVN skips the conntrack process for router type LSP within a LS. It seems unnecessary for the LSP whose peer is l3dgw_port. Therefore, we introduce a new option named 'enable_conntrack', which defaults to false and can be set true to enable conntrack for the LSP whose peer is l3dgw_port.
And then we can implement l3 gateway stateful firewall, for example:
prelude: R1-S1 is a l3dgw_port
ovn-nbctl pg-add pg_dgw
ovn-nbctl pg-set-ports pg_dgw S1-R1
ovn-nbctl acl-add pg_dgw from-lport 1002 "inport == @pg_dgw && ip4" allow-related
ovn-nbctl acl-add pg_dgw to-lport 1003 "outport == @pg_dgw && ip4" allow-related
ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1 enable_conntrack=true
NOTE: this option only works for the LSP whose peer is l3dgw_port.
#225