Monday, September 8, 2014

MPLS - Basic MPLS VPN

Logical Topology


All ports of physical switch are trunk port.
vlan 15
vlan 17
vlan 12
vlan 23
vlan 34
vlan 46
vlan 48

All ports of physical router are using subinterface
ex) R1: int f0/0
no sh
int f0/0.15
encapsulation dot1q 15
ip add 10.1.15.1 255.255.255.0
int f0/0.12
encapsulation dot1q 12
ip add 10.1.12.1 255.255.255.0
int f0/0.17
encapsulation dot1q 17
ip add 10.1.17.1 255.255.255.0

Scenario

1. ISP provides MPLS VPN
2. There are two customers using vpn network, and they don't know whether they are connected to vpn network to ISP. They use just like they are connected using static route.
3. Between CEs and PEs are using static route. (They can  communicate with static, IGP, eBGP.)
4. Between PEs and P, they use IGP and LDP to communicate for mpls
5. Between PE and PE, they use MBGP to communicate.

Static, IGP or eBGP 

IGP + LDP
MBGP

------------------------

First: Configure IGP (OSPF 1 area 0) for MPLS

R1#show run | s ospf
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 1.1.1.1 0.0.0.0 area 0
 network 1.1.12.1 0.0.0.0 area 0
 network 1.1.14.1 0.0.0.0 area 0

R2#show run | s ospf
router ospf 1
 router-id 1.1.2.2
 log-adjacency-changes
 network 1.1.2.2 0.0.0.0 area 0
 network 1.1.12.2 0.0.0.0 area 0
 network 1.1.23.2 0.0.0.0 area 0

R3#show run | s ospf
router ospf 1
 router-id 1.1.3.3
 log-adjacency-changes
 network 1.1.3.3 0.0.0.0 area 0
 network 1.1.23.3 0.0.0.0 area 0
 network 1.1.34.3 0.0.0.0 area 0

R4#show run | s ospf
router ospf 1
 router-id 1.1.4.4
 log-adjacency-changes
 network 1.1.4.4 0.0.0.0 area 0
 network 1.1.14.4 0.0.0.0 area 0
 network 1.1.34.4 0.0.0.0 area 0

Second: Configure LDP

R1#
mpls label protocol ldp
mpls ldp router-id Loopback0
int f0/0.12
 mpls ip

R2#
mpls label protocol ldp
mpls ldp router-id Loopback0
int f0/0.12
 mpls ip
int f0/0.23
 mpls ip

R3#
mpls label protocol ldp
mpls ldp router-id Loopback0
int f0/0.23
 mpls ip
int f0/0.34
 mpls ip

R4#
mpls label protocol ldp
mpls ldp router-id Loopback0
int f0/0.34
 mpls ip

Third: Configure MBGP between PEs

R1#show run | s bgp
router bgp 1
 bgp router-id 1.1.1.1
 neighbor 1.1.4.4 remote-as 1
 neighbor 1.1.4.4 update-source Loopback0
 !
 address-family vpnv4
  neighbor 1.1.4.4 activate
  neighbor 1.1.4.4 send-community extended

R4#show run | s bgp
router bgp 1
 bgp router-id 1.1.4.4
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 update-source Loopback0
 !
 address-family vpnv4
  neighbor 1.1.1.1 activate
  neighbor 1.1.1.1 send-community both
 !

Fourth: Configure MPLS VPN for customer1

R1#show run vrf customer1
ip vrf customer1
 rd 1:100
 route-target export 1:101
 route-target import 1:102
!
interface FastEthernet0/0.15
 encapsulation dot1Q 15
 ip vrf forwarding customer1
 ip address 10.1.15.1 255.255.255.0
!

* configure routing for VRF customer1 in R1
ip route vrf customer1 10.1.1.0 255.255.255.0 10.1.15.5

address-family ipv4 vrf customer1
  redistribute static

* Configure default route in R5

R5# ip route 0.0.0.0 0.0.0.0 10.1.15.1



R4#show run vrf customer1
ip vrf customer1
 rd 1:100
 route-target export 1:102
 route-target import 1:101
!
interface FastEthernet0/0.46
 ip vrf forwarding customer1
 ip address 10.1.46.4 255.255.255.0
!

* configure routing for VRF customer1 in R4
ip route vrf customer1 10.1.2.0 255.255.255.0 10.1.46.6

address-family ipv4 vrf customer1
  redistribute static

* Configure default route in R6

R6# ip route 0.0.0.0 0.0.0.0 10.1.46.4

Fifth: Include network route between CE-PE to MBGP

R1#
router bgp 1
address-family ipv4 vrf customer1
  redistribute connected
  redistribute static

R4#
router bgp 1
 address-family ipv4 vrf customer1
  redistribute connected
  redistribute static

Sixth: Configure MPLS VPN for customer2 (basically same with customer1. The differences are RD, RT export and RT import settings)

--------------------------------------------------------------------

All the configs for this lab


R1#show run
ip cef
!
ip vrf customer1
 rd 1:100
 route-target export 1:101
 route-target import 1:102
!
ip vrf customer2
 rd 1:200
 route-target export 1:201
 route-target import 1:202
!
mpls label protocol ldp
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.12
 encapsulation dot1Q 12
 ip address 1.1.12.1 255.255.255.0
 mpls ip
