01-02 IP Static Route Configuration
01-02 IP Static Route Configuration
Contents
Figures
Title Description
2.1 Introduction This section describes the principle and concepts of the
static route.
2.2 Configuring an IPv4 Static This section describes how to configure IPv4 static route.
Route See Example for Configuring IPv4 Static Routes.
2.3 Configuring BFD for This section describes how to configure BFD for IS-IS.
Static Routes See Example for Configuring BFD for Static Routes.
2.4 Configuration Examples This section provides several configuration examples of
IP static route.
2.1 Introduction
This section covers the following topics that you need to know before you configure the static
route:
z Static Route
z Default Route
z BFD for Static Routes
While configuring static routes by using the ip route-static command, if you set the
destination address and the mask to all "0"s (0.0.0.0 0.0.0.0), then it indicates that you
have configured a default route.
Pre-configuration Tasks
Before configuring an IPv4 static route, complete the following tasks:
z Configuring physical parameters for related interfaces
z Configuring link layer attributes for related interfaces
z Configuring IPv4 addresses for related interfaces
Data Preparation
To configure an IPv4 static route, you need the following data.
No. Data
Configuration Procedures
No. Procedure
Action Command
Run the display ip routing-table verbose command. If you can find information about the
static route in the detailed information of the routing table, it means that the static route is
correctly configured.
<Quidway> display ip routing-table verbose
Routing Table : Public
Destinations : 3 Routes : 3
Destination: 1.1.1.1/32
Protocol: Static Process ID: 0
Preference: 60 Cost: 0
NextHop: 2.2.2.2 Neighbour: 0.0.0.0
State: Active Adv Age: 00h00m05s
Tag: 0 Priority: 0
Label: NULL QoSInfo: 0x0
RelayNextHop: 0.0.0.0 Interface: Ethernet1/0/0
TunnelID: 0x0
Destination: 2.2.2.0/24
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 2.2.2.2 Neighbour: 0.0.0.0
State: Active Adv Age: 00h00m16s
Tag: 0 Priority: 0
Label: NULL QoSInfo: 0x0
RelayNextHop: 0.0.0.0 Interface: Ethernet1/0/0
TunnelID: 0x0
Destination: 2.2.2.2/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 00h00m16s
Tag: 0 Priority: 0
Label: NULL QoSInfo: 0x0
RelayNextHop: 0.0.0.0 Interface: InLoopBack0
TunnelID: 0x0
Pre-configuration Tasks
Before configuring BFD for static route, complete the following tasks:
z Configuring physical parameters of the related interfaces
z Configuring link attributes of the related interfaces
z Configuring IPv4 address of the related interfaces
Data Preparation
To configure BFD for static route, you need the following data.
No. Data
Configuration Procedures
No. Procedure
BFD session is bound to the IPv4 static route of the public network.
----End
When binding BFD session to a static route, ensure that BFD session and the static route are on the same
link.
Action Command
Only after parameters of the BFD session are set and the BFD session is set up, you can view
the BFD session. If the BFD configuration is correct, you can view that the status of State in
the display is Up.
<Quidway> display bfd session all
Static Session Number : 1, Dynamic Session Number: 0
Coexistence Session Number : 0
--------------------------------------------------------------------------------
Local Remote Peer IP Address Interface Name State Type
--------------------------------------------------------------------------------
10 20 3.3.3.1 -- Up Static
--------------------------------------------------------------------------------
If the binding succeeds, you can view that the status of BFD session is Up. Use the display
current-configuration | include bfd command in the system view, and you can view that the
BFD session is bound.
<Quidway>display current-configuration | include bfd
bfd
bfd aaa bind peer-ip 3.3.3.1
ip route-static 5.5.5.0 255.255.255.0 3.3.3.1 track bfd-session aaa
PC2
1.1.2.2/24
GE3/0/0
1.1.2.1/24
POS1/0/0 POS2/0/0
1.1.4.2/30 1.1.4.5/30
RouterB
RouterA RouterC
POS1/0/0 POS1/0/0
1.1.4.1/30 1.1.4.6/30
GE2/0/0 GE2/0/0
1.1.1.1/24 1.1.3.1/24
PC1 PC3
1.1.1.2/24 1.1.3.2/24
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the IPv4 address of each interfaces on each router to make them connected
with each other.
2. Configure the IPv4 static route to the destination address and the default route on the
router.
3. Configure the IPv4 default gateway on each host to make every two hosts connected
with each other.
Data Preparation
To complete the configuration, you need the following data:
z The next hop of Router A is the default route 1.1.4.2.
z The destination address of Router B is 1.1.1.0, and its next hop is the static route 1.1.4.1.
z The destination address of Router B is 1.1.3.0, and its next hop is the static route 1.1.4.6.
z The next hop of Router C is the default route 1.1.4.5.
z The default gateway of host PC1 is 1.1.1.1. The default gateway of host PC2 is 1.1.2.1.
The default gateway of host PC3 is 1.1.3.1.
Configuration Procedure
Step 1 Configure the IP address for each interface (not mentioned here).
Step 2 Configure static routes.
----End
Configuration Files
z Configuration file of Router A
#
sysname RouterA
#
interface GigabitEthernet2/0/0
ip address 1.1.1.1 255.255.255.0
#
interface Pos1/0/0
link-protocol ppp
ip address 1.1.4.1 255.255.255.252
#
ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
#
return
z Configuration file of Router B
#
sysname RouterB
#
interface GigabitEthernet3/0/0
ip address 1.1.2.1 255.255.255.0
#
interface Pos1/0/0
link-protocol ppp
ip address 1.1.4.2 255.255.255.252
#
interface Pos2/0/0
link-protocol ppp
ip address 1.1.4.5 255.255.255.252
#
ip route-static 1.1.1.0 255.255.255.0 1.1.4.1
ip route-static 1.1.3.0 255.255.255.0 1.1.4.6
#
return
z Configuration file of Router C
#
sysname RouterC
#
interface GigabitEthernet2/0/0
ip address 1.1.3.1 255.255.255.0
#
interface Pos1/0/0
link-protocol ppp
ip address 1.1.4.6 255.255.255.252
#
ip route-static 0.0.0.0 0.0.0.0 1.1.4.5
#
return
Configuration Roadmap
The configuration roadmap is as follows:
1. Set up BFD session on Router A and Router B to detect the link between Router A and
Router C.
2. Configure a default static route on Router A and bind the BFD session to the default
static route to the external network.
Data Preparation
To configure BFD for static routes, you need the following data:
z Peer IP address of the BFD detection
z Local identifier and remote identifier of the BFD Session
z Default values of BFD parameters, such as, the minimum interval for sending/receiving
BFD control packets and local detect-multiplier.
Configuration Procedure
Step 1 Configure IP address of each interface. (not mentioned here)
Step 2 Set up the BFD session between Router A and Router B.
# On Router A, configure the BFD session with Router C .
<RouterA> system-view
[RouterA] bfd
[RouterA-bfd] quit
[RouterA] bfd atoc bind peer-ip 1.1.1.2
[RouterA-bfd-session-atoc] discriminator local 10
[RouterA-bfd-session-atoc] discriminator remote 20
[RouterA-bfd-session-atoc] commit
[RouterA-bfd-session-atoc] quit
Step 3 Configure a default static route and bind the BFD session to the default static route.
# On Router A, configure a default static route to the external network and bind the BFD
session aaa to the default static route.
[RouterA] ip route-static 0.0.0.0 0 1.1.1.2 track bfd-session aaa
# Viewing the IP routing table on Router A, you can find that static routes exist in the routing
table.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 3 Routes : 3
# Run the shutdown command on GE 1/0/0 of Router B to simulate the fault on the link.
[RouterB] interface gigabitethernet 1/0/0
[RouterB-GigabitEthernet1/0/0] shutdown
# You can view the following log on Router A, which indicates that BFD detects the fault on
the link.
<RouterA> terminal monitor
<RouterA> terminal debugging
<RouterA>
*0.27708400 RouterA RM/3/RMDEBUG:
RM_USR_BFDRefreshRT_H:
BfdSessionID = 10
BfdEvent = 0X0
USR : UsrDbID = 0X6, DestAdd = 0X0, Mask = 0X0, NextHop = 0X1010102
URT : TableID = 0X1, EntryID = 0XB, ProcID = 0X2, FLAG = 0X8114000
**********STATIC bfd down, the STATIC route will down**********
# Viewing the routing table of Router A, you can find that the default static route 0.0.0.0/0
does not exist. This is because the BFD session is bound to the default static route. When
detecting the fault, BFD immediately notifies all bound static routes that this route is invalid.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 2 Routes : 2
----End
Configuration Files
z Configuration file of Router A
#
sysname RouterA
#
bfd
#
interface GigabitEthernet1/0/0
link-protocol ppp
ip address 1.1.1.1 255.255.255.0
#
bfd aaa bind peer-ip 1.1.1.2
discriminator local 10
discriminator remote 20
commit
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.2 track bfd-session aaa
#
return
z Configuration file of Router B
#
sysname RouterB
#
bfd
#
interface GigabitEthernet1/0/0
ip address 1.1.1.2 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 2.2.2.2 255.255.255.0
#
bfd aaa bind peer-ip 1.1.1.1
discriminator local 20
discriminator remote 10
commit
#
return