Usage Scenario
BGP itself cannot discover routes. Instead, it imports routes discovered by other protocols (such as an IGP or static routes) to the BGP routing table. These imported routes then are transmitted within an AS or between ASs. Before adding routes to the BGP routing table, BGP can filter them based on the routing protocol. Alternatively, if routes in the local routing table need to be manually added to the BGP routing table and then advertised, you can use the network command.
The Origin attribute of the routes imported to the BGP routing table using the
network command is IGP.
If a route with a specific prefix or mask is added to the BGP routing table using the
network command, this route is the optimal route selected from all types of protocol routes. Unlike the
network command, the
import-route command is used to add all routes of a specified protocol, such as RIP, OSPF, IS-IS, static routes, or direct routes to the BGP routing table.
Precautions
The network command imports the routes in the local routing table that exactly match the specified destination address and prefix length to the BGP routing table. If mask is not specified, routes are matched against the natural network mask.
When using the
undo network command to delete the existing configuration, specify a correct mask.
The network route-policy route-policy-name command is mutually exclusive with the network route-filter route-filter-name command.