Published 6月 04, 2018 by with 0 comment

JNCIS-SP Lab: Configuring IBGP and EBGP Network


Requirements:
This lab shows how to configure IBGP and EBGP peer session.

Configuration:
1. Basic & interface address configuration.
set system host-name JNCIE
set system root-authentication encrypted-password "$1$Luohd5lf$6ikSsNi1iEX/147eHbqm7."

set logical-systems R1 interfaces em1 unit 12 vlan-id 12
set logical-systems R1 interfaces em1 unit 12 family inet address 8.8.12.1/24
set logical-systems R1 interfaces lo0 unit 1 family inet address 1.1.1.1/32


set logical-systems R2 interfaces em2 unit 12 vlan-id 12
set logical-systems R2 interfaces em2 unit 12 family inet address 8.8.12.2/24
set logical-systems R2 interfaces em2 unit 23 vlan-id 23
set logical-systems R2 interfaces em2 unit 23 family inet address 8.8.23.2/24
set logical-systems R2 interfaces lo0 unit 2 family inet address 2.2.2.2/32

set logical-systems R3 interfaces em3 unit 23 vlan-id 23
set logical-systems R3 interfaces em3 unit 23 family inet address 8.8.23.3/24
set logical-systems R3 interfaces lo0 unit 3 family inet address 3.3.3.3/32

set interfaces em1 vlan-tagging
set interfaces em2 vlan-tagging
set interfaces em3 vlan-tagging


2. OSPF is configured with the R1 & R2.
set logical-systems R1 protocols ospf area 0.0.0.0 interface em1.12
set logical-systems R1 protocols ospf area 0.0.0.0 interface lo0.1 passive
set logical-systems R1 routing-options router-id 1.1.1.1

set logical-systems R2 protocols ospf area 0.0.0.0 interface em2.12
set logical-systems R2 protocols ospf area 0.0.0.0 interface lo0.2 passive
set logical-systems R2 routing-options router-id 2.2.2.2


3. Check IGP (OSPF) routing.
root@JNCIE> show route logical-system R1       

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

1.1.1.1/32         *[Direct/0] 00:20:35
                    > via lo0.1
2.2.2.2/32         *[OSPF/10] 00:01:22, metric 1
                    > to 8.8.12.2 via em1.12
8.8.12.0/24        *[Direct/0] 00:02:02
                    > via em1.12
8.8.12.1/32        *[Local/0] 00:02:02
                      Local via em1.12
224.0.0.5/32       *[OSPF/10] 00:20:38, metric 1
                      MultiRecv

root@JNCIE>


root@JNCIE> show route logical-system R2   

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

1.1.1.1/32         *[OSPF/10] 00:01:38, metric 1
                    > to 8.8.12.1 via em2.12
2.2.2.2/32         *[Direct/0] 00:20:51
                    > via lo0.2
8.8.12.0/24        *[Direct/0] 00:02:18
                    > via em2.12
8.8.12.2/32        *[Local/0] 00:02:18
                      Local via em2.12
8.8.23.0/24        *[Direct/0] 00:02:18
                    > via em2.23
8.8.23.2/32        *[Local/0] 00:02:18
                      Local via em2.23
224.0.0.5/32       *[OSPF/10] 00:20:54, metric 1
                      MultiRecv

root@JNCIE>


root@JNCIE> show route logical-system R3   

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

3.3.3.3/32         *[Direct/0] 00:21:05
                    > via lo0.3
8.8.23.0/24        *[Direct/0] 00:02:32
                    > via em3.23
8.8.23.3/32        *[Local/0] 00:02:32
                      Local via em3.23

root@JNCIE>


4. Configuring an EBGP Peer Session
R2:
set logical-systems R2 routing-options router-id 2.2.2.2
set logical-systems R2 routing-options autonomous-system 100
set logical-systems R2 protocols bgp group EBGP-200 type external
set logical-systems R2 protocols bgp group EBGP-200 neighbor 8.8.23.3 peer-as 200

R3:
set logical-systems R3 routing-options router-id 3.3.3.3
set logical-systems R3 routing-options autonomous-system 200
set logical-systems R3 protocols bgp group EBGP-100 type external
set logical-systems R3 protocols bgp group EBGP-100 neighbor 8.8.23.2 peer-as 100


5. Configuring an IBGP Peer Session
R1:
set logical-systems R1 routing-options router-id 1.1.1.1
set logical-systems R1 routing-options autonomous-system 100
set logical-systems R1 protocols bgp group IBGP-100 type internal
set logical-systems R1 protocols bgp group IBGP-100 local-address 1.1.1.1
set logical-systems R1 protocols bgp group IBGP-100 peer-as 100
set logical-systems R1 protocols bgp group IBGP-100 neighbor 2.2.2.2

R2:
set logical-systems R2 protocols bgp group IBGP-100 type internal
set logical-systems R2 protocols bgp group IBGP-100 local-address 2.2.2.2
set logical-systems R2 protocols bgp group IBGP-100 peer-as 100
set logical-systems R2 protocols bgp group IBGP-100 neighbor 1.1.1.1


6. Configuring R2 change the Next Hop
R2:
set logical-systems R2 policy-options policy-statement NEXP-HOP term 1 then next-hop self
set logical-systems R2 protocols bgp group IBGP-100 export NEXP-HOP


Verification:
root@JNCIE> show bgp summary logical-system R1   
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                 100         14         15       0       0        5:39 0/0/0/0              0/0/0/0

root@JNCIE>

