MPLS with L3VPN


Base Configuration
PE1
set system host-name PE1
set interfaces et-0/0/8 unit 0 family inet address 10.10.10.1/24
set interfaces et-0/0/9 unit 0 family inet address 20.10.10.1/24
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
wildcard range set protocols ospf area 0.0.0.0 interface et-0/0/[8-9]
commit
C1
set system host-name C1
set interfaces et-0/0/9 unit 0 family inet address 10.10.10.2/24
set interfaces et-0/0/8 unit 0 family inet address 10.20.20.1/24
set interfaces lo0 unit 0 family inet address 11.11.11.11/32
wildcard range set protocols ospf area 0.0.0.0 interface et-0/0/[8-9]
commit
C2
set system host-name C2
set interfaces et-0/0/9 unit 0 family inet address 10.20.20.2/24
set interfaces et-0/0/8 unit 0 family inet address 10.30.30.1/24
set interfaces lo0 unit 0 family inet address 22.22.22.22/32
wildcard range set protocols ospf area 0.0.0.0 interface et-0/0/[8-9]
commit
C3
set system host-name C3
set interfaces et-0/0/8 unit 0 family inet address 20.10.10.2/24
set interfaces et-0/0/9 unit 0 family inet address 20.20.20.1/24
set interfaces lo0 unit 0 family inet address 33.33.33.33/32
wildcard range set protocols ospf area 0.0.0.0 interface et-0/0/[8-9]
commit
C4
set system host-name C4
set interfaces et-0/0/8 unit 0 family inet address 20.20.20.2/24
set interfaces et-0/0/9 unit 0 family inet address 20.30.30.1/24
set interfaces lo0 unit 0 family inet address 44.44.44.44/32
wildcard range set protocols ospf area 0.0.0.0 interface et-0/0/[8-9]
commit
PE2
set system host-name PE2
set interfaces et-0/0/9 unit 0 family inet address 10.30.30.2/24
set interfaces et-0/0/8 unit 0 family inet address 20.30.30.2/24
set interfaces lo0 unit 0 family inet address 2.2.2.2/32
wildcard range set protocols ospf area 0.0.0.0 interface et-0/0/[8-9]
commit
MPLS Configuration
On All Devices....
#configure mpls family on interfaces
#
wildcard range set interface et-0/0/[8-9] unit 0 family mpls
wildcard range set interfaces lo0 unit 0 family mpls
#
#
#enable mpls protcol on interfaces
wildcard range set protocol mpls interface et-0/0/[8-9]
wildcard range set protocol mpls interface lo0
#
#
#enable ldp protocol on interfaces
wildcard range set protocol ldp interface et-0/0/[8-9]
wildcard range set protocol ldp interface lo0
#
#
#enable rsvp protocol on interfaces
wildcard range set protocol rsvp interface et-0/0/[8-9]
wildcard range set protocol rsvp interface lo0
Create an LSP
On PE1
#create LSP to lo0 of PE2
set protocols mpls label-switched-path Path-to-PE2 to 2.2.2.2
#
#
#assign a bandwidth of 100m
set protocols mpls label-switched-path Path-to-PE2 bandwidth 100m
Create an ERO
On PE1
#create an ERO path via another route
set protocols mpls path via-C3 20.10.10.2 strict
#
#
#make it use it
set protocols mpls label-switched-path Path-to-PE2 primary via-C3
Verification
show mpls interface
show mpls lsp/show rsvp session
show mpls lsp ingress name Path-to-PE2 extensive
L3VPN
CE1
set system host-name CE1
set interfaces et-0/0/0 description "Link from CE1 to PE1 for L3VPN"
set interfaces et-0/0/0 unit 0 family inet address 172.16.1.1/30
set interfaces lo0 unit 0 family inet address 111.111.111.111/32
set routing-options router-id 111.111.111.111
set routing-options autonomous-system 65410
set protocol bgp group PE1 type external
set protocols bgp group PE1 import rcv_routes
set protocols bgp group PE1 export adv_direct
set protocol bgp group PE1 peer-as 65412
set protocol bgp group PE1 neighbor 172.16.1.2
set policy-options policy-statement adv_direct term 5 from protocol direct
set policy-options policy-statement adv_direct term 5 from route-filter 111.111.111.111/32 exact
set policy-options policy-statement adv_direct term 5 then accept
set policy-options policy-statement rcv_routes term 2 from protocol bgp
set policy-options policy-statement rcv_routes term 2 from route-filter 172.16.2.0/30 exact
set policy-options policy-statement rcv_routes term 2 then accept
set policy-options policy-statement rcv_routes term 3 from protocol bgp
set policy-options policy-statement rcv_routes term 3 from route-filter 222.222.222.222/32 exact
set policy-options policy-statement rcv_routes term 3 then accept
set policy-options policy-statement rcv_routes term 4 then reject
CE2
set system host-name CE2
set interfaces et-0/0/0 description "Link from CE2 to PE2 for L3VPN"
set interfaces et-0/0/0 unit 0 family inet address 172.16.2.1/30
set interfaces lo0 unit 0 family inet address 222.222.222.222/32
set routing-options router-id 222.222.222.222
set routing-options autonomous-system 65420
set protocol bgp group PE2 type external
set protocols bgp group PE2 import rcv_routes
set protocols bgp group PE2 export adv_direct
set protocol bgp group PE2 peer-as 65412
set protocol bgp group PE2 neighbor 172.16.2.2
set policy-options policy-statement adv_direct term 5 from protocol direct
set policy-options policy-statement adv_direct term 5 from route-filter 222.222.222.222/32 exact
set policy-options policy-statement adv_direct term 5 then accept
set policy-options policy-statement rcv_routes term 2 from protocol bgp
set policy-options policy-statement rcv_routes term 2 from route-filter 172.16.1.0/30 exact
set policy-options policy-statement rcv_routes term 2 then accept
set policy-options policy-statement rcv_routes term 3 from protocol bgp
set policy-options policy-statement rcv_routes term 3 from route-filter 111.111.111.111/32 exact
set policy-options policy-statement rcv_routes term 3 then accept
set policy-options policy-statement rcv_routes term 4 then reject
PE1
set interfaces et-0/0/0 description "Link from PE1 to CE1 for L3vpn"
set interfaces et-0/0/0 unit 0 family inet address 172.16.1.2/30
set routing-instances CE1_L3vpn protocols bgp group CE1 type external
set routing-instances CE1_L3vpn protocols bgp group CE1 peer-as 65410
set routing-instances CE1_L3vpn protocols bgp group CE1 neighbor 172.16.1.1
set routing-instances CE1_L3vpn instance-type vrf
set routing-instances CE1_L3vpn interface et-0/0/0.0
set routing-instances CE1_L3vpn route-distinguisher 1.1.1.1:12
set routing-instances CE1_L3vpn vrf-target target:65412:12
set routing-options autonomous-system 65412
set routing-options router-id 1.1.1.1
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 1.1.1.1
set protocols bgp group ibgp family inet-vpn unicast
set protocols bgp group ibgp neighbor 2.2.2.2
set protocols ospf traffic-engineering
PE2
set interfaces et-0/0/0 description "Link from PE2 to CE2 for L3vpn"
set interfaces et-0/0/0 unit 0 family inet address 172.16.2.2/30
set routing-instances CE2_L3vpn protocols bgp group CE2 type external
set routing-instances CE2_L3vpn protocols bgp group CE2 peer-as 65420
set routing-instances CE2_L3vpn protocols bgp group CE2 neighbor 172.16.2.1
set routing-instances CE2_L3vpn instance-type vrf
set routing-instances CE2_L3vpn interface et-0/0/0.0
set routing-instances CE2_L3vpn route-distinguisher 2.2.2.2:12
set routing-instances CE2_L3vpn vrf-target target:65412:12
set routing-options autonomous-system 65412
set routing-options router-id 2.2.2.2
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 2.2.2.2
set protocols bgp group ibgp family inet-vpn unicast
set protocols bgp group ibgp neighbor 1.1.1.1
set protocols mpls label-switched-path lsp_to_pe1 to 1.1.1.1
set protocols ospf traffic-engineering