At present, the market demand for Huawei routers is still very high, and its brand effect is very strong. Here we mainly introduce Virtual interfaces commonly used in Huawei routers, including the usage of NULL interfaces. Generally, when you run the show running command on a Huawei router to view the configuration, you will find various types of interfaces in the configuration, such as ethernet, ATM, Serial, and POS, 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 is another completely different interface type in the Huawei router, such as loopback, null, tunnel, and virtual-template.
Loopback interface usage
This type of interface is the most widely used virtual interface, which is used on almost every Huawei router. It is commonly used for the following purposes. As the management address of a Huawei router, after the system administrator completes the network planning, a loopback interface is created for each Huawei router for convenient management, and specify an IP address as the management address on this interface. The Administrator will use this address to remotely log on to the vrotelnet for telnet). This address actually serves a function similar to a device name.
However, there are usually many interfaces and addresses on each Huawei router. 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 Huawei router 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, a Router id must be specified for the Protocol, which is the unique identifier of the Huawei Router and must be unique in the entire autonomous system. The router id is a 32-bit unsigned integer, which is very similar to the IP address. In addition, the IP address does not repeat, so the router id of the Huawei router is usually designated as the address of an interface on the device. Because the IP address of the loopback interface is generally regarded as the identifier of the Huawei router, it becomes the best choice for the router id.
NULL Interface Usage
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. The Huawei 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 such interfaces independently. However, if you direct the next hop of the configured static route to a NULL interface, it will be very useful 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 Huawei router table does not exist, use the command: ip route ip-address mask null0.
Configure such a false static route to "please" BGP. The link between the RTC and the RTD is interrupted due to a fault. Therefore, there is no route pointing to the RTC from 10.1.3.0/24 on the RTD. In this case, if a user under RTA sends a packet whose destination address is 10.1.3.1, RTA sends the packet to RTD because there is no route to 10.1.3.0/24 on the RTD, select the default route and send the packet to RTE. After querying the route table of RTE, it finds that the route matches 10.1.0.0/16, and then sends the packet to RTD. Similarly, RTD sends packets to RTE again. In this case, the self-loop routing is generated on RTD and RTE. The best solution to the above problem is to configure a black hole route on RTD: ip route 10.1.0.0 255.255.0.0 NULL 0. In this way, if the above problem occurs again, RTD will find the route table, and send the packet to the NULL0 interface is actually discarding this packet), so as to avoid loop generation.