Sunday, November 25, 2012

Juniper BGP Confederation MPLS/VPN

BGP Confederation MPLS/VPN
BGP Summary
root@Olive# run show bgp summary logical-system r1
Groups: 2 Peers: 3 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...
3.3.3.3               65413         10         11       0       0        3:30 0/0/0/0              0/0/0/0
192.168.12.2          65412         34         49       0       7           4 0/0/0/0              0/0/0/0
192.168.16.6          65414          3          2       0       1           4 0/0/0/0              0/0/0/0


R1 didn’t receive any VPN routes from other PE's, because PE will install CE’s VPN routes in vpn-a.inet.0 routing table, but now PE only advertise IPv4 IBGP peer to R1, they don’t use MP-BGP.
All PE's can learn all VPNv4 routes in this case, So the IGP must be enable in all PE's, but PE don’t
have routes to another PE. Enable OSPF in all routers within AS. Make sure it can reachable in each PE.
root@Olive# show r1 protocols ospf  
area 0.0.0.0 {
    interface lo0.1 {
        passive;
    }
    interface em1.13;
    interface em1.12;
    interface em1.16;
}

root@Olive# show r2 protocols ospf   
area 0.0.0.0 {
    interface lo0.2 {
        passive;
    }
    interface em2.12;
}

root@Olive# show r3 protocols ospf  
area 0.0.0.0 {
    interface lo0.3 {
        passive;
    }
    interface em2.13;
}

root@Olive# show r6 protocols ospf   
area 0.0.0.0 {
    interface lo0.6 {
        passive;
    }
    interface em2.16;
}

Configuration MP-IBGP between in PE's, three PE's belong to different AS, Enable Multi-hop and group type external.
root@Olive# show r2 protocols bgp
group ebgp {
    type external;
    neighbor 192.168.12.1 {
        peer-as 65413;
    }
}
group vpn-pe {
    type external;
    local-address 2.2.2.2;
    family inet-vpn {
        unicast;
    }
    neighbor 3.3.3.3 {
        multihop;
        peer-as 65413;
    }
    neighbor 6.6.6.6 {
        multihop;
        peer-as 65414;
    }
}

root@Olive# show r3 protocols bgp  
group ibgp {
    type internal;
    local-address 3.3.3.3;
    neighbor 1.1.1.1;
}
group vpn-pe {
    type external;
    local-address 3.3.3.3;
    family inet-vpn {
        unicast;
    }
    neighbor 2.2.2.2 {
        multihop;
        peer-as 65412;
    }
    neighbor 6.6.6.6 {
        multihop;
        peer-as 65414;
    }
}

root@Olive# show r6 protocols bgp  
group ebgp {
    type external;
    neighbor 192.168.16.1 {
        peer-as 65413;
    }
}
group vpn-pe {
    type external;
    local-address 6.6.6.6;
    family inet-vpn {
        unicast;
    }
    neighbor 2.2.2.2 {
        multihop;
        peer-as 65412;
    }
    neighbor 3.3.3.3 {
        multihop;
        peer-as 65413;
    }
}

Check the BGP Summary
root@Olive# run show bgp summary logical-system r3   
Groups: 3 Peers: 4 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
bgp.l3vpn.0            5          1          0          0          0          0
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               65413         56         58       0       0       24:47 Establ
  inet.0: 0/0/0/0
2.2.2.2               65412          5          5       0       0          17 Establ
  bgp.l3vpn.0: 0/2/2/0
  vpn-a.inet.0: 0/2/2/0
6.6.6.6               65414          4          4       0       0          13 Establ
  bgp.l3vpn.0: 0/2/2/0
  vpn-a.inet.0: 0/2/2/0
192.168.35.5            500         43         46       0      10          56 Establ
  vpn-a.inet.0: 1/2/2/0


R3 was received the VPNv4 routes from R2 and R6, but the route is inactive.
root@Olive1# run show route hidden logical-system r3

inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)

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

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

4.4.4.4/32          [BGP/170] 00:01:38, localpref 100, from 2.2.2.2
                      AS path: (65412) 400 I
                      Unusable
7.7.7.7/32          [BGP/170] 00:01:34, localpref 100, from 6.6.6.6
                      AS path: (65414) 700 I
                      Unusable
192.168.24.0/24     [BGP/170] 00:01:38, localpref 100, from 2.2.2.2
                      AS path: (65412) I
                      Unusable
192.168.67.0/24     [BGP/170] 00:01:34, localpref 100, from 6.6.6.6
                      AS path: (65414) I
                      Unusable

mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)

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

100:1:4.4.4.4/32               
                    [BGP/170] 00:01:38, localpref 100, from 2.2.2.2
                      AS path: (65412) 400 I
                      Unusable
100:1:7.7.7.7/32               
                    [BGP/170] 00:01:34, localpref 100, from 6.6.6.6
                      AS path: (65414) 700 I
                      Unusable
100:1:192.168.24.0/24               
                    [BGP/170] 00:01:38, localpref 100, from 2.2.2.2
                      AS path: (65412) I
                      Unusable
