Static routing and comprehensive experiment

1. The role of the router:
1. Interconnection between different networks
2. Choosing the path for the data it carries—Routing
When a data packet enters the router, the router will base on the destination IP address in the data; query the local routing table ;
If there is a record in the table, it will be forwarded according to the record unconditionally; if there is no record, the traffic will be discarded;
TTL: the lifetime of the data packet with the default generation time; the default value = 64 128 255
TTL value is reduced by 1 after passing through each router; When 0, the data packet will be discarded;
related commands: display ip routing-table view routing table The
default routing table only has routes directly connected to the network segment; the conditions for direct connection—the interface has an ip address, and the interface is dual-up. The
default router is One network segment is used as the routing target record;
all non-directly connected network segments are routed as unknown network segments—methods to obtain unknown network segments:
1. Static routing—administrator handwriting
2. Dynamic routing—after interactive communication between routers, self-learning and
static calculation Route:
[r1] ip route-static 192.168.3.0 24 192.168.2.2
192.168.3.0 is the target network number 192.168.2.2 Next hop
Next hop: After traffic departs from the local, the next router interface ip address that enters;
2. Extended configuration of static routing
1) Load balancing — When the same router accesses the same target and has multiple paths with similar costs, the device can split the traffic and delay multiple paths for simultaneous transmission;

2) The loopback interface PC has the loopback network card address 127.0.0.1 by default. It is used to test the TCP/IP protocol for routing
[r2] interface LoopBack?
<0-1023> LoopBack interface number
[r2-LoopBack0] ip address 1.1.1.1 24
because In the experimental environment, it is necessary to save equipment resources, so the loopback interface can be used to imitate the interface connecting the PC user;

3) Summarized route When the router visits multiple consecutive subnets, if all are based on the same next hop; then these target network segments can be summarized and calculated, and only the route to the summarized network segment can be edited; the routing table is reduced The number of entries;

4) Routing black hole-the summarized address contains the network segment that does not actually exist in the network, which will cause the flow to go and not return; it
wastes link resources; it can be avoided as much as possible through accurate address planning and summary;

5) Default route (default route)-a route that does not limit the destination; when the router queries the routing table, after checking all the local direct, static, and dynamic routing entries; use this entry if there is still no reachable path;
[r1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2

6) When an empty interface routing black hole meets the default route, a loop will inevitably occur.
You can configure an empty interface route to the summary network segment on the black hole router to prevent the loop
route from generating router matching routing entries based on the longest matching rule; Match the most accurate subnet mask;
[r1]ip route-static 1.1.0.0 22 NULL 0

7) Floating static route-By modifying the default priority of static route, it can play a role of path backup. The
default priority of static route entry is 60; the priority is 0-255, the smaller the value, the better;
[r1]ip route-static 1.1 .1.0 24 13.1.1.2 preference 61
Third, static routing comprehensive experiment
experiment related requirements;
Insert picture description here

1. Set up the experimental topology
Insert picture description here
2. Divide the IP address and perform the IP sum (see the figure below)
Insert picture description here
3. Create a loopback interface
4. Configure an IP address for the router
5. Connect to the entire network (the next hop of the target network number mask)
6. Write the default route
7. Write the floating static route
8. The entire network is reachable
Insert picture description here

Guess you like

Origin blog.csdn.net/m0_53067332/article/details/110848989