Get the App
SLTechnology News&Howtos  ›  Servers  › 

Lab: configuring a static default rout

Shulou Source: shulou.com Published: 2022-06-03 05:25:23 10月05日 Update

The purpose of the experiment is to configure the static default route of the router and make each network terminal communicate with each other.

Idea: 1 manually configure 4 PC IP addresses and gateways

2 configure the IP address of each port of each router in turn

3 configure static default routes on the left and right sides

4 configure static routes for intermediate routers

Specific operations:

1 configure terminal IP address and gateway to skip

2 configure the IP address of the router on the left

Rename the router and configure the interface gig0/0 with an IP address

Router > en

Router#configure terminal

Router (config) # hostname R1

R1 (config) # interface gig0/0

R1 (config-if) # no shut

R1 (config-if) # ip address 192.168.1.254 255.255.255.0

R1 (config-if) # exit

Configure IP address on interface gig0/1

R1R (config) # interface gig0/1

R1 (config-if) # no shut

R1 (config-if) # ip address 192.168.2.254 255.255.255.0

R1 (config-if) # exit

Configure IP address on interface gig0/2

R1 (config) # interface gig0/2

R1 (config-if) # no shut

R1 (config-if) # ip address 192.168.10.1 255.255.255.0

R1 (config-if) # exit

Do the same to configure IP addresses on the other two routers

The middle router name is changed to R2, and the right router name is changed to R3

3 configure a static default route for R1

R1 (config) # ip route 0.0.0.0 0.0.0.0 192.168.10.2 / / access any other network segment through the port with IP address 192.168.10.2 (R2-gig0/1)

Configure static routes for R2

R2 (config) # ip route 192.168.1.0 255.255.255.0 192.168.10.1

R2 (config) # ip route 192.168.2.0 255.255.255.0 192.168.10.1

R2 (config) # ip route 192.168.4.0 255.255.255.0 192.168.20.2

Configure a static default route for R3

R3 (config) # ip route 0.0.0.0 0.0.0.0 192.168.20.1 / / access any other network segment through the port (R2-gig0/2) with the IP address 192.168.20.1.

At this point, you can verify R1 (config) # show ip route by command.

Achieve the purpose of the experiment

Summary: 1 when configuring a static default route, the intermediate router R2 is configured with a specified network segment. Why not configure a default route for R2? Because the default route can only be used at the edge of the network, if a default route is configured on the intermediate router, a loop will be formed and the packet will be lost when sending the message. During the experiment in the cisco simulator, if you configure the default route on R2, you will find that you can PING by using the PING command at the terminal, because the simulator cannot simulate the real environment 100%.

2 the default route at the end of the network can greatly simplify the router configuration without adding the destination network segment one by one. When we do not know the destination network segment, we also use the default route for configuration.

3 default route also has its own disadvantages: for example, it takes longer to reach the target network segment than the general static route, and it will be asked in turn when reaching the target network segment, resulting in a waste of network resources.

Tags: Routing configuration router address static network segment destination lab name pair interface port terminal network command emulator destination gateway no no two Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi OPPO Reno NVidia MySQL Linux