100:1:192.168.67.0/24               
                    [BGP/170] 00:01:34, localpref 100, from 6.6.6.6
                      AS path: (65414) I
                      Unusable

The route information: Unsable, it means can’t reach next-hop in normal,
Check 7.7.7.7/32 route next-hop information
root@Olive1# run show route 7.7.7.7/32 logical-system r3 hidden extensive

vpn-a.inet.0: 7 destinations, 8 routes (3 active, 0 holddown, 4 hidden)
7.7.7.7/32 (1 entry, 0 announced)
         BGP    Preference: 170/-101
                Route Distinguisher: 100:1
                Next hop type: Unusable
                Next-hop reference count: 8
                State:
< output omitted >

The VPNv4 route 7.7.7.7/32 next hop is R6(PE), and PE Loopback route in inet.3 route table, inet.3 route table in R3
root@Olive1# run show route table inet.3 logical-system r3          

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

1.1.1.1/32         *[LDP/9] 00:12:57, metric 1
                    > to 192.168.13.1 via em2.13

Enable LDP protocol between in EBGP interfaces
root@Olive# set r1 protocols ldp interface em1.12
root@Olive# set r1 protocols ldp interface em1.13

root@Olive# set r1 protocols ldp interface em1.16
root@Olive# set r3 protocols ldp interface em2.13
root@Olive# set r2 protocols ldp interface em2.12
root@Olive# set r6 protocols ldp interface em2.16

Inet.3 Route table
root@Olive# run show route table inet.3 logical-system r3  

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

1.1.1.1/32         *[LDP/9] 00:01:43, metric 1
                    > to 192.168.13.1 via em2.13
2.2.2.2/32         *[LDP/9] 00:01:43, metric 1
                    > to 192.168.13.1 via em2.13, Push 300160
6.6.6.6/32         *[LDP/9] 00:01:43, metric 1
                    > to 192.168.13.1 via em2.13, Push 300192

VPNv4 Route
root@Olive# run show route 7.7.7.7/32 logical-system r3   

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

7.7.7.7/32         *[BGP/170] 00:00:01, localpref 100, from 6.6.6.6
                      AS path: (65414) 700 I
                    > to 192.168.13.1 via em2.13, Push 16, Push 300192(top)

bgp.l3vpn.0: 6 destinations, 9 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

100:1:7.7.7.7/32               
                   *[BGP/170] 00:00:01, localpref 100, from 6.6.6.6
                      AS path: (65414) 700 I
                    > to 192.168.13.1 via em2.13, Push 16, Push 300192(top)


R3 to 7.7.7.7/32 will push outside label 300192 from R1, and VPN label 16 at the same time.
Check label 300192 in R1
root@Olive# run show route table mpls.0 label 300192 logical-system r1   

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

300192             *[LDP/9] 00:03:25, metric 1
                    > to 192.168.16.6 via em1.16, Pop     
300192(S=0)        *[LDP/9] 00:03:25, metric 1
                    > to 192.168.16.6 via em1.16, Pop      

R1 will pop outside label and send VPN label 16 to R6
Check ping reachable
root@Olive# run show route label 16 logical-system r6          

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

16                 *[VPN/0] 01:41:48
                      to table vpn-a.inet.0, Pop    

root@Olive# run show route protocol bgp logical-system r5         

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

4.4.4.4/32         *[BGP/170] 00:04:27, localpref 100
                      AS path: 100 400 I
                    > to 192.168.35.3 via em2.35
7.7.7.7/32         *[BGP/170] 00:04:27, localpref 100
                      AS path: 100 700 I
                    > to 192.168.35.3 via em2.35
192.168.24.0/24    *[BGP/170] 00:04:27, localpref 100
                      AS path: 100 I
                    > to 192.168.35.3 via em2.35
192.168.67.0/24    *[BGP/170] 00:04:27, localpref 100
                      AS path: 100 I
                    > to 192.168.35.3 via em2.35

root@Olive# run show route protocol bgp logical-system r4        

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

5.5.5.5/32         *[BGP/170] 00:04:54, localpref 100
                      AS path: 100 500 I
                    > to 192.168.24.2 via em2.24
7.7.7.7/32         *[BGP/170] 00:04:54, localpref 100
                      AS path: 100 700 I
                    > to 192.168.24.2 via em2.24
192.168.35.0/24    *[BGP/170] 00:04:54, localpref 100
                      AS path: 100 I
                    > to 192.168.24.2 via em2.24
192.168.67.0/24    *[BGP/170] 00:04:54, localpref 100
                      AS path: 100 I
                    > to 192.168.24.2 via em2.24

root@Olive# run ping 7.7.7.7 logical-system r5 source 5.5.5.5 rapid
PING 7.7.7.7 (7.7.7.7): 56 data bytes
!!!!!
--- 7.7.7.7 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 2.417/4.011/5.861/1.505 ms

root@Olive# run ping 4.4.4.4 logical-system r5 source 5.5.5.5 rapid
PING 4.4.4.4 (4.4.4.4): 56 data bytes
!!!!!
--- 4.4.4.4 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.773/2.789/3.470/0.594 ms