Inspecting L3 forwarding

  • Table sizes and how full they are: l3 info.

  • IPv4 routes: l3 defip show; IPv6 routes: l3 ip6route show.

  • The INTF column of a route is an egress object; list them with l3 egress show. An egress object whose INTF is 16383 sends traffic to the CPU, and one marked Drop yes discards 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 INTF is an ECMP group: l3 ecmp egress show (the word egress is required).

  • Router interfaces (VRF, VLAN, MAC, MTU): l3 intf show.

  • Neighbours (host entries): l3 l3table show for IPv4, l3 ip6host show for 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 the l3 alpm and ALPM commands print only ALPM is unsupported or disabled! or ALPM is disabled!, and l3 defip show lists the routes.

  • Which ECMP member a flow takes: l3 defip ecmphash.

  • VXLAN: known remote VTEPs with BCMSAI MPTnl Dip Detail; hardware state with dump chg EGR_IP_TUNNEL and dump 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.