|
|
5f9769 |
From 986137dc1d4dc6905a7c5ab5e279856260966e12 Mon Sep 17 00:00:00 2001
|
|
|
5f9769 |
Message-Id: <986137dc1d4dc6905a7c5ab5e279856260966e12.1610458802.git.lorenzo.bianconi@redhat.com>
|
|
|
5f9769 |
In-Reply-To: <f21c1b7a467a691847b5552d4570af706fcc5bb0.1610458802.git.lorenzo.bianconi@redhat.com>
|
|
|
5f9769 |
References: <f21c1b7a467a691847b5552d4570af706fcc5bb0.1610458802.git.lorenzo.bianconi@redhat.com>
|
|
|
5f9769 |
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
|
|
|
5f9769 |
Date: Fri, 8 Jan 2021 17:36:24 +0100
|
|
|
5f9769 |
Subject: [PATCH 16/16] ovn: integrate bfd for static routes.
|
|
|
5f9769 |
|
|
|
5f9769 |
Introduce the bfd reference in logical_router_static_router table
|
|
|
5f9769 |
in order to check if the next-hop is properly running using the BFD
|
|
|
5f9769 |
protocol. The CMS is supposed to populate bfd column with the proper
|
|
|
5f9769 |
reference otherwise the BFD status is set to admin_down.
|
|
|
5f9769 |
Add BFD tests in system-ovn.at.
|
|
|
5f9769 |
|
|
|
5f9769 |
Acked-by: Mark Michelson <mmichels@redhat.com>
|
|
|
5f9769 |
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
|
|
|
5f9769 |
Signed-off-by: Numan Siddique <numans@ovn.org>
|
|
|
5f9769 |
---
|
|
|
5f9769 |
NEWS | 3 +-
|
|
|
5f9769 |
northd/ovn-northd.c | 45 +++++++++++----
|
|
|
5f9769 |
ovn-nb.ovsschema | 6 +-
|
|
|
5f9769 |
ovn-nb.xml | 7 +++
|
|
|
5f9769 |
tests/atlocal.in | 3 +
|
|
|
5f9769 |
tests/ovn-nbctl.at | 8 ++-
|
|
|
5f9769 |
tests/ovn-northd.at | 8 +++
|
|
|
5f9769 |
tests/system-ovn.at | 136 ++++++++++++++++++++++++++++++++++++++++++++
|
|
|
5f9769 |
8 files changed, 203 insertions(+), 13 deletions(-)
|
|
|
5f9769 |
|
|
|
5f9769 |
diff --git a/NEWS b/NEWS
|
|
|
5f9769 |
index 85f63503e..0b4b8f4d3 100644
|
|
|
5f9769 |
--- a/NEWS
|
|
|
5f9769 |
+++ b/NEWS
|
|
|
5f9769 |
@@ -1,7 +1,8 @@
|
|
|
5f9769 |
Post-v20.12.0
|
|
|
5f9769 |
-------------------------
|
|
|
5f9769 |
- Support ECMP multiple nexthops for reroute router policies.
|
|
|
5f9769 |
- - BFD protocol support according to RFC880 [0]. IPv6 is not suported yet.
|
|
|
5f9769 |
+ - BFD protocol support according to RFC880 [0]. Introduce next-hop BFD
|
|
|
5f9769 |
+ availability check for OVN static routes. IPv6 is not suported yet.
|
|
|
5f9769 |
[0] https://tools.ietf.org/html/rfc5880)
|
|
|
5f9769 |
|
|
|
5f9769 |
OVN v20.12.0 - 18 Dec 2020
|
|
|
5f9769 |
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
|
|
|
5f9769 |
index 363bb0895..fa2bd73c3 100644
|
|
|
5f9769 |
--- a/northd/ovn-northd.c
|
|
|
5f9769 |
+++ b/northd/ovn-northd.c
|
|
|
5f9769 |
@@ -7952,7 +7952,8 @@ route_hash(struct parsed_route *route)
|
|
|
5f9769 |
* Otherwise return NULL. */
|
|
|
5f9769 |
static struct parsed_route *
|
|
|
5f9769 |
parsed_routes_add(struct ovs_list *routes,
|
|
|
5f9769 |
- const struct nbrec_logical_router_static_route *route)
|
|
|
5f9769 |
+ const struct nbrec_logical_router_static_route *route,
|
|
|
5f9769 |
+ struct hmap *bfd_connections)
|
|
|
5f9769 |
{
|
|
|
5f9769 |
/* Verify that the next hop is an IP address with an all-ones mask. */
|
|
|
5f9769 |
struct in6_addr nexthop;
|
|
|
5f9769 |
@@ -7993,6 +7994,25 @@ parsed_routes_add(struct ovs_list *routes,
|
|
|
5f9769 |
return NULL;
|
|
|
5f9769 |
}
|
|
|
5f9769 |
|
|
|
5f9769 |
+ const struct nbrec_bfd *nb_bt = route->bfd;
|
|
|
5f9769 |
+ if (nb_bt && !strcmp(nb_bt->dst_ip, route->nexthop)) {
|
|
|
5f9769 |
+ struct bfd_entry *bfd_e;
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ bfd_e = bfd_port_lookup(bfd_connections, nb_bt->logical_port,
|
|
|
5f9769 |
+ nb_bt->dst_ip);
|
|
|
5f9769 |
+ if (bfd_e) {
|
|
|
5f9769 |
+ bfd_e->ref = true;
|
|
|
5f9769 |
+ }
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ if (!strcmp(nb_bt->status, "admin_down")) {
|
|
|
5f9769 |
+ nbrec_bfd_set_status(nb_bt, "down");
|
|
|
5f9769 |
+ }
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ if (!strcmp(nb_bt->status, "down")) {
|
|
|
5f9769 |
+ return NULL;
|
|
|
5f9769 |
+ }
|
|
|
5f9769 |
+ }
|
|
|
5f9769 |
+
|
|
|
5f9769 |
struct parsed_route *pr = xzalloc(sizeof *pr);
|
|
|
5f9769 |
pr->prefix = prefix;
|
|
|
5f9769 |
pr->plen = plen;
|
|
|
5f9769 |
@@ -9579,7 +9599,7 @@ build_ip_routing_flows_for_lrouter_port(
|
|
|
5f9769 |
static void
|
|
|
5f9769 |
build_static_route_flows_for_lrouter(
|
|
|
5f9769 |
struct ovn_datapath *od, struct hmap *lflows,
|
|
|
5f9769 |
- struct hmap *ports)
|
|
|
5f9769 |
+ struct hmap *ports, struct hmap *bfd_connections)
|
|
|
5f9769 |
{
|
|
|
5f9769 |
if (od->nbr) {
|
|
|
5f9769 |
ovn_lflow_add(lflows, od, S_ROUTER_IN_IP_ROUTING_ECMP, 150,
|
|
|
5f9769 |
@@ -9591,7 +9611,8 @@ build_static_route_flows_for_lrouter(
|
|
|
5f9769 |
struct ecmp_groups_node *group;
|
|
|
5f9769 |
for (int i = 0; i < od->nbr->n_static_routes; i++) {
|
|
|
5f9769 |
struct parsed_route *route =
|
|
|
5f9769 |
- parsed_routes_add(&parsed_routes, od->nbr->static_routes[i]);
|
|
|
5f9769 |
+ parsed_routes_add(&parsed_routes, od->nbr->static_routes[i],
|
|
|
5f9769 |
+ bfd_connections);
|
|
|
5f9769 |
if (!route) {
|
|
|
5f9769 |
continue;
|
|
|
5f9769 |
}
|
|
|
5f9769 |
@@ -11571,7 +11592,8 @@ struct lswitch_flow_build_info {
|
|
|
5f9769 |
|
|
|
5f9769 |
static void
|
|
|
5f9769 |
build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od,
|
|
|
5f9769 |
- struct lswitch_flow_build_info *lsi)
|
|
|
5f9769 |
+ struct lswitch_flow_build_info *lsi,
|
|
|
5f9769 |
+ struct hmap *bfd_connections)
|
|
|
5f9769 |
{
|
|
|
5f9769 |
/* Build Logical Switch Flows. */
|
|
|
5f9769 |
build_lswitch_lflows_pre_acl_and_acl(od, lsi->port_groups, lsi->lflows,
|
|
|
5f9769 |
@@ -11591,7 +11613,8 @@ build_lswitch_and_lrouter_iterate_by_od(struct ovn_datapath *od,
|
|
|
5f9769 |
build_neigh_learning_flows_for_lrouter(od, lsi->lflows, &lsi->match,
|
|
|
5f9769 |
&lsi->actions);
|
|
|
5f9769 |
build_ND_RA_flows_for_lrouter(od, lsi->lflows);
|
|
|
5f9769 |
- build_static_route_flows_for_lrouter(od, lsi->lflows, lsi->ports);
|
|
|
5f9769 |
+ build_static_route_flows_for_lrouter(od, lsi->lflows, lsi->ports,
|
|
|
5f9769 |
+ bfd_connections);
|
|
|
5f9769 |
build_mcast_lookup_flows_for_lrouter(od, lsi->lflows, &lsi->match,
|
|
|
5f9769 |
&lsi->actions);
|
|
|
5f9769 |
build_ingress_policy_flows_for_lrouter(od, lsi->lflows, lsi->ports);
|
|
|
5f9769 |
@@ -11655,7 +11678,8 @@ build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
|
|
|
5f9769 |
struct hmap *port_groups, struct hmap *lflows,
|
|
|
5f9769 |
struct hmap *mcgroups,
|
|
|
5f9769 |
struct hmap *igmp_groups,
|
|
|
5f9769 |
- struct shash *meter_groups, struct hmap *lbs)
|
|
|
5f9769 |
+ struct shash *meter_groups, struct hmap *lbs,
|
|
|
5f9769 |
+ struct hmap *bfd_connections)
|
|
|
5f9769 |
{
|
|
|
5f9769 |
struct ovn_datapath *od;
|
|
|
5f9769 |
struct ovn_port *op;
|
|
|
5f9769 |
@@ -11682,7 +11706,7 @@ build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
|
|
|
5f9769 |
* will move here and will be reogranized by iterator type.
|
|
|
5f9769 |
*/
|
|
|
5f9769 |
HMAP_FOR_EACH (od, key_node, datapaths) {
|
|
|
5f9769 |
- build_lswitch_and_lrouter_iterate_by_od(od, &lsi);
|
|
|
5f9769 |
+ build_lswitch_and_lrouter_iterate_by_od(od, &lsi, bfd_connections);
|
|
|
5f9769 |
}
|
|
|
5f9769 |
HMAP_FOR_EACH (op, key_node, ports) {
|
|
|
5f9769 |
build_lswitch_and_lrouter_iterate_by_op(op, &lsi);
|
|
|
5f9769 |
@@ -11780,13 +11804,14 @@ build_lflows(struct northd_context *ctx, struct hmap *datapaths,
|
|
|
5f9769 |
struct hmap *ports, struct hmap *port_groups,
|
|
|
5f9769 |
struct hmap *mcgroups, struct hmap *igmp_groups,
|
|
|
5f9769 |
struct shash *meter_groups,
|
|
|
5f9769 |
- struct hmap *lbs)
|
|
|
5f9769 |
+ struct hmap *lbs, struct hmap *bfd_connections)
|
|
|
5f9769 |
{
|
|
|
5f9769 |
struct hmap lflows = HMAP_INITIALIZER(&lflows);
|
|
|
5f9769 |
|
|
|
5f9769 |
build_lswitch_and_lrouter_flows(datapaths, ports,
|
|
|
5f9769 |
port_groups, &lflows, mcgroups,
|
|
|
5f9769 |
- igmp_groups, meter_groups, lbs);
|
|
|
5f9769 |
+ igmp_groups, meter_groups, lbs,
|
|
|
5f9769 |
+ bfd_connections);
|
|
|
5f9769 |
|
|
|
5f9769 |
/* Collecting all unique datapath groups. */
|
|
|
5f9769 |
struct hmap dp_groups = HMAP_INITIALIZER(&dp_groups);
|
|
|
5f9769 |
@@ -12795,7 +12820,7 @@ ovnnb_db_run(struct northd_context *ctx,
|
|
|
5f9769 |
build_meter_groups(ctx, &meter_groups);
|
|
|
5f9769 |
build_bfd_table(ctx, &bfd_connections, ports);
|
|
|
5f9769 |
build_lflows(ctx, datapaths, ports, &port_groups, &mcast_groups,
|
|
|
5f9769 |
- &igmp_groups, &meter_groups, &lbs;;
|
|
|
5f9769 |
+ &igmp_groups, &meter_groups, &lbs, &bfd_connections);
|
|
|
5f9769 |
ovn_update_ipv6_prefix(ports);
|
|
|
5f9769 |
|
|
|
5f9769 |
sync_address_sets(ctx);
|
|
|
5f9769 |
diff --git a/ovn-nb.ovsschema b/ovn-nb.ovsschema
|
|
|
5f9769 |
index aea932f55..29019809c 100644
|
|
|
5f9769 |
--- a/ovn-nb.ovsschema
|
|
|
5f9769 |
+++ b/ovn-nb.ovsschema
|
|
|
5f9769 |
@@ -1,7 +1,7 @@
|
|
|
5f9769 |
{
|
|
|
5f9769 |
"name": "OVN_Northbound",
|
|
|
5f9769 |
"version": "5.31.0",
|
|
|
5f9769 |
- "cksum": "1511492848 28473",
|
|
|
5f9769 |
+ "cksum": "2352750632 28701",
|
|
|
5f9769 |
"tables": {
|
|
|
5f9769 |
"NB_Global": {
|
|
|
5f9769 |
"columns": {
|
|
|
5f9769 |
@@ -374,6 +374,10 @@
|
|
|
5f9769 |
"min": 0, "max": 1}},
|
|
|
5f9769 |
"nexthop": {"type": "string"},
|
|
|
5f9769 |
"output_port": {"type": {"key": "string", "min": 0, "max": 1}},
|
|
|
5f9769 |
+ "bfd": {"type": {"key": {"type": "uuid", "refTable": "BFD",
|
|
|
5f9769 |
+ "refType": "weak"},
|
|
|
5f9769 |
+ "min": 0,
|
|
|
5f9769 |
+ "max": 1}},
|
|
|
5f9769 |
"options": {
|
|
|
5f9769 |
"type": {"key": "string", "value": "string",
|
|
|
5f9769 |
"min": 0, "max": "unlimited"}},
|
|
|
5f9769 |
diff --git a/ovn-nb.xml b/ovn-nb.xml
|
|
|
5f9769 |
index cdc5e0f3a..105d8697e 100644
|
|
|
5f9769 |
--- a/ovn-nb.xml
|
|
|
5f9769 |
+++ b/ovn-nb.xml
|
|
|
5f9769 |
@@ -2644,6 +2644,13 @@
|
|
|
5f9769 |
|
|
|
5f9769 |
</column>
|
|
|
5f9769 |
|
|
|
5f9769 |
+ <column name="bfd">
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ Reference to <ref table="BFD"/> row if the route has associated a
|
|
|
5f9769 |
+ BFD session
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ </column>
|
|
|
5f9769 |
+
|
|
|
5f9769 |
<column name="external_ids" key="ic-learned-route">
|
|
|
5f9769 |
ovn-ic populates this key if the route is learned from the
|
|
|
5f9769 |
global <ref db="OVN_IC_Southbound"/> database. In this case the value
|
|
|
5f9769 |
diff --git a/tests/atlocal.in b/tests/atlocal.in
|
|
|
5f9769 |
index d9a4c91d4..5ebc8e117 100644
|
|
|
5f9769 |
--- a/tests/atlocal.in
|
|
|
5f9769 |
+++ b/tests/atlocal.in
|
|
|
5f9769 |
@@ -181,6 +181,9 @@ fi
|
|
|
5f9769 |
# Set HAVE_DIBBLER-SERVER
|
|
|
5f9769 |
find_command dibbler-server
|
|
|
5f9769 |
|
|
|
5f9769 |
+# Set HAVE_BFDD_BEACON
|
|
|
5f9769 |
+find_command bfdd-beacon
|
|
|
5f9769 |
+
|
|
|
5f9769 |
# Turn off proxies.
|
|
|
5f9769 |
unset http_proxy
|
|
|
5f9769 |
unset https_proxy
|
|
|
5f9769 |
diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
|
|
|
5f9769 |
index 01edfcbc1..2827b223c 100644
|
|
|
5f9769 |
--- a/tests/ovn-nbctl.at
|
|
|
5f9769 |
+++ b/tests/ovn-nbctl.at
|
|
|
5f9769 |
@@ -1617,7 +1617,13 @@ IPv6 Routes
|
|
|
5f9769 |
2001:db8::/64 2001:db8:0:f102::1 dst-ip lp0
|
|
|
5f9769 |
2001:db8:1::/64 2001:db8:0:f103::1 dst-ip
|
|
|
5f9769 |
::/0 2001:db8:0:f101::1 dst-ip
|
|
|
5f9769 |
-])])
|
|
|
5f9769 |
+])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+AT_CHECK([ovn-nbctl lrp-add lr0 lr0-p0 00:00:01:01:02:03 192.168.10.1/24])
|
|
|
5f9769 |
+bfd_uuid=$(ovn-nbctl create bfd logical_port=lr0-p0 dst_ip=100.0.0.50 status=down min_tx=250 min_rx=250 detect_mult=10)
|
|
|
5f9769 |
+AT_CHECK([ovn-nbctl lr-route-add lr0 100.0.0.0/24 192.168.0.1])
|
|
|
5f9769 |
+route_uuid=$(fetch_column nb:logical_router_static_route _uuid ip_prefix="100.0.0.0/24")
|
|
|
5f9769 |
+AT_CHECK([ovn-nbctl set logical_router_static_route $route_uuid bfd=$bfd_uuid])])
|
|
|
5f9769 |
|
|
|
5f9769 |
dnl ---------------------------------------------------------------------
|
|
|
5f9769 |
|
|
|
5f9769 |
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
|
|
|
5f9769 |
index eee004328..91eb9a3d1 100644
|
|
|
5f9769 |
--- a/tests/ovn-northd.at
|
|
|
5f9769 |
+++ b/tests/ovn-northd.at
|
|
|
5f9769 |
@@ -2373,6 +2373,14 @@ check_column 1000 bfd min_tx logical_port=r0-sw1
|
|
|
5f9769 |
check_column 1000 bfd min_rx logical_port=r0-sw1
|
|
|
5f9769 |
check_column 100 bfd detect_mult logical_port=r0-sw1
|
|
|
5f9769 |
|
|
|
5f9769 |
+check ovn-nbctl lr-route-add r0 100.0.0.0/8 192.168.10.2
|
|
|
5f9769 |
+route_uuid=$(fetch_column nb:logical_router_static_route _uuid ip_prefix="100.0.0.0/8")
|
|
|
5f9769 |
+check ovn-nbctl set logical_router_static_route $route_uuid bfd=$uuid
|
|
|
5f9769 |
+check_column down bfd status logical_port=r0-sw1
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+check ovn-nbctl clear logical_router_static_route $route_uuid bfd
|
|
|
5f9769 |
+check_column admin_down bfd status logical_port=r0-sw1
|
|
|
5f9769 |
+
|
|
|
5f9769 |
ovn-nbctl destroy bfd $uuid
|
|
|
5f9769 |
check_row_count bfd 2
|
|
|
5f9769 |
|
|
|
5f9769 |
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
|
|
|
5f9769 |
index 1e73001ab..06d606166 100644
|
|
|
5f9769 |
--- a/tests/system-ovn.at
|
|
|
5f9769 |
+++ b/tests/system-ovn.at
|
|
|
5f9769 |
@@ -5531,3 +5531,139 @@ as
|
|
|
5f9769 |
OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
|
|
|
5f9769 |
/.*terminating with signal 15.*/d"])
|
|
|
5f9769 |
AT_CLEANUP
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+AT_SETUP([ovn -- BFD])
|
|
|
5f9769 |
+AT_SKIP_IF([test $HAVE_BFDD_BEACON = no])
|
|
|
5f9769 |
+AT_SKIP_IF([test $HAVE_TCPDUMP = no])
|
|
|
5f9769 |
+AT_KEYWORDS([ovn-bfd])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ovn_start
|
|
|
5f9769 |
+OVS_TRAFFIC_VSWITCHD_START()
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ADD_BR([br-int])
|
|
|
5f9769 |
+ADD_BR([br-ext])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+check ovs-ofctl add-flow br-ext action=normal
|
|
|
5f9769 |
+# Set external-ids in br-int needed for ovn-controller
|
|
|
5f9769 |
+check ovs-vsctl \
|
|
|
5f9769 |
+ -- set Open_vSwitch . external-ids:system-id=hv1 \
|
|
|
5f9769 |
+ -- set Open_vSwitch . external-ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb.sock \
|
|
|
5f9769 |
+ -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \
|
|
|
5f9769 |
+ -- set Open_vSwitch . external-ids:ovn-encap-ip=169.0.0.1 \
|
|
|
5f9769 |
+ -- set bridge br-int fail-mode=secure other-config:disable-in-band=true
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+# Start ovn-controller
|
|
|
5f9769 |
+start_daemon ovn-controller
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+check ovn-nbctl lr-add R1
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+check ovn-nbctl ls-add sw0
|
|
|
5f9769 |
+check ovn-nbctl ls-add sw1
|
|
|
5f9769 |
+check ovn-nbctl ls-add public
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+check ovn-nbctl lrp-add R1 rp-sw0 00:00:01:01:02:03 192.168.1.1/24
|
|
|
5f9769 |
+check ovn-nbctl lrp-add R1 rp-sw1 00:00:03:01:02:03 192.168.2.1/24
|
|
|
5f9769 |
+check ovn-nbctl lrp-add R1 rp-public 00:00:02:01:02:03 172.16.1.1/24 \
|
|
|
5f9769 |
+ -- lrp-set-gateway-chassis rp-public hv1
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+check ovn-nbctl lsp-add sw0 sw0-rp -- set Logical_Switch_Port sw0-rp \
|
|
|
5f9769 |
+ type=router options:router-port=rp-sw0 \
|
|
|
5f9769 |
+ -- lsp-set-addresses sw0-rp router
|
|
|
5f9769 |
+check ovn-nbctl lsp-add sw1 sw1-rp -- set Logical_Switch_Port sw1-rp \
|
|
|
5f9769 |
+ type=router options:router-port=rp-sw1 \
|
|
|
5f9769 |
+ -- lsp-set-addresses sw1-rp router
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+check ovn-nbctl lsp-add public public-rp -- set Logical_Switch_Port public-rp \
|
|
|
5f9769 |
+ type=router options:router-port=rp-public \
|
|
|
5f9769 |
+ -- lsp-set-addresses public-rp router
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ADD_NAMESPACES(sw01)
|
|
|
5f9769 |
+ADD_VETH(sw01, sw01, br-int, "192.168.1.2/24", "f0:00:00:01:02:03", \
|
|
|
5f9769 |
+ "192.168.1.1")
|
|
|
5f9769 |
+check ovn-nbctl lsp-add sw0 sw01 \
|
|
|
5f9769 |
+ -- lsp-set-addresses sw01 "f0:00:00:01:02:03 192.168.1.2"
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ADD_NAMESPACES(sw11)
|
|
|
5f9769 |
+ADD_VETH(sw11, sw11, br-int, "192.168.2.2/24", "f0:00:00:02:02:03", \
|
|
|
5f9769 |
+ "192.168.2.1")
|
|
|
5f9769 |
+check ovn-nbctl lsp-add sw1 sw11 \
|
|
|
5f9769 |
+ -- lsp-set-addresses sw11 "f0:00:00:02:02:03 192.168.2.2"
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+ADD_NAMESPACES(server)
|
|
|
5f9769 |
+NS_CHECK_EXEC([server], [ip link set dev lo up])
|
|
|
5f9769 |
+ADD_VETH(s1, server, br-ext, "172.16.1.50/24", "f0:00:00:01:02:05", \
|
|
|
5f9769 |
+ "172.16.1.1")
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+AT_CHECK([ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=phynet:br-ext])
|
|
|
5f9769 |
+check ovn-nbctl lsp-add public public1 \
|
|
|
5f9769 |
+ -- lsp-set-addresses public1 unknown \
|
|
|
5f9769 |
+ -- lsp-set-type public1 localnet \
|
|
|
5f9769 |
+ -- lsp-set-options public1 network_name=phynet
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+NS_CHECK_EXEC([server], [bfdd-beacon --listen=172.16.1.50], [0])
|
|
|
5f9769 |
+NS_CHECK_EXEC([server], [bfdd-control allow 172.16.1.1], [0], [dnl
|
|
|
5f9769 |
+Allowing connections from 172.16.1.1
|
|
|
5f9769 |
+])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+uuid=$(ovn-nbctl create bfd logical_port=rp-public dst_ip=172.16.1.50 min_tx=250 min_rx=250 detect_mult=10)
|
|
|
5f9769 |
+check ovn-nbctl lr-route-add R1 100.0.0.0/8 172.16.1.50
|
|
|
5f9769 |
+route_uuid=$(fetch_column nb:logical_router_static_route _uuid ip_prefix="100.0.0.0/8")
|
|
|
5f9769 |
+check ovn-nbctl set logical_router_static_route $route_uuid bfd=$uuid
|
|
|
5f9769 |
+check ovn-nbctl --wait=hv sync
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+wait_column "up" nb:bfd status logical_port=rp-public
|
|
|
5f9769 |
+OVS_WAIT_UNTIL([ovn-sbctl dump-flows R1 | grep 'match=(ip4.dst == 100.0.0.0/8)' | grep -q 172.16.1.50])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+# un-associate the bfd connection and the static route
|
|
|
5f9769 |
+check ovn-nbctl clear logical_router_static_route $route_uuid bfd
|
|
|
5f9769 |
+wait_column "admin_down" nb:bfd status logical_port=rp-public
|
|
|
5f9769 |
+OVS_WAIT_UNTIL([ip netns exec server bfdd-control status | grep -qi state=Down])
|
|
|
5f9769 |
+NS_CHECK_EXEC([server], [tcpdump -nni s1 udp port 3784 -Q in > bfd.pcap &])
|
|
|
5f9769 |
+sleep 5
|
|
|
5f9769 |
+kill $(pidof tcpdump)
|
|
|
5f9769 |
+AT_CHECK([grep -qi bfd bfd.pcap],[1])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+# restart the connection
|
|
|
5f9769 |
+check ovn-nbctl set logical_router_static_route $route_uuid bfd=$uuid
|
|
|
5f9769 |
+wait_column "up" nb:bfd status logical_port=rp-public
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+# switch to gw router configuration
|
|
|
5f9769 |
+check ovn-nbctl clear logical_router_static_route $route_uuid bfd
|
|
|
5f9769 |
+wait_column "admin_down" nb:bfd status logical_port=rp-public
|
|
|
5f9769 |
+OVS_WAIT_UNTIL([ip netns exec server bfdd-control status | grep -qi state=Down])
|
|
|
5f9769 |
+check ovn-nbctl clear logical_router_port rp-public gateway_chassis
|
|
|
5f9769 |
+check ovn-nbctl set logical_router R1 options:chassis=hv1
|
|
|
5f9769 |
+check ovn-nbctl set logical_router_static_route $route_uuid bfd=$uuid
|
|
|
5f9769 |
+wait_column "up" nb:bfd status logical_port=rp-public
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+# stop bfd endpoint
|
|
|
5f9769 |
+NS_CHECK_EXEC([server], [bfdd-control stop], [0], [dnl
|
|
|
5f9769 |
+stopping
|
|
|
5f9769 |
+])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+wait_column "down" nb:bfd status logical_port=rp-public
|
|
|
5f9769 |
+OVS_WAIT_UNTIL([test "$(ovn-sbctl dump-flows R1 | grep 'match=(ip4.dst == 100.0.0.0/8)' | grep 172.16.1.50)" = ""])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+# remove bfd entry
|
|
|
5f9769 |
+ovn-nbctl destroy bfd $uuid
|
|
|
5f9769 |
+check_row_count bfd 0
|
|
|
5f9769 |
+NS_CHECK_EXEC([server], [tcpdump -nni s1 udp port 3784 -Q in > bfd.pcap &])
|
|
|
5f9769 |
+sleep 5
|
|
|
5f9769 |
+kill $(pidof tcpdump)
|
|
|
5f9769 |
+AT_CHECK([grep -qi bfd bfd.pcap],[1])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+kill $(pidof ovn-controller)
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+as ovn-sb
|
|
|
5f9769 |
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+as ovn-nb
|
|
|
5f9769 |
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+as northd
|
|
|
5f9769 |
+OVS_APP_EXIT_AND_WAIT([ovn-northd])
|
|
|
5f9769 |
+
|
|
|
5f9769 |
+as
|
|
|
5f9769 |
+OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d
|
|
|
5f9769 |
+/.*terminating with signal 15.*/d"])
|
|
|
5f9769 |
+AT_CLEANUP
|
|
|
5f9769 |
--
|
|
|
5f9769 |
2.29.2
|
|
|
5f9769 |
|