This article introduces the usage and type of virtual interfaces of Huawei routers in detail, as well as the loopback interface and NULL interface. I hope this article will help you understand virtual interfaces.
1. Virtual Interface Overview
Generally, when you run the show running command in a vro to view the configuration, you will find that there are various types of interfaces in the configuration, such as ethernet, ATM, Serial, POS, etc, these interfaces are one-to-one correspondence with actual physical interfaces. If there are subinterfaces, multiple interface names may correspond to the same physical interface ). However, there are another completely different interface types in the vro, such as loopback, null, tunnel, and virtual-template. These interfaces have the following commonalities:
1. There is no real physical interface corresponding to this interface; although there is sometimes a "ing" relationship;
2. Due to the first reason, such interfaces are not automatically generated based on physical interfaces and must be manually created as needed.
3. the status of an API is always UP, including the physical and Protocol statuses, however, the Protocol status depends on the actual running status.
These interfaces are collectively referred to as "virtual interfaces". Different virtual interfaces have different usage.
2. loopback interface usage
This type of interface is the most widely used virtual interface, which is used on almost every vro. It is commonly used for the following purposes.
As the management address of a vro
After the system administrator completes the network planning, a loopback interface is created for each vro for convenient management, and an IP address is separately specified as the management address on the interface, the Administrator will use this address to remotely log on to the vrotelnet for telnet). This address actually provides a feature similar to a device name.
But there are usually many interfaces and addresses on each vro. Why don't you choose one of them? The reason is as follows: Because the telnet command uses TCP packets, the following situation may occur: A router interface is down due to a fault, but other interfaces can still be telnet, that is, the TCP connection to this vro still exists. Therefore, the selected telnet address must never be down, and the virtual interface meets this requirement. Because this type of interface does not require interconnection with the peer end, the address of the loopback interface is usually specified as a 32-bit mask to save address resources.
Use this interface address as the router id of the Dynamic Routing Protocol OSPF and BGP.
During the operation of the Dynamic Routing Protocol OSPF and BGP, you must specify a Router id for the Protocol, which is the unique identifier of the Router and must be unique within the autonomous system. The router id is a 32-bit unsigned integer, which is very similar to the IP address. In addition, IP addresses do not repeat, so the router's router id is usually specified as the address of an interface on the device. Because the IP address of the loopback interface is generally regarded as the router id, it becomes the best choice for the router id.
3. usage of the NULL Interface
Generally, an IP address is assigned to any interface, but the NULL interface is an exception. You cannot configure an IP address on the NULL interface, and the router will prompt that the configuration is invalid. What can I do with an interface without IP addresses? It does not make sense to use this type of interface independently. However, if you direct the next hop of the configured static route to the NULL interface, it will be of great use.
Used to please BGP
One way to publish a route through the BGP routing protocol is to use the command:
Network ip-address [mask]
However, this command must take effect on the premise that there must be a route in the routing table that is exactly the same as the ip-address mask. Because the BGP Route is published after aggregation, such a routing table does not exist, you need to use the command:
Ip route ip-address mask null0
Configure such a false static route to "please" BGP.
Related configuration commands:
Interface NULL0/* Create null0 interface */
Router bgp 100
Network 118.1.0.0 255.255.0.0/* BGP should publish a route for 118.1.0.0/16 */
Ip route 118.1.0.0 255.255.0.0 NULL 0/* configure a false static route to please BGP */
Run the show ip route command to view the route table information,
Quidway (config) # show ip route
Routing Tables:
Destination/Mask Proto Pre Metric Nexthop Interface
118.1.0.0/16 Static 60 0 0.0.0.0 NULL0