root@JNCIE> show bgp summary logical-system R2   
Groups: 2 Peers: 2 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...
1.1.1.1                 100         15         15       0       0        5:43 0/0/0/0              0/0/0/0
8.8.23.3                200         14         14       0       0        4:55 0/0/0/0              0/0/0/0

root@JNCIE>

root@JNCIE> show bgp summary logical-system R3   
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...
8.8.23.2                100         46         59       0       3        4:58 0/0/0/0              0/0/0/0

root@JNCIE>


root@JNCIE> show bgp group logical-system R1     
Group Type: Internal    AS: 100                    Local AS: 100
  Name: IBGP-100        Index: 0                   Flags: <>
  Holdtime: 0
  Total peers: 1        Established: 1
  2.2.2.2+179
  inet.0: 0/0/0/0

Groups: 1  Peers: 1    External: 0    Internal: 1    Down peers: 0   Flaps: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0

root@JNCIE>

root@JNCIE> show bgp group logical-system R2   
Group Type: External                               Local AS: 100
  Name: EBGP-200        Index: 0                   Flags: <>
  Holdtime: 0
  Total peers: 1        Established: 1
  8.8.23.3+52475
  inet.0: 0/0/0/0

Group Type: Internal    AS: 100                    Local AS: 100
  Name: IBGP-100        Index: 1                   Flags: <>
  Export: [ NEXP-HOP ]
  Holdtime: 0
  Total peers: 1        Established: 1
  1.1.1.1+63136
  inet.0: 0/0/0/0

Groups: 2  Peers: 2    External: 1    Internal: 1    Down peers: 0   Flaps: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0

root@JNCIE>

root@JNCIE> show bgp group logical-system R3   
Group Type: External                               Local AS: 200
  Name: EBGP-100        Index: 0                   Flags: <>
  Holdtime: 0
  Total peers: 1        Established: 1
  8.8.23.2+179
  inet.0: 0/0/0/0

Groups: 1  Peers: 1    External: 1    Internal: 0    Down peers: 0   Flaps: 3
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 0          0          0          0          0          0

root@JNCIE>


Final configuration:
root@JNCIE> show configuration | display set 
set version 12.1R1.9
set system host-name JNCIE
set system root-authentication encrypted-password "$1$Luohd5lf$6ikSsNi1iEX/147eHbqm7."
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set logical-systems R1 interfaces em1 unit 12 vlan-id 12
set logical-systems R1 interfaces em1 unit 12 family inet address 8.8.12.1/24
set logical-systems R1 interfaces lo0 unit 1 family inet address 1.1.1.1/32
set logical-systems R1 protocols bgp group IBGP-100 type internal
set logical-systems R1 protocols bgp group IBGP-100 local-address 1.1.1.1
set logical-systems R1 protocols bgp group IBGP-100 peer-as 100
set logical-systems R1 protocols bgp group IBGP-100 neighbor 2.2.2.2
set logical-systems R1 protocols ospf area 0.0.0.0 interface em1.12
set logical-systems R1 protocols ospf area 0.0.0.0 interface lo0.1 passive
set logical-systems R1 routing-options router-id 1.1.1.1
set logical-systems R1 routing-options autonomous-system 100
set logical-systems R2 interfaces em2 unit 12 vlan-id 12
set logical-systems R2 interfaces em2 unit 12 family inet address 8.8.12.2/24
set logical-systems R2 interfaces em2 unit 23 vlan-id 23
set logical-systems R2 interfaces em2 unit 23 family inet address 8.8.23.2/24
set logical-systems R2 interfaces lo0 unit 2 family inet address 2.2.2.2/32
set logical-systems R2 protocols bgp group EBGP-200 type external
set logical-systems R2 protocols bgp group EBGP-200 neighbor 8.8.23.3 peer-as 200
set logical-systems R2 protocols bgp group IBGP-100 type internal
set logical-systems R2 protocols bgp group IBGP-100 local-address 2.2.2.2
set logical-systems R2 protocols bgp group IBGP-100 export NEXP-HOP
set logical-systems R2 protocols bgp group IBGP-100 peer-as 100
set logical-systems R2 protocols bgp group IBGP-100 neighbor 1.1.1.1
set logical-systems R2 protocols ospf area 0.0.0.0 interface em2.12
set logical-systems R2 protocols ospf area 0.0.0.0 interface lo0.2 passive
set logical-systems R2 policy-options policy-statement NEXP-HOP term 1 then next-hop self
set logical-systems R2 routing-options router-id 2.2.2.2
set logical-systems R2 routing-options autonomous-system 100
set logical-systems R3 interfaces em3 unit 23 vlan-id 23
set logical-systems R3 interfaces em3 unit 23 family inet address 8.8.23.3/24
set logical-systems R3 interfaces lo0 unit 3 family inet address 3.3.3.3/32
set logical-systems R3 protocols bgp group EBGP-100 type external
set logical-systems R3 protocols bgp group EBGP-100 neighbor 8.8.23.2 peer-as 100
set logical-systems R3 routing-options router-id 3.3.3.3
set logical-systems R3 routing-options autonomous-system 200
set interfaces em1 vlan-tagging        
set interfaces em2 vlan-tagging
set interfaces em3 vlan-tagging

root@JNCIE>   


Reference:
BGP Configuration Guide (JunOS 12.1)
http://www.juniper.net/techpubs/en_US/junos12.1/information-products/pathway-pages/config-guide-routing/config-guide-routing-bgp.html#configuration

最初發表 / 最後更新: 2014.03.12 / 2018.06.04

0 comments:

張貼留言