Static Routing Configuration Example
Unicast routing involves sending data from a single sender to a single receiver, making it a point-to-point routing protocol. Examples of unicast protocols include TCP and HTTP. Various forms of Layer 3 routing are considered unicast, including static routing. Static routing is used to manually configure a routing entry rather than rely on dynamic routing. As the name implies, static routes are fixed routes that do not change. They may be used as a backup to dynamic routing, to ensure a valid path exists between two points.
This document describes an example of how to configure a static route between two hosts in a network using open white box switches running the Pica8 PICOS network operating system.
Configuration Example
An example of configuration with static routing is shown in Fig. 5-1. Host A and Host B should be able to communicate with each other. Host A and Host B should be able to communicate with the gateway (e.g., access Internet).
Figure 5-1. Static routing configuration.
Configuring Switch A
For Switch A, configure 3 VLAN interfaces for networks 10.10.1.1/24, 10.10.3.1/24, and 10.10.6.1/24. Also configure a static route to 10.10.2.0/24 and a default route.
admin@XorPlus# set vlans vlan-id 2 admin@XorPlus# set vlans vlan-id 3 admin@XorPlus# set vlans vlan-id 4 admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 2 admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 3 admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 4 admin@XorPlus# set vlans vlan-id 2 l3-interface vlan-2 admin@XorPlus# set vlans vlan-id 3 l3-interface vlan-3 admin@XorPlus# set vlans vlan-id 4 l3-interface vlan-4 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# set vlan-interface interface vlan-2 vif vlan-2 address 10.10.1.1 prefix-length 24 admin@XorPlus# set vlan-interface interface vlan-3 vif vlan-2 address 10.10.3.1 prefix-length 24 admin@XorPlus# set vlan-interface interface vlan-4vif vlan-2 address 10.10.6.1 prefix-length 24 admin@XorPlus# set protocols static route 10.10.2.0/24 next-hop 10.10.6.2 admin@XorPlus# set protocols static route 0.0.0.0/0 next-hop 10.10.3.2 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus#
Verify the route entry in the RIB as follows:
admin@XorPlus# run show route table ipv4 unicast final 0.0.0.0/0 [static(1)/1] > to 10.10.3.2 via vlan-3/vlan-3 10.10.2.0/24[static(1)/1] > to 10.10.6.2 via vlan-4/vlan-4 10.10.1.0/24 [connected(0)/0] > via vlan-2/vlan-2 10.10.3.0/24 [connected(0)/0] > via vlan-3/vlan-3 10.10.6.0/24 [connected(0)/0] > via vlan-4/vlan-4 admin@XorPlus#
Configuring Switch B
Configure 3 VLAN interfaces for networks 10.10.2.1/24, 10.10.4.1/24, and 10.10.6.2/24. Then, configure a static route to 10.10.1.0/24 and a default route.
admin@XorPlus# set vlans vlan-id 2 admin@XorPlus# set vlans vlan-id 3 admin@XorPlus# set vlans vlan-id 4 admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 2 admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 3 admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 4 admin@XorPlus# set vlans vlan-id 2 l3-interface vlan-2 admin@XorPlus# set vlans vlan-id 3 l3-interface vlan-3 admin@XorPlus# set vlans vlan-id 4 l3-interface vlan-4 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# set vlan-interface interface vlan-2 vif vlan-2 address 10.10.2.1 prefix-length 24 admin@XorPlus# set vlan-interface interface vlan-3 vif vlan-2 address 10.10.4.1 prefix-length 24 admin@XorPlus# set vlan-interface interface vlan-4vif vlan-2 address 10.10.6.1 prefix-length 24 admin@XorPlus# set protocols static route 10.10.1.0/24 next-hop 10.10.6.1 admin@XorPlus# set protocols static route 0.0.0.0/0 next-hop 10.10.4.2 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus#
Verify the route entry in the RIB:
admin@XorPlus# run show route table ipv4 unicast final 0.0.0.0/0 [static(1)/1] > to 10.10.4.2 via vlan-3/vlan-3 10.10.1.0/24[static(1)/1] > to 10.10.6.1 via vlan-4/vlan-4 10.10.2.0/24 [connected(0)/0] > via vlan-2/vlan-2 10.10.4.0/24 [connected(0)/0] > via vlan-3/vlan-3 10.10.6.0/24 [connected(0)/0] > via vlan-4/vlan-4 admin@XorPlus#
Configuring Switch C
Configure 3 VLAN interfaces for networks 10.10.3.2/24, 10.10.4.2/24, and 10.10.5.2/24. Then, configure a static route to 10.10.1.0/24 and a default route.
admin@XorPlus# set vlans vlan-id 2 admin@XorPlus# set vlans vlan-id 3 admin@XorPlus# set vlans vlan-id 4 admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 2 admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 3 admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 4 admin@XorPlus# set vlans vlan-id 2 l3-interface vlan-2 admin@XorPlus# set vlans vlan-id 3 l3-interface vlan-3 admin@XorPlus# set vlans vlan-id 4 l3-interface vlan-4 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# set vlan-interface interface vlan-2vif vlan-2 address 10.10.3.2 prefix-length 24 admin@XorPlus# set vlan-interface interface vlan-3vif vlan-3 address 10.10.4.2 prefix-length 24 admin@XorPlus# set vlan-interface interface vlan-4vif vlan-4 address 10.10.5.2 prefix-length 24 admin@XorPlus# set protocols static route 10.10.1.0/24 next-hop 10.10.3.1 admin@XorPlus# set protocols static route 10.10.2.0/24 next-hop 10.10.4.1 admin@XorPlus# set protocols static route 10.10.6.0/24 next-hop 10.10.3.1 admin@XorPlus# set protocols static route 0.0.0.0/0 next-hop 10.10.5.1 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus#
Verify the route entry in the RIB:
admin@XorPlus# run show route table ipv4 unicast final 0.0.0.0/0 [static(1)/1] > to 10.10.5.1 via vlan-4/vlan-4 10.10.1.0/24[static(1)/1] > to 10.10.3.1 via vlan-2/vlan-2 10.10.2.0/24[static(1)/1] > to 10.10.4.1 via vlan-3/vlan-3 10.10.6.0/24[static(1)/1] > to 10.10.3.1 via vlan-2/vlan-2 10.10.3.0/24 [connected(0)/0] > via vlan-2/vlan-2 10.10.4.0/24 [connected(0)/0] > via vlan-3/vlan-3 10.10.5.0/24 [connected(0)/0] > via vlan-4/vlan-4 admin@XorPlus#
Copyright © 2025 Pica8 Inc. All Rights Reserved.