Basic BGP for JunOS

By | April 26, 2012
Warning: Trying to access array offset on value of type null in /customers/3/0/4/robug.net/httpd.www/blog/wp-content/plugins/twitter-facebook-google-plusone-share/tf_display.php on line 72

This is how to set up BGP on Juniper. We will setup BGP using the following Diagram.

First we need to set the interface IP address.

[edit]
root# edit interfaces em0

[edit interfaces em0]
root# edit unit 0

[edit interfaces em0 unit 0]
root# edit family inet

[edit interfaces em0 unit 0 family inet]
root# set address 192.168.1.1/24

And we do the same on R2 and we commit the changes we have made.

[edit interfaces em0 unit 0 family inet]
root# top

[edit]
root# commit and-quit
commit complete
Exiting configuration mode

root>

Once we have committed these changes we can verifiy these changes using “show interfaces terse”

Now to start the setup of BGP. First we define our AS number (witch is AS 100).

[edit]
root# set routing-options autonomous-system 100

Now we have defined our AS number we need to set up the iBGP neighbor

[edit]
root# edit protocols bgp

[edit protocols bgp]
root# edit group iBGP

[edit protocols bgp group iBGP]
root# set peer-as 100

[edit protocols bgp group iBGP]
root# set neighbor 192.168.1.1

[edit protocols bgp group iBGP]
root# set type internal

We once again need to commit this change for it to take effect

[edit protocols bgp group iBGP]
root# top

[edit]
root# commit

Now it time for us to do some verification using the “show bpg summary” command

We can see we have 1 neighbor. Now its time to confiugre eBGP. We do this as below.

[edit]
root# edit protocols bgp

[edit protocols bgp]
root# edit group eBGP

[edit protocols bgp group eBGP]
root# set peer-as 200

[edit protocols bgp group eBGP]
root# set neighbor 172.16.1.2

[edit protocols bgp group eBGP]
root# set type external

Now we have configured the external neighbor we need to commit this change. Now we need to see if our neighbor is up. We do this using “show bgp summary”.

We have successfully configured BGP on JunOS.