Full set of configuration details: Default routing experimental configuration

1. Experimental purpose

Understand the applicable situations and configuration methods of default routing

2. Experimental topology

 Default route configuration

3. Experimental steps

(1) Configure network connectivity as follows.

1) The configuration of R1 is as follows:

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname R1

[R1]interface g0/0/0

[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24

[R1-GigabitEthernet0/0/0]quit

2) The configuration of R2 is as follows:

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname R2

[R2]interface g0/0/1

[R2-GigabitEthernet0/0/1]ip address 12.1.1.2 24

[R2-GigabitEthernet0/0/1]quit

[R2]interface g0/0/0

[R2-GigabitEthernet0/0/0]ip address 23.1.1.2 24

[R2-GigabitEthernet0/0/0]quit

[R2]interface g0/0/2

[R2-GigabitEthernet0/0/2]ip address 24.1.1.2 24

[R2-GigabitEthernet0/0/2]quit

3) The configuration of R3 is as follows:

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname R3

[R3]interface g0/0/1

[R3-GigabitEthernet0/0/1]ip address 23.1.1.3 24

[R3-GigabitEthernet0/0/1]quit

4) The configuration of R4 is as follows:

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname R4

[R4]interface g0/0/1

[R4-GigabitEthernet0/0/1]ip address 24.1.1.4 24

[R4-GigabitEthernet0/0/1]quit

(2) Configure static routing.

1) The configuration of R1 is as follows:

[R1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2 // Configure the next hop of the default route to any network segment as 12.1.1.2

2) The configuration of R3 is as follows:

[R3]ip route-static 12.1.1.0 255.255.255.0 23.1.1.2

3) The configuration of R4 is as follows:

[R4]ip route-static 12.1.1.0 255.255.255.0 24.1.1.2

4. Experimental debugging

(1) Check the routing table of R1 with the following command:

[R1]display ip routing-table

Route Flags: R - relay, D - download to fifib

----------------------------------------------------

Routing Tables: Public

Destinations : 5 Routes : 5

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 Static 60 0 RD 12.1.1.2 GigabitEthernet0/0/0

12.1.1.0/24 Direct 0 0 D 12.1.1.1 GigabitEthernet0/0/0

12.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0

127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

By looking at the routing table of R1, you can see a default route. Although the configuration is simplified, you still need to test the network connectivity.

(2) R1 accesses R3, the command is as follows:

[R1]ping 23.1.1.3

PING 23.1.1.3: 56 data bytes, press CTRL_C to break

Reply from 23.1.1.3: bytes=56 Sequence=1 ttl=254 time=100 ms

Reply from 23.1.1.3: bytes=56 Sequence=2 ttl=254 time=60 ms

Reply from 23.1.1.3: bytes=56 Sequence=3 ttl=254 time=50 ms

Reply from 23.1.1.3: bytes=56 Sequence=4 ttl=254 time=70 ms

Reply from 23.1.1.3: bytes=56 Sequence=5 ttl=254 time=80 ms

--- 23.1.1.3 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 50/72/100 ms

(3) R1 accesses R4, the command is as follows:

[R1]ping 24.1.1.4

PING 24.1.1.4: 56 data bytes, press CTRL_C to break

Reply from 24.1.1.4: bytes=56 Sequence=1 ttl=254 time=60 ms

Reply from 24.1.1.4: bytes=56 Sequence=2 ttl=254 time=90 ms

Reply from 24.1.1.4: bytes=56 Sequence=3 ttl=254 time=60 ms

Reply from 24.1.1.4: bytes=56 Sequence=4 ttl=254 time=80 ms

Reply from 24.1.1.4: bytes=56 Sequence=5 ttl=254 time=80 ms

--- 24.1.1.4 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 60/74/90 ms

Through testing, we can see that although the default route simplifies the configuration, it does not affect access, so you can consider using the default route if you encounter similar topologies in the future.

Guess you like

Origin blog.csdn.net/yuyeconglong/article/details/133214504