1.
enable
2.
configure
terminal
3.
router
bgp
autonomous-system-number
4.
neighbor
{ip-address |
peer-group-name}
remote-as
autonomous-system-number
5.
address-family
ipv4
[unicast |
multicast |
vrf
vrf-name]
6.
network
network-number
[mask
network-mask] [route-map
route-map-name]
7.
neighbor
{ip-address |
peer-group-name}
route-map
map-name {in |
out}
8.
Repeat Step 7 to apply another route map to the neighbor specified in Step 7.
9.
exit
10.
neighbor
{ip-address |
peer-group-name}
remote-as
autonomous-system-number
11.
address-family
ipv4
[unicast |
multicast |
vrf
vrf-name]
12.
neighbor
{ip-address |
peer-group-name}
route-map
map-name {in |
out}
13.
Repeat Step 10 to apply another route map to the neighbor specified in Step 10.
14.
exit
15.
exit
16.
ip
route
prefix
mask
{ip-address |
interface-type
interface-number [ip-address]} [distance] [name] [permanent |
track
number] [tag
tag]
17.
Repeat Step 14 to establish another static route.
18.
route-map
map-name
[permit |
deny] [sequence-number]
19.
set
metric
value
20.
exit
21.
route-map
map-name
[permit |
deny] [sequence-number]
22.
set
metric
value
23.
exit
24.
route-map
map-name
[permit |
deny] [sequence-number]
25.
end
26.
show
ip
route
[ip-address] [mask] [longer-prefixes]
27.
show
ip
bgp
[network] [network-mask]
Examples
The following example shows output from the
show
ip
route command entered at Router E after this task has been configured and Router B and Router D have received update information containing the MED metric. Note that the gateway of last resort is set as 192.168.3.1, which is the route to Router B.
Router# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.3.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
C 10.2.2.0 is directly connected, Ethernet0/0
C 192.168.2.0/24 is directly connected, Serial3/0
C 192.168.3.0/24 is directly connected, Serial2/0
S* 0.0.0.0/0 [40/0] via 192.168.3.1
The following example shows output from the
show
ip
bgp command entered at Router E after this task has been configured and Router B and Router D have received routing updates. The route map BLOCK has denied all routes coming in from autonomous system 45000 so the only network shown is the local network.
Router# show ip bgp
BGP table version is 2, local router ID is 10.2.2.99
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.2.2.0/24 0.0.0.0 0 32768 i
The following example shows output from the
show
ip
bgp command entered at Router B after this task has been configured at Router E and Router B has received routing updates. Note the metric of 50 for network 10.2.2.0.
Router# show ip bgp
BGP table version is 7, local router ID is 172.17.1.99
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/24 192.168.1.2 0 0 40000 i
*> 10.2.2.0/24 192.168.3.2 50 0 50000 i
*> 172.16.1.0/24 0.0.0.0 0 32768 i
*> 172.17.1.0/24 0.0.0.0 0 32768 i
The following example shows output from the
show
ip
bgp command entered at Router D after this task has been configured at Router E and Router D has received routing updates. Note the metric of 100 for network 10.2.2.0.
Router# show ip bgp
BGP table version is 3, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.2.2.0/24 192.168.2.2 100 0 50000 i
*> 172.16.1.0/24 0.0.0.0 0 32768 i