diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2019-06-13 19:47:59 +0200 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-07-05 14:37:50 -0700 |
commit | f26196e316f22fe8fddf9e798d98e835b22e9be3 (patch) | |
tree | e87a731dd8a36923f794debc9ef3fa26f07ebb06 /ovn | |
parent | 2c3d147dd47e7f19dc5337099d631da264dc8538 (diff) | |
download | openvswitch-f26196e316f22fe8fddf9e798d98e835b22e9be3.tar.gz |
OVN: do not distribute traffic for local FIP
Do not send traffic for local FIP through the overlay tunnels but
manage it in the local hypervisor
Acked-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/northd/ovn-northd.8.xml | 7 | ||||
-rw-r--r-- | ovn/northd/ovn-northd.c | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml index e6417220f..193aa210f 100644 --- a/ovn/northd/ovn-northd.8.xml +++ b/ovn/northd/ovn-northd.8.xml @@ -1890,6 +1890,13 @@ reg1 = <var>EIP1</var>; outport = <code>redirect-chassis-port</code>; <code>REGBIT_DISTRIBUTED_NAT = 1; next;</code>. </pre> + + <p> + Morover a priority-400 logical flow is configured for each + <code>dnat_and_snat</code> NAT rule configured in order to + not send traffic for local FIP through the overlay tunnels + but manage it in the local hypervisor + </p> </li> <li> diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index e8cbc3534..ba2719321 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -5277,6 +5277,19 @@ add_distributed_nat_routes(struct hmap *lflows, const struct ovn_port *op) continue; } + ds_put_format(&match, "inport == %s && " + "ip4.src == %s && ip4.dst == %s", + op->json_key, nat->logical_ip, nat->external_ip); + ds_put_format(&actions, "outport = %s; eth.dst = %s; " + REGBIT_DISTRIBUTED_NAT" = 1; " + REGBIT_NAT_REDIRECT" = 0; next;", + op->od->l3dgw_port->json_key, + nat->external_mac); + ovn_lflow_add(lflows, op->od, S_ROUTER_IN_IP_ROUTING, 400, + ds_cstr(&match), ds_cstr(&actions)); + ds_clear(&match); + ds_clear(&actions); + for (size_t j = 0; j < op->od->nbr->n_nat; j++) { const struct nbrec_nat *nat2 = op->od->nbr->nat[j]; |