Inspecting L3 forwarding
Table sizes and how full they are:
l3 info.IPv4 routes:
l3 defip show; IPv6 routes:l3 ip6route show.The
INTFcolumn of a route is an egress object; list them withl3 egress show. An egress object whoseINTFis16383sends traffic to the CPU, and one markedDrop yesdiscards it. On a SONiC switch, connected subnets and the switch’s own addresses point at the to-CPU object, and the default route points at the drop object until a real default route is learned.A route whose
INTFis an ECMP group:l3 ecmp egress show(the wordegressis required).Router interfaces (VRF, VLAN, MAC, MTU):
l3 intf show.Neighbours (host entries):
l3 l3table showfor IPv4,l3 ip6host showfor IPv6.Which route a destination hits, when routes are stored in ALPM:
l3 alpm find. SONiC Trident 3 switches can run with ALPM off; then thel3 alpmandALPMcommands print onlyALPM is unsupported or disabled!orALPM is disabled!, andl3 defip showlists the routes.Which ECMP member a flow takes:
l3 defip ecmphash.VXLAN: known remote VTEPs with
BCMSAI MPTnl Dip Detail; hardware state withdump chg EGR_IP_TUNNELanddump chg EGR_DVP_ATTRIBUTE(dump).
All of these are safe on a running switch; SONiC’s generate_dump runs most
of them.
Routes can also be added by hand, e.g. l3 ip6route add; SONiC will
not know about them. Avoid l3 … clear, l3 init, l3 detach and
l3 route test perf on a production switch.