Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

One of the experimental designs and troubleshooting: static routing

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

First, understand routing protocols

Routing Protocol (Routing Protocol): used for routers to dynamically find the best path to the network to ensure that all routers have the same routing table. General routing protocols determine the path of packets on the network. Examples of such protocols are OSPF, RIP, IGRP, EIGRP, and so on.

Routable Protocol (Routed Protocol): when all routers know the topology of the entire network, the routable protocol can be used to send data. Generally routable protocols are assigned to interfaces to determine how packets are delivered. Such examples are IP and IPX static routes.

Routing refers to sending a packet from one device to another device in a different network, which is done by the router. Routers do not care about hosts, they only care about the state of the network and determine the best path in the network.

Routers can route packets and must know at least the following:

Destination address (Destination Address)

Neighboring routers that can learn the status of the remote network

All routes to the remote network

The best path to the remote network

How to maintain and verify routing information

Static routing (Static Routing)

Static routing refers to providing connectivity to remote networks that are not directly connected to the router. To provide end-to-end connectivity without using a routing protocol, static routes must be configured in both directions. Static routes are manually added to the routing table of the router by the administrator.

Its advantage is that there is no additional CPU burden on the router, save bandwidth, and increase security. The disadvantage is that the network administrator must understand the entire topology of the network; if the network topology changes, the administrator has to manually modify the routing table on all routers; it is not suitable for use in large networks.

Configuration commands for static routes

Ip route network [mask] [address | interface] [distance] [permanent]

Network: is the destination network or destination subnet.

Mask: subnet mask.

Address: the router IP address for the next hop.

Interface: is the name of the interface used to reach the destination network.

Distance: is an optional parameter that specifies the administrative distance

Permanent: is an optional parameter, and the specified route will not be deleted, even if the interface is down.

1. Static routing topology

2. Examples

For example, the original three subsidiaries of a company are Dongguan Shatian, Dongguan Changan and India, of which Dongguan Shatian is the headquarters, all networks are connected and can communicate normally. Now, due to business needs, another small company is acquired as an office and connected to the headquarters network. the problem now is that the office cannot communicate with headquarters and subsidiaries outside the headquarters (such as the network topology diagram).

3. Topology table

4. Analysis and troubleshooting

Since it is a new network node, there is no problem with the network before it is added, but there is a problem after it is added. We can initially judge that there are no outgoing routes on the R4 router. Let's take a look at its routing table:

R4#show ip route

Codes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP

D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area

N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2

E1-OSPF external type 1, E2-OSPF external type 2, E-EGP

I-IS-IS, L1-IS-IS level-1, L2-IS-IS level-2, ia-IS-IS inter area

*-candidate default, U-per-user static route, o-ODR

P-periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks

C 10.2.0.0/16 is directlyconnected, FastEthernet0/1

S 10.5.0.0/16 [1/0] via 10.2.0.2

S 10.6.0.0/16 [1/0] via 10.2.0.2

C 10.13.0.0/22 is directly connected, FastEthernet0/0

If the red part already has a route to R2 and R3, and there is also a line directly connected to the LAN port of R1, you can also ping all the IP addresses of R1, R2, and R3 on R4 (the following ping test).

R4#ping 10.2.0.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to10.2.0.2, timeout is 2 seconds:

!

Success rate is 100 percent (5 Success rate is 5), round-trip min/avg/max = 0 Universe 0 1 ms

R4#ping 10.6.0.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to10.6.0.2, timeout is 2 seconds:

!

Success rate is 100 percent (5amp 5), round-trip min/avg/max = 1-1-2 ms

R4#ping 10.5.0.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to10.5.0.2, timeout is 2 seconds:

!

Success rate is 100 percent (5amp 5), round-trip min/avg/max = 1-5-20 ms

R4#ping 10.2.0.100

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to10.2.0.100, timeout is 2 seconds:

!

Success rate is 100 percent (5 amp 5), round-trip min/avg/max = 0 max 3 15 ms

R4#

Normally, the whole network should be normal, but there is a question here: does R1 know that the network segment of the office exists? So let's first take a look at its routing table as follows:

R1#show ip route

Codes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP

D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area

N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2

E1-OSPF external type 1, E2-OSPF external type 2, E-EGP

I-IS-IS, L1-IS-IS level-1, L2-IS-IS level-2, ia-IS-IS interarea

*-candidate default, U-per-user static route, o-ODR

P-periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/16is subnetted, 3 subnets

C 10.2.0.0is directly connected, FastEthernet0/0

S 10.5.0.0 [1/0] via 192.168.10.2

S 10.6.0.0 [1/0] via 192.168.20.2

192.168.10.0/30is subnetted, 1 subnets

C 192.168.10.0is directly connected, Serial0/0

192.168.20.0/30is subnetted, 1 subnets

C 192.168.20.0is directly connected, Serial0/1

R1#

From the routing table of R1, it is not difficult to see that there are also two static routes, pointing to Dongguan Chang'an and India, respectively, but there is no route to R4, that is to say, R4 does not know the existence of the office at all. How about we add a static route to it?

R1 (config) # iproute 10.13.0.0 255.255.0.0 10.2.0.3

R1 (config) # end

R1#

% SYS-5-CONFIG_I:Configured from console by console

R1#show iproute

Codes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP

D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area

N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2

E1-OSPFexternal type 1, E2-OSPFexternal type 2, E-EGP

I-IS-IS, L1-IS-IS level-1, L2-IS-IS level-2, ia-IS-IS inter area

*-candidate default, U-per-userstatic route, o-ODR

P-periodic downloaded static route

Gateway oflast resort is not set

10.0.0.0/16 is subnetted, 4 subnets

C 10.2.0.0 is directly connected,FastEthernet0/0

S 10.5.0.0 [1/0] via 192.168.10.2

S 10.6.0.0 [1/0] via 192.168.20.2

S 10.13.0.0 [1/0] via 10.2.0.3

192.168.10.0/30 is subnetted, 1 subnets

C 192.168.10.0 is directlyconnected, Serial0/0

192.168.20.0/30 is subnetted, 1 subnets

C 192.168.20.0 is directlyconnected, Serial0/1

R1#ping10.13.0.2

Type escapesequence to abort.

Sending 5100-byte ICMP Echos to 10.13.0.2, timeout is 2 seconds:

!

Succe***ate is 100 percent (5 Succe***ate is 5), round-trip min/avg/max = 0 Universe 0 1 ms

R1#ping10.13.0.100

Type escapesequence to abort.

Sending 5100-byte ICMP Echos to 10.13.0.100, timeout is 2 seconds:

!

Succe***ate is 100 percent (5 Succe***ate is 5), round-trip min/avg/max = 0 Universe 0 1 ms

R1#

5. Summary

Two problems should be considered in this example: one is routing forwarding. If a router does not know the existence of a certain network segment, it cannot forward any packets for it. The second is the loop test, for example, a ping command should have an outgoing entry and a return entry before it is completed. Therefore, after solving these two problems, we can naturally solve the problems.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report