Verify BGP on a Border Router
Purpose
To verify the BGP configuration of a border router.
Action
To verify the BGP configuration of a border router, enter the following Junos OS CLI operational mode command:
Sample Output
The following sample output is for a BGP configuration on two border routers from AS 65002 (R2 and R4 as shown in Verify the BGP Protocol):
user@R2> show configuration [...Output truncated...] interfaces { so-0/0/0 { unit 0 { family inet { address 10.1.12.2/30; } family iso; } } so-0/0/1 { unit 0 { family inet { address 10.1.23.1/30; } family iso; } } so-0/0/3 { unit 0 { family inet { address 10.1.24.1/30; } family iso; } } lo0 { unit 0 { family inet { address 10.0.0.2/32; } family iso { address 49.0002.1000.0000.0002.00; } } } } routing-options { [...Output truncated...] router-id 10.0.0.2; autonomous-system 65002; } protocols { bgp { group internal { type internal; export next-hop-self; neighbor 10.0.0.3; neighbor 10.0.0.4; neighbor 10.0.0.6; } group toR1 { type external; import import-toR1; peer-as 65001; neighbor 10.1.12.1; } } isis { level 1 disable; interface all { level 2 metric 10; } interface lo0.0; } } policy-options { policy-statement next-hop-self { term change-next-hop { from neighbor 10.1.12.1; then { next-hop self; } } } policy-statement import-toR1 { term 1 { from { route-filter 100.100.1.0/24 exact; } then { local-preference 200; } } } user@R4> show configuration [...Output truncated...] interfaces { so-0/0/1 { unit 0 { family inet { address 10.1.46.1/30; } family iso; } } so-0/0/2 { unit 0 { family inet { address 10.1.45.1/30; } family iso; } } so-0/0/3 { unit 0 { family inet { address 10.1.24.2/30; } family iso; } } lo0 { unit 0 { family inet { address 10.0.0.4/32; } family iso { address 49.0001.1000.0000.0004.00; } } } } routing-options { [...Output truncated...] router-id 10.0.0.4; autonomous-system 65002; } protocols { bgp { group internal { type internal; local-address 10.0.0.4; export next-hop-self; neighbor 10.0.0.2; neighbor 10.0.0.3; neighbor 10.0.0.6; } group toR5 { type external; peer-as 65001; neighbor 10.1.45.2; } } isis { level 1 disable; interface all { level 2 metric 10; } interface lo0.0; } } policy-options { policy-statement next-hop-self { term change-next-hop { from neighbor 10.1.45.2; then { next-hop self; } } }
Meaning
The sample output shows a basic BGP configuration on border routers R2 and R4. Both routers have the AS (65002) included at the [routing-options] hierarchy level. Each router has two groups included at the [protocols bgp group group] hierarchy level. External peers are included in the external group, either toR1 or toR5, depending on the router. Internal peers are included in the internal group. The underlying IGP protocol is IS-IS on both routers, and relevant interfaces are configured to run IS-IS.
Note that in the configuration on both routers, the router ID is manually configured to avoid duplicate router ID problems, and the next-hop-self statement is included to avoid any BGP next-hop reachability problems.