Sunday, December 2, 2018

Juniper - BGP implementation


  1. iBGP between vMX-1 and vMX-2
    • Static route
    • IGP (ospf)
  2. eBGP between vMX-1 and vMX-3



iBGP with Static route

1. Interface configuration

root@vMX-1> show configuration interfaces | display set       
set interfaces ge-0/0/0 unit 0 family inet address 10.1.12.1/24
set interfaces lo0 unit 0 family inet address 1.1.1.1/32

2. Routing configuration

root@vMX-1> show configuration routing-options | display set
set routing-options static route 2.2.2.2/32 next-hop 10.1.12.2      < -- Static route
set routing-options autonomous-system 65000                             < -- BGP AS

3. BGP neighbor configuration

root@vMX-1> show configuration protocols | display set                      
set protocols bgp group iBGP type internal
set protocols bgp group iBGP neighbor 2.2.2.2 local-address 1.1.1.1

local-address command is used to specify that iBGP messages should be sourced from the loopback address.
Cisco IOS command no auto-summary is not required. Junos doesn't have the concept of classful or classless networking. CIDR is used exclusively. 

Verification:

root@vMX-1> show bgp neighbor 2.2.2.2 | match Established 
  Type: Internal    State: Established    Flags: <Sync>

root@vMX-1> show route 

inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[Direct/0] 00:46:28
                    > via lo0.0
2.2.2.2/32         *[Static/5] 00:44:45
                    > to 10.1.12.2 via ge-0/0/0.0
10.1.12.0/24       *[Direct/0] 00:46:28
                    > via ge-0/0/0.0
10.1.12.1/32       *[Local/0] 00:46:28
                      Local via ge-0/0/0.0

iBGP with IGP (OSPF)

Routing configuration:

root@vMX-1> show configuration protocols ospf | display set 
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive

Verification:

root@vMX-1> show ospf neighbor 
Address          Interface              State     ID               Pri  Dead
10.1.12.2        ge-0/0/0.0             Full      2.2.2.2          128    32

root@vMX-1> show bgp summary 
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
2.2.2.2               65000          7          6       0       1        2:27 0/0/0/0              0/0/0/0


eBGP

vMX-1

root@vMX-1> show configuration protocols bgp | display set 
set protocols bgp group iBGP type internal
set protocols bgp group iBGP neighbor 2.2.2.2 local-address 1.1.1.1
set protocols bgp group eBGP type external
set protocols bgp group eBGP neighbor 10.1.13.3 peer-as 65001

vMX-3

root@vMX-3> show configuration protocols bgp | display set 
set protocols bgp group eBGP type external
set protocols bgp group eBGP neighbor 10.1.13.1 peer-as 65000

Next, need to create export policy to advertise loopback address

1. Policy creation:

set policy-options policy-statement EBGP_ADV_LOOPBACK term ADV_LO0 from protocol direct
set policy-options policy-statement EBGP_ADV_LOOPBACK term ADV_LO0 from route-filter 1.1.1.1/32 exact
set policy-options policy-statement EBGP_ADV_LOOPBACK term ADV_LO0 then accept

2. Applying the policy to BGP:

set protocols bgp group eBGP neighbor 10.1.13.3 export EBGP_ADV_LOOPBACK

Verification: 

root@vMX-1> show route protocol bgp 

inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

3.3.3.3/32         *[BGP/170] 00:03:13, localpref 100
                      AS path: 65001 I, validation-state: unverified
                    > to 10.1.13.3 via ge-0/0/1.0

root@vMX-1> show route receive-protocol bgp 10.1.13.3 

inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 3.3.3.3/32              10.1.13.3                               65001 I

inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

No comments:

Post a Comment

Paloalto - Auto commit failure after upgrade

Issue: Auto commit was keep failing after upgrade Error logs admin@paloalto> show jobs all Enqueued              Dequeued           ID  ...