Cisco MPLS Configuration Lab

Categories Cisco, IOS, Route
  • VRF 1 = Client1 Two routers, two locations
  • 192.168.1.0/24 and 192.168.2.0/24
  • VRF 2 = Client2 Two Routers, two locations
  • 172.16.1.0/24 and 172.16.2.0/24
  • Two PE Routers – PE1 and PE2. They are connected with the 10.0.0.0/24 network. PE1 has a loopback of 1.1.1.1 and PE2 has 2.2.2.2. This Provider network could easily be increased in size and number of devices. Most labs will use OSPF or EIGRP for the Provider network with a BGP connection between the specific provider edge devices connecting to the client.

C-1-1 Configuration

hostname C-1-1
 !
 interface Loopback0
  ip address 11.11.11.11 255.255.255.255
 !
 interface GigabitEthernet0/0
  ip address 192.168.1.2 255.255.255.0
  ip ospf 1 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 router ospf 1
  router-id 11.11.11.11

C-1-2 Configuration

 hostname C-1-2
 !
 interface Loopback0
  ip address 12.12.12.12 255.255.255.255
 !
 interface GigabitEthernet0/0
  ip address 192.168.2.2 255.255.255.0
  ip ospf 1 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 router ospf 1
  router-id 12.12.12.12
 !

C-2-1 Configuration

hostname C-2-1
 !
 interface Loopback0
  ip address 21.21.21.21 255.255.255.255
 !
 interface GigabitEthernet0/1
  ip address 172.16.1.2 255.255.255.0
  ip ospf 1 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 router ospf 1
  router-id 21.21.21.21
 !

C-2-2 Configuration

hostname C-2-2
 !
 interface Loopback0
  ip address 22.22.22.22 255.255.255.255
 !
 interface GigabitEthernet0/1
  ip address 172.16.2.2 255.255.255.0
  ip ospf 2 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 router ospf 2
  router-id 22.22.22.22
 !

PE1

hostname PE1
 !
 ip vrf Client1
  rd 65000:1
  route-target export 65000:1
  route-target import 65000:1
 !
 ip vrf Client2
  rd 65000:2
  route-target export 65000:1
  route-target import 65000:1
 !
 interface Loopback0
  ip address 1.1.1.1 255.255.255.255
 !
 interface GigabitEthernet0/0
  ip vrf forwarding Client1
  ip address 192.168.1.1 255.255.255.0
  ip ospf 1 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 interface GigabitEthernet0/1
  ip vrf forwarding Client2
  ip address 172.16.1.1 255.255.255.0
  ip ospf 2 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 interface GigabitEthernet0/2
  ip address 10.0.0.1 255.255.255.0
  duplex auto
  speed auto
  media-type rj45
  mpls ip
 !
 router ospf 1 vrf Client1
  router-id 192.168.1.1
  redistribute bgp 65000 subnets
 !
 router ospf 2 vrf Client2
  router-id 172.16.1.1
  redistribute bgp 65000 subnets
 !
 router bgp 65000
  bgp router-id 1.1.1.1
  bgp log-neighbor-changes
  neighbor 2.2.2.2 remote-as 65000
  neighbor 2.2.2.2 update-source Loopback0
  !
  address-family ipv4
   neighbor 2.2.2.2 activate
  exit-address-family
  !
  address-family vpnv4
   neighbor 2.2.2.2 activate
   neighbor 2.2.2.2 send-community extended
  exit-address-family
  !
  address-family ipv4 vrf Client1
   redistribute ospf 1
  exit-address-family
  !
  address-family ipv4 vrf Client2
   redistribute ospf 2
  exit-address-family
 !
 ip route 2.2.2.2 255.255.255.255 10.0.0.2

PE2 Configuration

hostname PE2
 !
 ip vrf Client1
  rd 65000:1
  route-target export 65000:1
  route-target import 65000:1
 !
 ip vrf Client2
  rd 65000:2
  route-target export 65000:2
  route-target import 65000:2
 !
 interface Loopback0
  ip address 2.2.2.2 255.255.255.255
 !
 interface GigabitEthernet0/0
  ip vrf forwarding Client1
  ip address 192.168.2.1 255.255.255.0
  ip ospf 1 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 interface GigabitEthernet0/1
  ip vrf forwarding Client2
  ip address 172.16.2.1 255.255.255.0
  ip ospf 2 area 0
  duplex auto
  speed auto
  media-type rj45
 !
 interface GigabitEthernet0/2
  ip address 10.0.0.2 255.255.255.0
  duplex auto
  speed auto
  media-type rj45
  mpls ip
 !
 router ospf 1 vrf Client1
  router-id 192.168.2.1
  redistribute bgp 65000 subnets
 !
 router ospf 2 vrf Client2
  router-id 172.16.2.1
  redistribute bgp 65000 subnets
 !
 router bgp 65000
  bgp router-id 2.2.2.2
  bgp log-neighbor-changes
  neighbor 1.1.1.1 remote-as 65000
  neighbor 1.1.1.1 update-source Loopback0
  !
  address-family ipv4
   neighbor 1.1.1.1 activate
  exit-address-family
  !
  address-family vpnv4
   neighbor 1.1.1.1 activate
   neighbor 1.1.1.1 send-community extended
  exit-address-family
  !
  address-family ipv4 vrf Client1
   redistribute ospf 1
  exit-address-family
  !
  address-family ipv4 vrf Client2
   redistribute ospf 2
  exit-address-family
 !
 ip route 1.1.1.1 255.255.255.255 10.0.0.1