Thursday , April 3 2025

how does BGP select routes

When there are multiple routes to the same destination, BGP (Border Getaway Protocol)  on Huawei devices:

  • Prefers the route with the largest PreVal. PrefVal is a Huawei-specific parameter. It is valid only on the device where it is configured.
  • Prefers the route with the highest Local_Pref.
  • Prefers a locally originated route. A locally originated route takes precedence over a route learned from a peer.
  • Prefers the aggregated route. The preference of an aggregated route is higher than a non-aggregated route.
  • Prefers the local route that is manually aggregated. The preference of the local route that is manually aggregated is higher than that of automatically aggregated.
  • Prefers the local route that is imported by using network command. The preference of the route that is imported by using the network command is higher than that imported by  import-route command.
  • Prefers the route with the shortest AS_Path.
  • Compares Origin attributes, and selects routes whose origin types are IGP, EGP, and Incomplete respectively.
  • Prefers the route with the smallest MED.
  • Prefers the routes learned from EBGP. The preference of an EBGP route is higher than an IBGP.
  • Prefers the route of an IGP with the lawest metric in an AS. If load balancing is configured and there are multiple external routes with the same AS_Path, load balancing is performed according to the number of configured routes.
  • Prefers the route with the shortest Cluster_List.
  • Prefers the route with the smallest Originator_ID.
  • Prefers the route advertised by the router with the smallest router ID.
  • Compares IP addresses of its peers, and prefers the route that is learnt from the peer with the smallest IP address.
  • Read More »

    Multiple Spanning Tree Protocol on Huawei switch

    The Multiple Spanning Tree Protocol (MSTP) was originally defined as the IEEE 802.1s standard protocol. Now the standard IEEE 802.1Q-2005 includes MSTP. The basic role of this protocol is to prevent L2 loops. I do not want to explain MSTP in details, as this can be easily found on the Internet. I just want to show you:

    • how to configure this protocol using Huawei CLI
    • how to load balance traffic over redundant links.

    Let’s assume that we have the following physical topology:

    Read More »

    GVRP configuration on Huawei switches

    GVRP stands for GARP VLAN Registration Protocol and is a GARP application that registers and deregisters VLAN attributes. It uses Generic Attribute Registration Protocol (GARP), to maintain and propagate dynamic VLAN registration information, throughout GVRP enabled devices on the network.

    GVRP lets a device to propagate local VLAN registration information to other participant devices, and to dynamically update the VLAN registration information from other devices to its local database, including active VLAN members and through which port they can be reached. All GVRP participants on a bridged LAN maintain the same VLAN registration information. The VLAN registration information includes both manually configured local static entries and dynamic entries from other devices.

    There are 3 different registration modes:

    1. Normal – allows dynamic VLAN registration and deregistration on the trunk port, and allows the declarations for dynamic and static VLANs to be sent.
    2. Fixed – prevents dynamic VLAN registration and deregistration on the trunk port, and allows only the declarations for static VLANs to be sent.
    3. Forbidden – prevents dynamic VLAN registration and deregistration on the trunk port, and allows only the declarations for VLAN 1 to be sent.

    Read More »

    Frame Relay interface on Huawei router

    Let’s assume that we have a Frame Relay topology like in the picture below. We want to have full IP connectivity between our ‘labnario’ routers. To demonstrate, how to configure different types of Frame Relay interface, I will use:

    • physical serial interface on labnario1 router
    • logical point-to-point interface on labnario2 router
    • logical point-to-multipoint interface on labnario3 router.

    Let’s start with labnario1 configuration.

    <labnario1>system-view 
    [labnario1]interface Serial0/0/0
    [labnario1-Serial0/0/0] link-protocol fr
    [labnario1-Serial0/0/0] fr map ip 123.100.1.2 102 broadcast
    [labnario1-Serial0/0/0] fr map ip 123.100.1.3 103 broadcast
    [labnario1-Serial0/0/0] ip address 123.100.1.1 255.255.255.0

    Read More »

    from Huawei CLI – capture-packet …

    Network administrators often need to capture packets, on switches or routers, to locate faults. Some devices do not support remote mirroring, that’s why administrators have to go on-site to capture packets, using local mirroring.

    We have a useful command (capture-packet …), on some devices, to catch packets remotely. When taking S5700 switch into consideration, we can capture all packets from an interface (port mirroring) or packets matching specified rules (traffic mirroring). These capture packets can be sent to FTP or TFTP servers and displayed on terminal screen. CX600 and NE40E routers with V6R3 software version can send capture packets to local CF card (name.cap file).

    Let’s look at this command:

    [Huawei]capture-packet ?
      acl        Acl
      cpu        Packet send to cpu
      interface  Ingress Interface

    As you can see you can use port or traffic mirroring. You can also catch packets sent to CPU.

    [Huawei]capture-packet interface GigabitEthernet 0/0/1 destination ?
      ftp-server   Send to ftp server
      terminal     Output terminal
      tftp-server  Send to tftp server

    Read More »