Introduction to loopback addresses

Source: Internet
Author: User
Tags block ip address

1. To identify and manage network devices (such as routers and PCs), we usually use interfaces of these devices (including physical interfaces and logical interfaces: for example, vlan. However, although the device is not out of the network, the device cannot be managed because the interface status of the management address is down (because the physical connection is disconnected, the API Protocol cannot start ). To solve this problem, the loopback interface appears, which is a logical interface on the device, and the interface status is not affected by the physical port up/down, the interface will not be down as long as the system protocol of the device is not faulty. By the way, although the layer-3 vlan is also a logical interface, the vlan we usually use is a port, and the core layer switch vlan is generally associated with only one port, when the port is down, the vlan interface cannot be up. From www.2cto.com, we can see that the loopback interface address is undoubtedly the best choice for marking the physical device itself, because as long as the device runs normally, it will always be in the up state. 2. The loopback address and www.2cto.com loopback address are the addresses set on the loopback interface. This address is used to identify the device. Class a cidr Block 127.0.0.0 is used as the local loopback address. Generally, all devices use 127.0.0.1 by default. Of course, you can also set A public IP address on the loopback interface as the device identification for the whole network. When a device sends a packet to itself, the packet is sent to its loopback interface (in fact, directly sent to the cpu for processing ). But if the destination IP address is not its loopback address, how does it know that the destination IP address of the packet is its own IP address? In this case, you need to perform a loop route to identify the problem. Generally, the IP addresses on the pc nic and the management ip addresses of some low-end network devices point to the loopback interface by default, but many high-end devices need to manually set the loopback route. For example, if one of the interfaces of A vro is 61.175.201.54, the loopback route should be set to 61.175.201.54/32 127.0.0.1 to indicate that the address is on its own interface. 3. For example, for a pc, the NIC of the pc is equivalent to an interface of the router. If the IP address set on a pc Nic is 220.172.115.50, the Protocol status is up when the NIC is connected normally. Enter ipconfig in the doscommand line status to view the IP address on the NIC. Ping the NIC address on the host as follows: the host sends an icmp packet with the destination address 220.172.115.50 and sends a response to the host; the host points to its loopback interface in the next hop of the destination address of the data packet found by the default loopback host route (the host does not know the address in advance on its Nic ), the host then sends the packet to its loopback interface (that is, directly to the cpu). Then, the host receives the ping packet with the source IP address 220.172.114.50, and then answers the packet, the response packet is also returned based on the original route. From this process, we can see that both the origin and the receiving point of the data packet are in the same interface (that is, the loopback interface of the host). The addressing process is a loop process, therefore, this interface is called a "loop interface ". When the network adapter is disconnected and the Protocol is down, you can use ipconfig to find "media disconnected" and other prompts. No IP address is displayed. Ping 220.172.115.50 and a prompt such as "destination unreachable" appears. (because the NIC protocol is not up, the host cannot find the corresponding route and cannot make a forwarding decision, prompting that the route is inaccessible ). However, all IP addresses in the 127.0.0.0/8 CIDR block can be pinged at this time. Generally, the pc uses the 127.0.0.0/8 CIDR Block IP address as the loopback address by default, when the host finds that the destination address of the packet is its own loopback address, the packet is sent directly to its cpu. From this we can see that the ping loop return address does not mean that the network card address can be pinged. Therefore, do not ping 127.0.0.1 to check whether the network card is good or bad. This will not work. Next let's take a look at the router example. For example, routers0/1 is directly connected to routerB interface s0/2, routers0/1 is 202.56.112.11, and routerB s0/2 is 202.56.112.12, neither of the two routers has an interface loop routing. In this case, the IP address of the interface s0/1 can be pinged on the routerinterface, but tracert 202.56.112.11 finds that the packet is not directly sent to the routerinterface, but is sent back to the routerinterface through routerB. I was surprised when I first encountered this situation, but after I understood the concept of loop back, this doubt would naturally be solved. Next, let's take a look at the packet addressing process: first, the router (cisco2600 or above) does not have a loopback route with the default Interface address, and the two routers have no manual settings. Therefore, when routeside sends an icmp ping packet whose destination address is s0/1, routeside does not find a host route entry pointing to the loopback interface (the host route entry has a higher priority than the network route entry ), therefore, the data packet is forwarded to routerB based on the direct connection route. After receiving the data packet, routerB also forwards the data packet to the routeworker based on the direct connection route. After receiving the ping packet, routemanager responds, returns the original path of the response package. As a result, there is an interesting phenomenon: the delay of routerping itself is much longer than that of routerB. Therefore, many devices have manually configured local loopback routes to reduce unnecessary troubles.
 

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.