Configuring Static Routes
NOTE:
Enable IP routing function before using this feature, for details please refer to Configuring IP Routing.
The static route that specifies the next hop address and the one that specifies the outgoing interface are not considered for ECMP load sharing, even if they have equal cost.
If you are configuring a default route in the default VRF, you need to enable management VRF (After enabled by using command set system management-vrf enable true, eth0 will automatically be moved to management VRF from default VRF) to ensure the normal access to eth0 management port.
In L2/L3, all routing entries will be configured to the ASIC switching chip if the outgoing interface is link-up, and the outgoing physical port is learning. The outgoing interface is an L3 interface which can be VLAN interface, routed interface, loopback interface or sub-interface.
Traffic that can be routed will have a route entry in the RIB and the ARP of the next hop; the outgoing interface should be link-up. The traffic will then be soft-routed (i.e., routed by the switch's CPU).
When the switch learns the MAC address of the next-hop, the switch will forward the traffic with the ASIC chip.
Configure static route:
admin@XorPlus# set vlans vlan-id 2
admin@XorPlus# set vlans vlan-id 3
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 vlans vlan-id 2 l3-interface vlan-2
admin@XorPlus# set vlans vlan-id 3 l3-interface vlan-3
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# set l3-interface vlan-interface vlan-2 address 192.168.1.1 prefix-length 24
admin@XorPlus# set l3-interface vlan-interface vlan-3 address 192.168.2.1 prefix-length 24
admin@Xorplus# set ip routing enable true
admin@XorPlus# set protocols static route 10.10.1.0/24 next-hop 192.168.2.5
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show route static
RIB entry for static
====================
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
S>* 10.10.1.0/24 [1/0] via 192.168.2.1, vlan-3, weight 1, 00:40:35
admin@XorPlus# set interface gigabit-ethernet te-1/1/5 routed-interface enable true
admin@XorPlus# set interface gigabit-ethernet te-1/1/5 routed-interface name rif-2
admin@XorPlus# set vlans reserved-vlan 800-900
admin@XorPlus# set l3-interface routed-interface rif-2 address 120.2.1.49 prefix-length 24
admin@XorPlus# set protocols static route 8.1.1.0/24 next-hop 120.1.1.45
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus# run show route static
RIB entry for static
====================
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, A - Babel, F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
S>* 10.10.1.0/24 [1/0] via 192.168.2.1, vlan-3, weight 1, 03:40:35
S>* 8.1.1.0/24 [1/0] via 120.1.1.49, rif-2, weight 1, 01:18:48With the show route forward-route ipv4 all command, all the IPv4 route entries in the ASIC chip will be displayed.
admin@Xorplus# run show route forward-route ipv4 all
Destination NextHopMac Port
--------------- ----------------- ---------
10.10.1.0/24 3C:2C:30:84:E0:81 connected
8.1.1.0/24 3C:2C:30:84:E0:81 te-1/1/5
Total route count:2Copyright © 2025 Pica8 Inc. All Rights Reserved.