Interaction Between BGP and an IGP
BGP and Interior Gateway Protocols (IGPs) use different routing tables. To enable different ASs to communicate, you need to configure interaction between BGP and IGPs so that BGP routes can be imported into IGP routing tables and IGP routes can also be imported into BGP routing tables.
Importing IGP Routes into BGP Routing Tables
BGP does not discover routes and so needs to import the routes discovered by IGPs into BGP routing tables so that different ASs can communicate. When an AS needs to advertise routes to another AS, an Autonomous System Boundary Router (ASBR) imports IGP routes into its BGP routing table. To better plan the network, you can use routing policies to filter routes and set route attributes when BGP imports IGP routes. Alternatively, you can set the multi-exit discriminator (MED) to help EBGP peers select the best path for traffic entering an AS.
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.
Importing BGP Routes into IGP Routing Tables
When an AS needs to import routes from another AS, an ASBR imports BGP routes into its IGP routing table. To prevent a large number of BGP routes from affecting devices within the AS, IGPs can use routing policies to filter routes and set route attributes when importing BGP routes.