VLAN-matching facilities,
so this field will be ignored unless other dataplane providers are used.
+.. clicmd:: set nexthop-group NAME
+
+ Action:
+ forward the packet using nexthop-group NAME.
+
+.. clicmd:: set nexthop [A.B.C.D|X:X::X:XX|blackhole] [interface] [nexthop-vrf NAME]
+
+ Action:
+ forward the packet using the specified single nexthop.
+ If `blackhole`, packets will be sent to a blackhole route and dropped.
+
+.. clicmd:: set vrf unchanged|NAME
+
+ Action:
+ If set to ``unchanged``, the rule will use the vrf table the interface
+ is in as its lookup.
+ If set to NAME, the rule will use that vrf table as its lookup.
+
+ Not supported with NETNS VRF backend.
+
.. clicmd:: set queue-id (1-65535)
Action:
so this field will be ignored unless another dataplane provider is used.
It is invalid to specify both a `strip` and `set vlan` action.
-.. clicmd:: set nexthop-group NAME
-
- Action:
- forward the packet using nexthop-group NAME.
-
-.. clicmd:: set nexthop [A.B.C.D|X:X::X:XX] [interface] [nexthop-vrf NAME]
-
- Action:
- forward the packet using the specified single nexthop.
-
-.. clicmd:: set vrf unchanged|NAME
-
- Action:
- If set to ``unchanged``, the rule will use the vrf table the interface
- is in as its lookup.
- If set to NAME, the rule will use that vrf table as its lookup.
-
- Not supported with NETNS VRF backend.
-
.. clicmd:: show pbr map [NAME] [detail|json]
Display pbr maps either all or by ``NAME``. If ``detail`` is set, it will
return CMD_SUCCESS;
}
-DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
- "set nexthop\
+/* clang-format off */
+DEFPY (pbr_map_nexthop,
+ pbr_map_nexthop_cmd,
+ "set nexthop\
<\
<A.B.C.D|X:X::X:X>$addr [INTERFACE$intf]\
|INTERFACE$intf\
+ |blackhole$bh\
>\
[nexthop-vrf NAME$vrf_name]",
- "Set for the PBR-MAP\n"
- "Specify one of the nexthops in this map\n"
- "v4 Address\n"
- "v6 Address\n"
- "Interface to use\n"
- "Interface to use\n"
- "If the nexthop is in a different vrf tell us\n"
- "The nexthop-vrf Name\n")
+ "Set for the PBR-MAP\n"
+ "Specify one of the nexthops in this map\n"
+ "v4 Address\n"
+ "v6 Address\n"
+ "Interface to use\n"
+ "Interface to use\n"
+ "Blackhole route\n"
+ "If the nexthop is in a different vrf tell us\n"
+ "The nexthop-vrf Name\n")
{
+ /* clang-format on */
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
struct vrf *vrf;
struct nexthop nhop;
nhop.type = NEXTHOP_TYPE_IPV6;
}
}
- } else
+ } else if (bh) {
+ nhop.type = NEXTHOP_TYPE_BLACKHOLE;
+ } else {
nhop.type = NEXTHOP_TYPE_IFINDEX;
+ }
if (pbrms->nhg)
nh = nexthop_exists(pbrms->nhg, &nhop);
return CMD_SUCCESS;
}
-DEFPY(no_pbr_map_nexthop, no_pbr_map_nexthop_cmd,
- "no set nexthop\
+/* clang-format off */
+DEFPY (no_pbr_map_nexthop,
+ no_pbr_map_nexthop_cmd,
+ "no set nexthop\
[<\
<A.B.C.D|X:X::X:X>$addr [INTERFACE$intf]\
|INTERFACE$intf\
+ |blackhole$bh\
>\
[nexthop-vrf NAME$vrf_name]]",
- NO_STR
- "Set for the PBR-MAP\n"
- "Specify one of the nexthops in this map\n"
- "v4 Address\n"
- "v6 Address\n"
- "Interface to use\n"
- "Interface to use\n"
- "If the nexthop is in a different vrf tell us\n"
- "The nexthop-vrf Name\n")
+ NO_STR
+ "Set for the PBR-MAP\n"
+ "Specify one of the nexthops in this map\n"
+ "v4 Address\n"
+ "v6 Address\n"
+ "Interface to use\n"
+ "Interface to use\n"
+ "Blackhole route\n"
+ "If the nexthop is in a different vrf tell us\n"
+ "The nexthop-vrf Name\n")
{
+ /* clang-format on */
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
if (!pbrms)