mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
sharpd: add uSID instruction support to seg6local routes
Seg6local routes can be installed with uSID instruction. > ubuntu2204hwe# sharp install seg6local-routes 1006::1 nexthop-seg6local loop1 uN > ubuntu2204hwe# Ctrl-D > # ip -6 ro show > 1006::1 nhid 28 encap seg6local action End flavors next-csid lblen 32 nflen 16 dev loop1 proto 194 metric 20 pref medium As of today, uA and uN can be displayed with iproute2. The other instructions are not rejected by the kernel, but are not displayed by iproute2. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
4da04350df
commit
542a0f7518
|
@ -198,14 +198,18 @@ keyword. At present, no sharp commands will be preserved in the config.
|
|||
router# sharp install seg6local-routes 1::4 nexthop-seg6local dum0 End_DX4 10.0.0.1 1
|
||||
router# sharp install seg6local-routes 1::5 nexthop-seg6local dum0 End_DT6 10 1
|
||||
router# sharp install seg6local-routes 1::6 nexthop-seg6local dum0 End_DT46 10 1
|
||||
router# sharp install seg6local-routes 1::7 nexthop-seg6local dum0 uN 1
|
||||
router# sharp install seg6local-routes 1::8 nexthop-seg6local dum0 uA 2001::1 1
|
||||
|
||||
router# show ipv6 route
|
||||
D>* 1::1/128 [150/0] is directly connected, dum0, seg6local End USP, weight 1, 00:00:05
|
||||
D>* 1::1/128 [150/0] is directly connected, dum0, seg6local End -, weight 1, 00:00:05
|
||||
D>* 1::2/128 [150/0] is directly connected, dum0, seg6local End.X nh6 2001::1, weight 1, 00:00:05
|
||||
D>* 1::3/128 [150/0] is directly connected, dum0, seg6local End.T table 10, weight 1, 00:00:05
|
||||
D>* 1::4/128 [150/0] is directly connected, dum0, seg6local End.DX4 nh4 10.0.0.1, weight 1, 00:00:05
|
||||
D>* 1::5/128 [150/0] is directly connected, dum0, seg6local End.DT6 table 10, weight 1, 00:00:05
|
||||
D>* 1::6/128 [150/0] is directly connected, dum0, seg6local End.DT46 table 10, weight 1, 00:00:05
|
||||
D>* 1::7/128 [150/0] is directly connected, dum0, seg6local End -, weight 1, 00:00:05
|
||||
D>* 1::8/128 [150/0] is directly connected, dum0, seg6local End.X nh6 2001::1, weight 1, 00:01:17
|
||||
|
||||
bash# ip -6 route
|
||||
1::1 encap seg6local action End dev dum0 proto 194 metric 20 pref medium
|
||||
|
@ -214,6 +218,9 @@ keyword. At present, no sharp commands will be preserved in the config.
|
|||
1::4 encap seg6local action End.DX4 nh4 10.0.0.1 dev dum0 proto 194 metric 20 pref medium
|
||||
1::5 encap seg6local action End.DT6 table 10 dev dum0 proto 194 metric 20 pref medium
|
||||
1::6 encap seg6local action End.DT46 table 10 dev dum0 proto 194 metric 20 pref medium
|
||||
1::7 encap seg6local action End flavors next-csid lblen 32 nflen 16 dev dum0 proto 194 metric 20 pref medium
|
||||
1::8 encap seg6local action End.X nh6 2001::1 flavors next-csid lblen 32 nflen 16 dev dum0 proto 194 metric 20 pref medium
|
||||
|
||||
|
||||
.. clicmd:: show sharp segment-routing srv6
|
||||
|
||||
|
|
|
@ -445,13 +445,21 @@ DEFPY (install_seg6local_routes,
|
|||
X:X::X:X$start6\
|
||||
nexthop-seg6local NAME$seg6l_oif\
|
||||
<End$seg6l_end|\
|
||||
uN$seg6l_micro_end|\
|
||||
End_X$seg6l_endx X:X::X:X$seg6l_endx_nh6|\
|
||||
uA$seg6l_micro_endx X:X::X:X$seg6l_micro_endx_nh6|\
|
||||
End_T$seg6l_endt (1-4294967295)$seg6l_endt_table|\
|
||||
uDT$seg6l_micro_endt (1-4294967295)$seg6l_micro_endt_table|\
|
||||
End_DX4$seg6l_enddx4 A.B.C.D$seg6l_enddx4_nh4|\
|
||||
uDX4$seg6l_micro_enddx4 A.B.C.D$seg6l_micro_enddx4_nh4|\
|
||||
End_DX6$seg6l_enddx6 X:X::X:X$seg6l_enddx6_nh6|\
|
||||
uDX6$seg6l_micro_enddx6 X:X::X:X$seg6l_micro_enddx6_nh6|\
|
||||
End_DT6$seg6l_enddt6 (1-4294967295)$seg6l_enddt6_table|\
|
||||
uDT6$seg6l_micro_enddt6 (1-4294967295)$seg6l_micro_enddt6_table|\
|
||||
End_DT4$seg6l_enddt4 (1-4294967295)$seg6l_enddt4_table|\
|
||||
End_DT46$seg6l_enddt46 (1-4294967295)$seg6l_enddt46_table>\
|
||||
uDT4$seg6l_micro_enddt4 (1-4294967295)$seg6l_micro_enddt4_table|\
|
||||
End_DT46$seg6l_enddt46 (1-4294967295)$seg6l_enddt46_table|\
|
||||
uDT46$seg6l_micro_enddt46 (1-4294967295)$seg6l_micro_enddt46_table>\
|
||||
(1-1000000)$routes [repeat (2-1000)$rpt]",
|
||||
"Sharp routing Protocol\n"
|
||||
"install some routes\n"
|
||||
|
@ -462,20 +470,35 @@ DEFPY (install_seg6local_routes,
|
|||
"Nexthop-seg6local to use\n"
|
||||
"Output device to use\n"
|
||||
"SRv6 End function to use\n"
|
||||
"SRv6 uN function to use\n"
|
||||
"SRv6 End.X function to use\n"
|
||||
"V6 Nexthop address to use\n"
|
||||
"SRv6 uA function to use\n"
|
||||
"V6 Nexthop address to use\n"
|
||||
"SRv6 End.T function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"SRv6 uDT function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"SRv6 End.DX4 function to use\n"
|
||||
"V4 Nexthop address to use\n"
|
||||
"SRv6 uDX4 function to use\n"
|
||||
"V4 Nexthop address to use\n"
|
||||
"SRv6 End.DX6 function to use\n"
|
||||
"V6 Nexthop address to use\n"
|
||||
"SRv6 uDX6 function to use\n"
|
||||
"V6 Nexthop address to use\n"
|
||||
"SRv6 End.DT6 function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"SRv6 uDT6 function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"SRv6 End.DT4 function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"SRv6 uDT4 function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"SRv6 End.DT46 function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"SRv6 uDT46 function to use\n"
|
||||
"Redirect table id to use\n"
|
||||
"How many to create\n"
|
||||
"Should we repeat this command\n"
|
||||
"How many times to repeat this command\n")
|
||||
|
@ -519,27 +542,57 @@ DEFPY (install_seg6local_routes,
|
|||
if (seg6l_enddx4) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DX4;
|
||||
ctx.nh4 = seg6l_enddx4_nh4;
|
||||
} else if (seg6l_micro_enddx4) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DX4;
|
||||
ctx.nh4 = seg6l_micro_enddx4_nh4;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else if (seg6l_enddx6) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DX6;
|
||||
ctx.nh6 = seg6l_enddx6_nh6;
|
||||
} else if (seg6l_micro_enddx6) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DX6;
|
||||
ctx.nh6 = seg6l_enddx6_nh6;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else if (seg6l_endx) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_X;
|
||||
ctx.nh6 = seg6l_endx_nh6;
|
||||
} else if (seg6l_micro_endx) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_X;
|
||||
ctx.nh6 = seg6l_micro_endx_nh6;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else if (seg6l_endt) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_T;
|
||||
ctx.table = seg6l_endt_table;
|
||||
} else if (seg6l_micro_endt) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_T;
|
||||
ctx.table = seg6l_micro_endt_table;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else if (seg6l_enddt6) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DT6;
|
||||
ctx.table = seg6l_enddt6_table;
|
||||
} else if (seg6l_micro_enddt6) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DT6;
|
||||
ctx.table = seg6l_micro_enddt6_table;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else if (seg6l_enddt4) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DT4;
|
||||
ctx.table = seg6l_enddt4_table;
|
||||
} else if (seg6l_micro_enddt4) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DT4;
|
||||
ctx.table = seg6l_micro_enddt4_table;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else if (seg6l_enddt46) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DT46;
|
||||
ctx.table = seg6l_enddt46_table;
|
||||
} else {
|
||||
} else if (seg6l_micro_enddt46) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END_DT46;
|
||||
ctx.table = seg6l_micro_enddt46_table;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else if (seg6l_micro_end) {
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END;
|
||||
SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID);
|
||||
} else
|
||||
action = ZEBRA_SEG6_LOCAL_ACTION_END;
|
||||
}
|
||||
|
||||
sg.r.nhop.type = NEXTHOP_TYPE_IFINDEX;
|
||||
sg.r.nhop.ifindex = ifname2ifindex(seg6l_oif, vrf->vrf_id);
|
||||
|
|
Loading…
Reference in a new issue