Explore the behavior and automatic deletion of several static routes

Source: Internet
Author: User

[Experiment topology]

[Experiment description]

If the interface information is left blank, simply write the initial static route between the routes. The purpose of R3 is to test whether the f0/0 interface of R1 is Down but the next hop 12.12.12.2 is reachable at the same time.

R1:

Ip route 12.12.0 255.255.255.0 13.13.13.3

R2:

Ip route 12.12.0 255.255.255.0 23.23.23.3

R3:

Ip route 0.0.0.0 0.0.0.0 23.23.23.2
Ip route 12.12.1 255.255.255.255 13.13.13.1

The next step is to set various static routes on R1 so that they can be reached with 2.2.2.2.

Lab procedure]

1. Configure static routes only in the next hop Mode

Ip route 2.2.2.0 255.255.255.0 12.12.12.2

Router behavior:

1. R1 matches the route entry 2.2.2.0/24 and finds that the next hop address is 12.12.12.2.
2. R1 recursively searches for the route table until it finds the outbound interface. In this example, you only need to perform recursive search once to find that the outbound interface of 12.12.2 in the direct connection route is f0/0.
3. the outbound interface f0/0 of R1 sends an ARP broadcast to look for the MAC address of 12.12.2. After receiving the ARP, R2 returns the interface connected to R1 to R1, r1 caches the ARP to the ARP Cache. The next hop address is 12.12.12.12. Therefore, you can directly read the target MAC address from the ARP cache.
4. R1 sends data packets from interfaces f0/0.
5. In the final ARP cache, only entries of 12.12.12.2 exist.

Local interface Down: if the next hop is reachable, the route entry does not disappear. If the next hop is not reachable, the route entry disappears. However, if all the interfaces are Down, non-directly connected network interfaces are UP, causing the next hop to be reachable (that is, 12.12.12.2 is not connected through the directly connected network, as in this example, R1-> R3-> R2 ), route entries cannot be restored!

Lab steps (all connected at first ):

Shutdown f0/0: Observe that route entries do not disappear

Shutdown f1/0

No shutdown f1/0 observe that route entries are not restored

No shutdown f0/0 observe route entry recovery

2. Only use the outbound interface to configure static routes

Ip route 2.2.2.0 255.255.255.255.0 f0/0

Router behavior:
1. R1 matches the route entry 2.2.2.0/24 and directly finds the outbound interface f0/0 without recursive query.
2. R1's outbound interface f0/0 sends ARP broadcasts outward to find the MAC address 2.2.2.2
3. vror2 R2 receives the ARP. Because Proxy-ARP is enabled by default, R2 searches for 2.2.2.2 entries in its route table, if the IP address is found, send ARP broadcasts to the interfaces below to find the MAC address 2.2.2.2.
4. R2 returns the MAC address 2.2.2.2 (that is, the MAC address of the interface connected to R1) to R1, and R1 caches the ARP to the ARP Cache. It can be seen that when R2 has a large number of subsequent hosts, R1 will send a large number of ARP requests and generate a large number of ARP entries in the ARP cache.
5. R1 sends data packets from interfaces f0/0.
6. Only 2.2.2.2 entries exist in the final ARP cache.

Local interface Down: Route entry disappears

3. Configure static routes using both the outbound interface and the next hop mode, but write the two commands separately.

Ip route 2.2.2.0 255.255.255.0 12.12.12.2
Ip route 2.2.2.0 255.255.255.255.0 f0/0

Router behavior:
1. If CEF is available, load balancing is performed by CEF. If CEF is disabled, load balancing is performed by package. When the CEF is disabled, we can see that the first two packets are disconnected because the MAC addresses of the two ARP requests are different.
2. the router behavior under Server Load balancer is the same as the above two types. Just do it twice.
3. In the final ARP cache, entries of 12.12.12.2 and 2.2.2.2 exist (the effect can be seen only after the CEF is disabled ).

Local interface Down: no matter whether the next hop is reachable, the direct connection route entry (interface configuration) disappears. The next hop route entries are the same.

4. Configure static routes in combination with interfaces and the next hop mode, and configure both the next hop and outbound interfaces in a command

Ip route 2.2.2.0 255.255.255.0 f0/0 12.12.12.2

Router behavior:
1. R1 matches the route entry 2.2.2.0/24 and finds that the next hop address is 12.12.12.2, and no recursive query is required to directly find the outbound interface f0/0.
2. the outbound interface f0/0 of R1 sends an ARP broadcast to look for the MAC address of 12.12.2. After receiving the ARP, R2 returns the interface connected to R1 to R1, r1 caches the ARP to the ARP Cache. Later, packets destined for R2 do not need to send ARP requests. Because the next hop address is 12.12.12.12, the target MAC address can be directly read from the ARP cache.
3. R1 sends data packets from interfaces f0/0.
4. In the final ARP cache, only entries of 12.12.12.2 exist.

Local interface Down: Route entries disappear even if the next hop is reachable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.