Creating IPv4 Static Routes
Context
Specify the outbound interface for a P2P interface.
Specify the next hop for a non broadcast multiple access (NBMA) interface.
Specify the next hop for a broadcast interface (for example, an Ethernet interface).
If you specify the same preference for static routes to the same destination, load balancing among these routes is implemented. If you specify different preferences for static routes, route backup among the routes is implemented.
If the destination IP address and mask are set to all 0s, an IPv4 static default route is configured. By default, no IPv4 static default route is configured.
Procedure
- Run system-view
The system view is displayed.
- Configure IPv4 static routes.
- Run ip route-static ip-address { mask | mask-length } { nexthop-address | vpn-instance vpn-instance-name nexthop-address } [ recursive-lookup host-route [ arp-vlink-only ] ] [ preference preference | tag tag ] * [ bfd enable | track { bfd-session cfg-name | nqa admin-name test-name } | inherit-cost | permanent ] [ arp-detect interface-type interface-number ] [ inter-protocol-ecmp ] [ description text ]
An IPv4 static route is configured on the public network.
- Run ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ] [ preference preference | tag tag ] * [ bfd enable | track { bfd-session cfg-name | nqa admin-name test-name } | permanent ] [ arp-detect interface-type interface-number ] [ inter-protocol-ecmp ] [ description text ]
An IPv4 static route is configured on the public network.
- Run ip
route-static ip-address { mask | mask-length } vpn-instance vpn-instance-name [ preference preference | tag tag ] * [ arp-detect interface-type interface-number ] [ description text ]
An IPv4 static route is configured on the public network.
- Run ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } interface-type interface-number [ nexthop-address ] [ preference preference | tag tag ] * [ bfd enable | track { bfd-session cfg-name | nqa admin-name test-name } | permanent ] [ arp-detect interface-type interface-number ] [ inter-protocol-ecmp ] [ description text ]
An IPv4 static route is configured in a VPN instance.
- Run ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } { vpn-instance vpn-destination-name nexthop-address | nexthop-address [ public ] } [ recursive-lookup host-route [ arp-vlink-only ] ] [ preference preference | tag tag ] * [ bfd enable | track { bfd-session cfg-name | nqa admin-name test-name } | inherit-cost | permanent ] [ arp-detect interface-type interface-number ] [ inter-protocol-ecmp ] [ description text ]
An IPv4 static route is configured in a VPN instance.
Run ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } { public | vpn-instance vpn-destination-name } [ preference preference | tag tag ] * [ arp-detect interface-type interface-number ] [ description text ]
An IPv4 static route is configured in a VPN instance.
- Run ip route-static ip-address { mask | mask-length } { nexthop-address | vpn-instance vpn-instance-name nexthop-address } [ recursive-lookup host-route [ arp-vlink-only ] ] [ preference preference | tag tag ] * [ bfd enable | track { bfd-session cfg-name | nqa admin-name test-name } | inherit-cost | permanent ] [ arp-detect interface-type interface-number ] [ inter-protocol-ecmp ] [ description text ]
- Run commit
The configuration is committed.