network
Use network to inject a network to the BGP routing table and configure BGP to advertise the network.
Use undo network to remove a local network.
Syntax
In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:
network ipv4-address [ mask-length | mask ] [ route-policy route-policy-name ]
undo network ipv4-address [ mask-length | mask ]
In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:
network ipv6-address prefix-length [ route-policy route-policy-name ]
undo network ipv6-address prefix-length
Default
BGP does not advertise local networks.
Views
BGP IPv4 unicast address family view
BGP-VPN IPv4 unicast address family view
BGP IPv6 unicast address family view
BGP-VPN IPv6 unicast address family view
BGP IPv4 multicast address family view
BGP IPv6 multicast address family view
Predefined user roles
network-admin
Parameters
ipv4-address: Specifies an IPv4 network address. If you do not specify the mask or mask-length argument, natural mask is used.
mask-length: Specifies a mask length in the range of 0 to 32.
mask: Specifies a mask in dotted decimal notation.
ipv6-address: Specifies an IPv6 network address.
prefix-length: Specifies a prefix length in the range of 0 to 128.
route-policy route-policy-name: Specifies a routing policy by its name, a case-sensitive string of 1 to 63 characters, to filter routes or set the route attributes.
Usage guidelines
The network to be injected must be available and active in the local IP routing table.
The ORIGIN attribute of the route injected with the network command is IGP.
When you execute the undo network command, you must specify the same mask or mask length/prefix length that you specified for the network command. Otherwise, the configuration cannot be removed.
Examples
# In BGP IPv4 unicast address family view, inject local network 10.0.0.0/16 to the BGP routing table.
<Sysname> system-view [Sysname] bgp 100 [Sysname-bgp-default] address-family ipv4 unicast [Sysname-bgp-default-ipv4] network 10.0.0.0 255.255.0.0