< Home

Configuring BGP to Import Routes

Context

BGP cannot discover routes and needs to import routes such as IGP routes into BGP routing tables so that the imported routes can be transmitted within an AS or between ASs. BGP imports routes in either import or network mode:

  • In import mode, BGP imports IGP routes, including RIP, OSPF, and IS-IS routes, into BGP routing tables based on protocol type. To ensure the validity of imported IGP routes, BGP can also import static routes and direct routes in import mode.

  • In network mode, BGP imports the routes in the IP routing table one by one into BGP routing tables. The network mode is more accurate than the import mode.

Procedure

  • In import mode
    1. Run system-view

      The system view is displayed.

    2. Run bgp { as-number-plain | as-number-dot }

      The BGP view is displayed.

    3. Enter the corresponding address family view based on network type to configure BGP devices on networks.

      • Run ipv4-family { unicast | multicast }

        The IPv4 address family view is displayed.

      • Run ipv6-family [ unicast ]

        The IPv6 address family view is displayed.

    4. Run import-route protocol [ process-id ] [ med med | route-policy route-policy-name ] *

      BGP is configured to import routes of other routing protocols.

    5. (Optional) Run default-route imported

      BGP is allowed to import default routes from the local IP routing table.

      To import default routes, you need to run both the default-route imported command and the import-route (BGP) command. If only the import-route (BGP) command is used, default routes cannot be imported. In addition, the default-route imported command is used to import only the default routes that exist in the local routing table.

      By default, BGP does not add default routes to BGP routing tables.

  • In network mode
    1. Run system-view

      The system view is displayed.

    2. Run bgp { as-number-plain | as-number-dot }

      The BGP view is displayed.

    3. Enter the corresponding address family view based on network type to configure BGP devices on networks.

      • Run ipv4-family { unicast | multicast }

        The IPv4 address family view is displayed.

      • Run ipv6-family [ unicast ]

        The IPv6 address family view is displayed.

    4. Run network ipv4-address [ mask | mask-length ] [ route-policy route-policy-name ]

      Or run network ipv6-address prefix-length [ route-policy route-policy-name ]

      BGP is configured to import routes from the IPv4 or IPv6 routing table one by one.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >