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.
In most cases, the routes imported by BGP can recurse to tunnels. However, in some other cases, if the routes imported by BGP recurse to tunnels, a problem will occur. For example, in a seamless MPLS scenario, if the egress protection function is configured on egress MASGs between which a tunnel exists and a route imported by BGP on one of the MASGs recurses to the tunnel, this MASG then recurses the route to another tunnel of a different type. In this case, traffic is directed to the other MASG, which slows down traffic switchover. As a result, the egress protection function does not take effect. To address this problem, specify non-relay-tunnel to prevent the routes imported by BGP from recursing to tunnels.
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.