struct ovs_list list; /* In list of similar records. */
- /* Logical router data (digested from nbr). */
- const struct ovn_port *gateway_port;
- ovs_be32 gateway;
-
/* Logical switch data. */
struct ovn_port **router_ports;
size_t n_router_ports;
NULL, nbr, NULL);
ovs_list_push_back(nb_only, &od->list);
}
-
- od->gateway = 0;
- if (nbr->default_gw) {
- ovs_be32 ip;
- if (!ip_parse(nbr->default_gw, &ip) || !ip) {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
- VLOG_WARN_RL(&rl, "bad 'gateway' %s", nbr->default_gw);
- } else {
- od->gateway = ip;
- }
- }
-
- /* Set the gateway port to NULL. If there is a gateway, it will get
- * filled in as we go through the ports later. */
- od->gateway_port = NULL;
}
}
op->mac = mac;
op->od = od;
-
- /* If 'od' has a gateway and 'op' routes to it... */
- if (od->gateway && !((op->network ^ od->gateway) & op->mask)) {
- /* ...and if 'op' is a longer match than the current
- * choice... */
- const struct ovn_port *gw = od->gateway_port;
- int len = gw ? ip_count_cidr_bits(gw->mask) : 0;
- if (ip_count_cidr_bits(op->mask) > len) {
- /* ...then it's the default gateway port. */
- od->gateway_port = op;
- }
- }
}
}
}
route = od->nbr->static_routes[i];
build_static_route_flow(lflows, od, ports, route);
}
-
- if (od->gateway && od->gateway_port) {
- add_route(lflows, od->gateway_port, 0, 0, od->gateway);
- }
}
/* XXX destination unreachable */
{
"name": "OVN_Northbound",
- "version": "3.2.0",
- "cksum": "1784604034 7539",
+ "version": "4.0.0",
+ "cksum": "2156178478 7460",
"tables": {
"Logical_Switch": {
"columns": {
"refType": "strong"},
"min": 0,
"max": "unlimited"}},
- "default_gw": {"type": {"key": "string", "min": 0, "max": 1}},
"enabled": {"type": {"key": "boolean", "min": 0, "max": 1}},
"nat": {"type": {"key": {"type": "uuid",
"refTable": "NAT",
One or more static routes for the router.
</column>
- <column name="default_gw">
- IP address to use as default gateway, if any.
- </column>
-
<column name="enabled">
This column is used to administratively set router state. If this column
is empty or is set to <code>true</code>, the router is enabled. If this
ovn-nbctl lrp-add R1 R1_R2 00:00:00:02:03:04 20.0.0.1/24 R2_R1
ovn-nbctl lrp-add R2 R2_R1 00:00:00:02:03:05 20.0.0.2/24 R1_R2
-ovn-nbctl set Logical_Router R1 default_gw="20.0.0.2"
-ovn-nbctl set Logical_Router R2 default_gw="20.0.0.1"
+ovn-nbctl lr-route-add R1 "0.0.0.0/0" 20.0.0.2
+ovn-nbctl lr-route-add R2 "0.0.0.0/0" 20.0.0.1
# Create logical port ls1-lp1 in ls1
ovn-nbctl lsp-add ls1 ls1-lp1 \