huawei route preferences

Download as PDF

Routing protocols are used to discover routes to a destination. Only one routing protocol at one time determines the optimal route to a destination.

What happens if we have different routes to the same destination learnt by different routing protocols?

When multiple routing information sources coexist on the same router, the router with the highest preference is selected as the optimal route.

Below you can find the default route preferences by each routing protocol (the smaller the value, the higher the preference is):

huawei default route preferences

Of course you can change these default values manually.

But what happens if different routing protocols are configured with the same preference?

Huawei routers define external and internal preferences. Default external preferences are showed in the above table and can be set manually by users, whereas internal preferences are fixed and cannot be changed. For example, two routes, static and OSPF, which have the same route preference 5, set by command, can reach the destination 2.2.2.2/32. According to the internal preferences listed below, route discovered by OSPF will be selected as an optimal route:

interface Ethernet0/0/0
undo shutdown
ip address 10.0.0.1 255.255.255.252
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ip route-static 2.2.2.2 255.255.255.255 10.0.0.2 preference 5
#
ospf 1
preference 5
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.0.0.0 0.0.0.3
[labnario]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 6 Routes : 6Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.2/32 OSPF 5 1 D 10.0.0.2 Ethernet0/0/0
10.0.0.0/30 Direct 0 0 D 10.0.0.1 Ethernet0/0/0
10.0.0.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

huawei interal route preferences

Advertisements

3 thoughts on “huawei route preferences

  1. Nilesh

    Hi Labnario,
    I have configured default route via BGP & static route on Huawei Switch.
    Switch is preferring the BGP route as a default route in normal condition.
    Below is my configuration, can you please explain why it is considering the BGP route as default?
    dis ip rout 0.0.0.0 0.0.0.0 ver
    Route Flags: R – relay, D – download to fib
    ——————————————————————————
    Routing Table : Public
    Summary Count : 2

    Destination: 0.0.0.0/0
    Protocol: BGP Process ID: 0
    Preference: 255 Cost: 0
    NextHop: 1.2.3.4 Neighbour: 1.2.3.4
    State: Active Adv Relied Age: 1d22h45m14s
    Tag: 0 Priority: low
    Label: NULL QoSInfo: 0x0
    IndirectID: 0x20
    RelayNextHop: 0.0.0.0 Interface: Vlanif4000
    TunnelID: 0x0 Flags: RD

    Destination: 0.0.0.0/0
    Protocol: Static Process ID: 0
    Preference: 255 Cost: 0
    NextHop: 5.6.7.8 Neighbour: 0.0.0.0
    State: Inactive Adv Relied Age: 46d04h26m05s
    Tag: 0 Priority: medium
    Label: NULL QoSInfo: 0x0
    IndirectID: 0x80000001
    RelayNextHop: 0.0.0.0 Interface: Vlanif1
    TunnelID: 0x0 Flags: R
    dis curr | in 0.0.0.0
    ip route-static 0.0.0.0 0.0.0.0 5.6.7.8 preference 255

    Reply
  2. labnario Post author

    Could you please send BGP configuration, display ip routing and display bgp routing to me? If you can please send the whole configuration of the switch.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s