Table of Contents
Creating Static Routes on a Switch
Static routing is a routing method that uses manually-configured routing tables instead of dynamic routing traffic. It’s a good choice when a route doesn’t change often, when the complexity of a dynamic routing protocol is not desired, or when there’s only one or a few paths to a destination.
Static routes are defined manually, and a switch doesn’t need to learn or calculate routes.
A typical use case is a single-homed network attached to an upstream provider.
config route add { add | del } prefix [vrf <vrf_name>] <A.B.C.D/M> nexthop <[vrf <vrf_name>] <A.B.C.D>>|<dev <dev_name>>
Parameter description:
add: Add a route.
del: Add a route.
vrf: VRF name.
A.B.C.D/M: IPv4 address in dotted notation.
dev_name: An interface name.
![]() | Prefix /nexthop vrf`s and interface name are optional. |
Adding a new nexthop to the existing prefix will complement it and not overwrite it.
admin@sonic:~$ sudo config route add prefix 2.2.3.4/32 nexthop vrf Vrf-RED 30.0.0.9
admin@sonic:~$ sudo config route add prefix 2.2.3.4/32 nexthop vrf Vrf-BLUE 30.0.0.10
Figure 1. A network topology
nba621-1
admin@sonic:~$ sudo config route del prefix 192.168.11.0/24 nexthop 10.0.1.1
nba621-2
admin@sonic:~$ sudo config route add prefix 192.168.10.0/24 nexthop 10.0.1.0
admin@nba621-1:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
K>*0.0.0.0/0 [0/202] via 192.168.0.1, eth0, 01:52:20
C>*10.0.1.0/31 is directly connected, Ethernet68, 00:45:08
C>*10.1.0.1/32 is directly connected, Loopback0, 01:52:20
C>*192.168.0.0/24 is directly connected, eth0, 01:52:20
C>*192.168.10.0/24 is directly connected, Ethernet0, 00:06:16
S>*192.168.11.0/24 [1/0] via 10.0.1.1, Ethernet68, 00:44:23
admin@nba621-2:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
K>*0.0.0.0/0 [0/202] via 192.168.0.1, eth0, 01:52:17
C>*10.0.1.0/31 is directly connected, Ethernet68, 00:44:39
C>*10.1.0.1/32 is directly connected, Loopback0, 01:52:17
C>*192.168.0.0/24 is directly connected, eth0, 01:52:17
S>*192.168.10.0/24 [1/0] via 10.0.1.0, Ethernet68, 00:44:12
C>*192.168.11.0/24 is directly connected, Ethernet0, 00:03:59
Ping between hosts:
user@left:~$ ping 192.168.11.1
PING 192.168.11.1 (192.168.11.1) 56(84) bytes of data.
64 bytes from 192.168.11.1: icmp_seq=1 ttl=62 time=0.122 ms
64 bytes from 192.168.11.1: icmp_seq=2 ttl=62 time=0.164 ms
64 bytes from 192.168.11.1: icmp_seq=3 ttl=62 time=0.280 ms
64 bytes from 192.168.11.1: icmp_seq=4 ttl=62 time=0.113 ms
Taoyuan, Taiwan, 29th of April 2025. The latest release of SONiC 202411.n0 – an enterprise distribution of SONiC by Netberg – introduces new features and enhancements tailored to improve performance in data center, edge, and campus environments.
Taoyuan, Taiwan, 20th of January 2025. Netberg, the leading provider of open networking solutions, announces support of Ubuntu 24.04 Noble Numbat on its Broadcom-enabled portfolio.
Taoyuan city, Taiwan, 24th of June 2024. Netberg announced the new Aurora 721 100G and Aurora 421 10G switches, which feature programmable pipelines powered by Broadcom StrataXGS® Trident3 Ethernet switch chips.
Taoyuan city, Taiwan, January 24th, 2024. Netberg announced the release of two new models powered by the Broadcom StrataXGS® Trident3 series , the Netberg Aurora 221 1G switch and Aurora 621 25G switch.
Effective January 12, 2024: The following products are now End of Life (EOL) - Aurora 720 and Aurora 620.
Taoyuan city, Taiwan, December 20th, 2023. Netberg updates its Netberg SONiC distribution to release 2022.11 on Aurora 610, Aurora 710, and Aurora 750 P4-Programmable Intel Tofino IFP systems.