How to configure BGP to import routes for S series switches

Background
BGP itself cannot discover routes. Therefore, it needs to import other protocol routes, such as IGP routes, to the BGP routing table. In this manner, these imported routes can be transmitted within an AS or between ASs. BGP imports routes in either of the following ways:

In import mode, BGP imports routes according to protocol types, such as RIP routes, OSPF routes, and IS-IS routes. To ensure validity of imported IGP routes, BGP can also import static routes and direct routes in import mode.

In network mode, BGP imports routes in an IP routing table one by one, making it more precise than the import mode.

Procedure
Import mode:
[HUAWEI] bgp 100
[HUAWEI-bgp] ipv4-family unicast //The IPv4 address family view is displayed. You can also enter other views as required.
[HUAWEI-bgp-af-ipv4] import-rout static //Importing static routes is taken as an example. Importing routes of other protocols is similar.
(Optional) Run the default-route import command to allow BGP to import the default route that already exists in the local IP routing table.
By default, BGP does not add default routes to the BGP routing table.

Network mode:
[HUAWEI] bgp 100
[HUAWEI-bgp] ipv4-family unicast //The IPv4 address family view is displayed. You can also enter other views as required.
[HUAWEI-bgp-af-ipv4] network 192.168.100.0 24 //Advertise routes to network segment 192.168.100.0 24.

Precaution
The network command is used to advertise exactly matched routes. That is, the routes whose destination addresses and prefix lengths exactly match the entries in the local routing table. If the network mask is not specified, routes are exactly matched according to the natural network segment.
When using the undo network command to clear the existing configuration, you need to specify the correct mask.

Scroll to top