The network command imports routes to the BGP routing table and advertises them to peers.
The undo network command cancels the configuration.
By default, BGP does not import routes.
Parameter | Description | Value |
---|---|---|
ipv6-address |
Specifies the IPv6 address of a route to be imported by BGP. |
The prefix is in the format of X:X:X:X:X:X:X:X. |
mask-length |
Specifies the mask length of an IP address. If no mask length is specified, the IP address is considered as a classful address. |
The value is an integer ranging from 0 to 128. |
route-policy route-policy-name |
Specifies the name of a route-policy that is used for route import. |
The name is a string of 1 to 200 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
route-filter route-filter-name |
Specifies the name of the route-filter that is used for route import. |
The value is a string of 1 to 200 case-sensitive characters, spaces not supported. If parameters are included in the referenced route-filter, specify values for them in the format of (var1, var2, ...var8) behind the route-filter name. A maximum of eight parameters can be specified, and each value ranges from 1 to 200 characters. |
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.<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv6-family [*HUAWEI-vpn-instance-vpna-af-ipv6] quit [*HUAWEI-vpn-instance-vpna] quit [*HUAWEI] bgp 100 [*HUAWEI-bgp] ipv6-family vpn-instance vpna [*HUAWEI-bgp-6-vpna] network 2001:db8:5::6 64