JunOS BGP

From ppwiki
Jump to navigation Jump to search

In this Tutorial We will be discussing how to setup an External Border Gateway Protocol (EBGP) between two routers.

Prerequisites

To complete this tutorial, you will need:

  • A laptop running Linux or MacOS. for this tutorial I will be using a laptop running Ubuntu 16
  • A console cable. Since all the new laptops today don't come with a USB port, you will need a USB to Console adapter
  • The program "Screen"

If you don't have "screen" install it with the command below

sudo apt-get install screen

The Goal

File:Bgp1.png

Our goal is to setup the network like in the above image.

We have 2 offices. One in Texas and the other one in San Fransisco. Both offices have a Juniper MX80 router. The Texas router cr1-tx is in AS 17 and the San Fransico router cr1-sfo is in AS 29. We need to setup an External Border Gateway Protocol (EBGP) to connect both offices. If we were to connect 2 router in the same AS, we was going to use an IBGP (Internal Border Gateway Protocol) such as OSPF. We will discuss about this in another tutorial.

Router Setup

We are going to perform the basic setup of the router like we did for the switches in [[JunOS Basics[1]]

The process is the same. Please refer to the link above

  • Access the router
  • Setup the root password
  • Setup the device name
  • Create a privilege user
  • setup Management interface and enable SSH

Note: for the management setup, since we are using a router the management interface on the MX80 is not me0 like on the switch. The management interface is fxp0. See below for the how the management interface is setup.

root@cr1-tx# show interfaces 
fxp0 {
    description mgmt;
    unit 0 {
        family inet {
            address 10.192.0.103/24;
        }
    }
}

After setting up all the basic on both routers, it is time to process to the EBGP setup.

EBGP Setup

On cr1-tx

We are going to use the interface xe-0/0/0 which is a 10Gbs interfaces.

Step 1: Set interface description

set interfaces xe-0/0/0 description to-cr1-sfo
  • Check before committing
root@cr1-tx# show | compare                                        
[edit interfaces]
+   xe-0/0/0 {
+       description to-cr1-sfo;
+   }
  • Commit

Step 2: Assign an IP address to the interface

set interfaces xe-0/0/0 unit 0 family inet address 10.10.10.1/30
  • Check before committing
root@cr1-tx# show | compare 
[edit interfaces xe-0/0/0]
+    unit 0 {
+        family inet {
+            address 10.10.10.1/30;
+        }
+    }
  • Commit

Step 3: Set the Autonomous system (AS) number To set the AS number we need to be in the routing-options level for that type in

edit routing-options 
[edit routing-options]
root@cr1-tx#

On cr1-sfo