Creating IPv4 Static Routes
Context
Specify the outbound interface for P2P interfaces.
Specify the next hop for non broadcast multiple access (NBMA) interfaces.
Specify the next hop for broadcast interfaces (for example, Ethernet interfaces) and virtual template interfaces.
If you specify the same preference for static routes to the same destination, you can implement load balancing among these routes. If you specify different preferences for static routes, you can implement route backup among the routes.
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 any of the following commands:
- ip route-static ip-address { mask | mask-length } { nexthop-address | interface-type interface-number [ nexthop-address ] | vpn-instance vpn-instance-name nexthop-address } [ preference preference | tag tag ] * [ description text ]
- ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ] [ preference preference | tag tag ] * ldp-sync [ description text ]
- ip route-static destination-address { mask | mask-length } interface-type interface-number dhcp [ preference preference | tag tag ] * [ track nqa admin-name test-name ] [ description text ]
An IPv4 static route is configured on the public network.
- Run any of the following commands:
- ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } { nexthop-address [ public ] | interface-type interface-number [ nexthop-address ] | vpn-instance vpn-destination-name nexthop-address } [ preference preference | tag tag ] * [ description text ]
- Or ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } interface-type interface-number [ nexthop-address ] [ preference preference | tag tag ] * ldp-sync [ description text ]
- ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } interface-type interface-number dhcp [ preference preference | tag tag ] * [ track nqa admin-name test-name ] [ description text ]
An IPv4 static route is configured in a VPN instance.