O'Reilly logo

JUNOS Cookbook by Aviva Garrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.1. Configuring a BGP Session Between Routers in Two ASs

Problem

You want to configure BGP on the border routers that connect the two different ASs.

Solution

Configure the autonomous system number and router ID on each router:

	[edit routing-options]
	aviva@RouterF# set autonomous-system 65500
	aviva@RouterF# set router-id 192.168.16.1

Then configure an EBGP session to the border router in the other AS:

	[edit protocols bgp]
	aviva@RouterF# set group session-to-AS65505 type external
	aviva@RouterF# set group session-to-AS65505 peer-as 65505
	aviva@RouterF# set group session-to-AS65505 neighbor 10.0.31.1
	[edit protocols]
	aviva@RouterF# show
	bgp {
	    group session-to-AS65505 {
	        type external;
	        peer-as 65505;
	        neighbor 10.0.31.1;
	    }
	}

Discussion

The basic configuration of EBGP is very straightforward, and the configuration of the two EBGP peers is pretty much identical. This recipe shows how to configure a session between the two border routers shown in Figure 13-1.

EBGP network

Figure 13-1. EBGP network

You define the router's AS number and its router ID. You don't configure these in the [edit protocols bgp] hierarchy but rather in the [edit routing-options] hierarchy because these two properties are not specific to BGP and can be used by other routing protocols. BGP includes the 32-bit router ID in Open messages when establishing a BGP connection. If you don't manually set the router ID, the JUNOS software uses ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required