Introduction to Static Routing Configuration

a static route is a special route that needs to be manually configured by an administrator.

Static routing has different purposes in different network environments:

? When the network structure is simple, the network can work normally only by configuring static routes.

? In a complex network environment, configuring static routes can improve the performance of the network and ensure bandwidth for important applications.

Routers forward packets according to routes, which can be generated by manual configuration and calculation using dynamic routing algorithms, among which the routes generated by manual configuration are static routes.

static routing uses less bandwidth than dynamic routing and does not occupy CPU resources to calculate and analyze routing updates. However, when the network fails or the topology changes, the static route will not be updated automatically and must be reconfigured manually. Static routing has five main parameters: destination address and mask, exit interface and next hop, and priority.

the destination address of IPv4 is in dotted decimal format, and the mask can be expressed in dotted decimal format or the mask length (i.e. the number of consecutive' 1' s in the mask). For the destination address and mask of IPv6, please refer to "IPv6 Basic Configuration-Principle Description -IPv6 Address" in Configuration Guide-IP Service Configuration. When the destination address and mask are both zero, it means a static default route.

when configuring static routes, specify the exit interface and next hop address according to different exit interface types.

? For point-to-point interfaces, you only need to specify the interface. Because specifying the sending interface implies specifying the next hop address, it is considered that the address of the opposite interface connected to this interface is the next hop address of the route.

? For nbma (non-broadcast multiple access) type interfaces (such as ATM interfaces), configure the next-hop IP address. Because this kind of interface supports point-to-multipoint networks, in addition to configuring static routes, it is necessary to establish the mapping from IP address to link layer address at the link layer. In this case, it is not necessary to specify the interface

? For broadcast interfaces (such as Ethernet interfaces) and VT(Virtual-template) interfaces, the corresponding next-hop address must be specified when sending through this interface. Because the Ethernet interface is a broadcast interface, and multiple Virtual Access Interface can be associated under the VT interface, this will lead to multiple next hops, and the next hop cannot be determined uniquely.

unlike dynamic routing protocols, static routing itself has no detection mechanism, and when the network fails, administrators need to intervene. The linkage between static route and BFD can bind BFD session for static route, and use BFD session to detect the link status of static route. The specific process is as follows:

? When the BFD session on a static route detects a link failure, BFD will report the failure to the system, which will make the route invalid and make it invisible in the IP routing table.

? When the BFD session on a static route detects that the failed link is successfully re-established, BFD will report to the system, activate the route, and make the route reappear in the IP routing table.

Hosts belonging to different network segments are connected through several Router, which requires that no dynamic routing protocol is configured, so that any two hosts in different network segments can communicate with each other.

adopt the following ideas to configure IPv4 static routing:

1. configure the IP addresses of each router interface to realize equipment network interoperability.

2. configure IP default gateway on each host, and configure IP static route and default route on each router, so that dynamic routing protocol is not configured, and any two hosts in different network segments can communicate with each other.

1. configure the IP address of each router interface

# configure the IP address of the interface on RouterA, and the configuration of RouterB and RouterC is the same as that of RouterA, which is omitted here.

2. configure static route

# configure IPv4 default route on RouterA.

[routera] iproute-static .... 192.168.4.2

# Configure two static routes of IPv4 on RouterB.

[routerb] iproute-static 192.168.1. 255.255. 192.168.4.1

[routerb] iproute-static 192.168.3. 255.255.2555555555255

[routerc] IP route-static .... 192.168.4.5

3. Configure the host

Configure the default gateway of host PC1 as 192.168.1.1 and host PC2 as 192.1.

4. Verify the configuration result

# Displays the IP routing table of RouterA.

# verify connectivity with the Ping command.

# use the Tracert command to verify connectivity.

RouterA is connected to the external network through RouterB, and RouterA and RouterB are interconnected through SwitchC. RouterA is required to communicate with the external network normally, and realize millisecond fault awareness between RouterA and RouterB to improve the convergence speed.

adopt the following ideas to configure the linkage between IPv4 static routing and BFD:

1. Configure the IP address of each router interface to realize equipment network interoperability.

2. configure BFD session on RouterA and RouterB to realize millisecond fault awareness between RouterA and RouterB.

3. Configure the default route to the external network on RouterA, and link this default route with the configured BFD session, so as to quickly detect the link failure and improve the convergence speed of the route.

1. configure the IP address of each router interface

# configure the IP address of the interface on RouterA.

< Huawei> system-view

[Huawei] sysname RouterA

[RouterA] interface gigabitethernet 1//

[RouterA-GigabitEthernet1//] Ip address 1.1.1.1 24

[RouterA-Gigabit Ethernet 1//] quit

The configuration of Routerb is the same as that of Routera (omitted).

2. configure BFD session between RouterA and RouterB

# configure BFD session with RouterB on RouterA.

[RouterA] bfd

[RouterA-bfd] quit

[RouterA] bfd aa bind peer-ip 1.1.1.2

[RouterA-bfd-session-aa] discriminator local 1

[RouterA-bfd-session-aa] discriminator remote 2

[RouterA-bfd-session-aa] Commit

[RouterA-bfd-session-aa] quit

# configure BFD Session with routera on RouterB.

[RouterB] bfd

[RouterB-bfd] quit

[RouterB] bfd bb bind peer-ip 1.1.1.1

[RouterB-bfd-session-bb] discriminator local 2

[RouterB-bfd-session-bb] discriminator remote 1

[RouterB-bfd-session-bb] Commit

[router b-BFD-session-bb] quit

3. Configure the static default route and bind the BFD session

# Configure the static default route to the external network on RouterA and bind the bfd session aa.

[RouterA] IP route-static .. 1.1.1.2 Track BFD-Session AA

4. Verify the configuration result

# After the configuration is completed, execute the display bfd session all command on Routera and RouterB, and you can see that the BFD session has been established and the status is Up. Execute the display current-configuration | include BFD command in the system view, and you can see that the static route has bound the bfd session.

about static routing configuration, SPOTO Sibo Network is here to share with you today. Please continue to pay attention to SPOTO Sibo Network for more contents about static routing: SPOTO Sibo Network is a global online training and learning base for IT technical talents, which is dedicated to cultivating high-quality IT talents and accelerating the vocational skills advancement of IT Internet technical talents. We provide customers with competitive training products and reliable services in the fields of cisco certified, Huawei certification, CISSP information security certification, Linux, cloud computing, big data and artificial intelligence, and continue to create value for customers and release their personal potential. Always focus on customer needs for continuous innovation, increase investment in curriculum research and development, accumulate wealth, promote personal growth, accelerate career progress, and save time for training ICT architects for the world.