!
interface FastEthernet0/0.15
 encapsulation dot1Q 15
 ip vrf forwarding customer1
 ip address 10.1.15.1 255.255.255.0
!
interface FastEthernet0/0.17
 encapsulation dot1Q 17
 ip vrf forwarding customer2
 ip address 10.1.17.1 255.255.255.0
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 1.1.1.1 0.0.0.0 area 0
 network 1.1.12.1 0.0.0.0 area 0
 network 1.1.14.1 0.0.0.0 area 0
!
router bgp 1
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor 1.1.4.4 remote-as 1
 neighbor 1.1.4.4 update-source Loopback0
 no auto-summary
 !
 address-family vpnv4
  neighbor 1.1.4.4 activate
  neighbor 1.1.4.4 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf customer2
  redistribute connected
  redistribute static
  no synchronization
 exit-address-family
 !
 address-family ipv4 vrf customer1
  redistribute connected
  redistribute static
  no synchronization
 exit-address-family
!
ip forward-protocol nd
ip route vrf customer1 10.1.1.0 255.255.255.0 10.1.15.5
ip route vrf customer2 10.1.1.0 255.255.255.0 10.1.17.7
!
mpls ldp router-id Loopback0
!


R2#show run
ip cef
!
mpls label protocol ldp
!
interface Loopback0
 ip address 1.1.2.2 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.12
 encapsulation dot1Q 12
 ip address 1.1.12.2 255.255.255.0
 mpls ip
!
interface FastEthernet0/0.23
 encapsulation dot1Q 23
 ip address 1.1.23.2 255.255.255.0
 mpls ip
!
router ospf 1
 router-id 1.1.2.2
 log-adjacency-changes
 network 1.1.2.2 0.0.0.0 area 0
 network 1.1.12.2 0.0.0.0 area 0
 network 1.1.23.2 0.0.0.0 area 0
!
mpls ldp router-id Loopback0
!

R3#show run
ip cef

mpls label protocol ldp
!
interface Loopback0
 ip address 1.1.3.3 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.23
 encapsulation dot1Q 23
 ip address 1.1.23.3 255.255.255.0
 mpls ip
!
interface FastEthernet0/0.34
 encapsulation dot1Q 34
 ip address 1.1.34.3 255.255.255.0
 mpls ip
!
router ospf 1
 router-id 1.1.3.3
 log-adjacency-changes
 network 1.1.3.3 0.0.0.0 area 0
 network 1.1.23.3 0.0.0.0 area 0
 network 1.1.34.3 0.0.0.0 area 0
!
mpls ldp router-id Loopback0
!

R4#show run
ip cef
!
ip vrf customer1
 rd 1:100
 route-target export 1:102
 route-target import 1:101
!
ip vrf customer2
 rd 1:200
 route-target export 1:202
 route-target import 1:201
!
mpls label protocol ldp
!
interface Loopback0
 ip address 1.1.4.4 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.34
 encapsulation dot1Q 34
 ip address 1.1.34.4 255.255.255.0
 mpls ip
!
interface FastEthernet0/0.46
 encapsulation dot1Q 46
 ip vrf forwarding customer1
 ip address 10.1.46.4 255.255.255.0
!
interface FastEthernet0/0.48
 encapsulation dot1Q 48
 ip vrf forwarding customer2
 ip address 10.1.48.4 255.255.255.0
!
router ospf 1
 router-id 1.1.4.4
 log-adjacency-changes
 network 1.1.4.4 0.0.0.0 area 0
 network 1.1.14.4 0.0.0.0 area 0
 network 1.1.34.4 0.0.0.0 area 0
!
router bgp 1
 no synchronization
 bgp router-id 1.1.4.4
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 update-source Loopback0
 no auto-summary
 !
 address-family vpnv4
  neighbor 1.1.1.1 activate
  neighbor 1.1.1.1 send-community both
 exit-address-family
 !
 address-family ipv4 vrf customer2
  redistribute connected
  redistribute static
  no synchronization
 exit-address-family
 !
 address-family ipv4 vrf customer1
  redistribute connected
  redistribute static
  no synchronization
 exit-address-family
!
ip forward-protocol nd
ip route vrf customer1 10.1.2.0 255.255.255.0 10.1.46.6
ip route vrf customer2 10.1.2.0 255.255.255.0 10.1.48.8
!
mpls ldp router-id Loopback0
!


R5#show run
interface Loopback0
 ip address 10.1.1.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.15
 encapsulation dot1Q 15
 ip address 10.1.15.5 255.255.255.0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.15.1
no ip http server
no ip http secure-server
!

R6#show run
interface Loopback0
 ip address 10.1.2.2 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.46
 encapsulation dot1Q 46
 ip address 10.1.46.6 255.255.255.0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.46.4


R7#show run
ip cef
interface Loopback0
 ip address 10.1.1.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.17
 encapsulation dot1Q 17
 ip address 10.1.17.7 255.255.255.0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.17.1
no ip http server
no ip http secure-server

R8#show run
ip cef
interface Loopback0
 ip address 10.1.2.2 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.48
 encapsulation dot1Q 48
 ip address 10.1.48.8 255.255.255.0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.48.4
no ip http server
no ip http secure-server
!

No comments:

Post a Comment