Tuesday, December 27, 2016

configure mpls and ibgp on cisco router

***diagram

                      r1 --------------> r2 ---------------> r3
router id: 2.2.2.1            2.2.2.2            2.2.2.3

- we will exchange router 192.168.0.0/24, between r1 and r3
- ibgp asn: 1

**** r1 configuration
interface Loopback0
 ip address 2.2.2.1 255.255.255.255
!
interface Ethernet0/0
 no ip address
 shutdown
 duplex auto
!
interface GigabitEthernet0/0
 ip address 10.1.1.1 255.255.255.252
 media-type gbic
 speed 1000
 duplex full
 negotiation auto
 mpls ip
!
interface GigabitEthernet1/0
 no ip address
 shutdown
 negotiation auto
!
router ospf 1
 network 2.2.2.0 0.0.0.255 area 0
 network 10.1.1.0 0.0.0.3 area 0
!
router bgp 1
 bgp log-neighbor-changes
 neighbor 2.2.2.3 remote-as 1
 neighbor 2.2.2.3 update-source Loopback0
!



**** r2 configuration
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Loopback1
 ip address 11.0.0.1 255.255.255.0
!
interface Ethernet0/0
 no ip address
 shutdown
 duplex auto
!
interface GigabitEthernet0/0
 ip address 10.1.1.2 255.255.255.252
 media-type gbic
 speed 1000
 duplex full
 negotiation auto
 mpls ip 
!
interface FastEthernet1/0
 ip address 10.2.1.1 255.255.255.252
 speed auto
 duplex auto
 mpls ip
 mpls ldp discovery transport-address interface
!
interface FastEthernet1/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
router ospf 1
 network 1.1.1.0 0.0.0.255 area 0
 network 2.2.2.0 0.0.0.255 area 0
 network 10.0.0.0 0.0.0.255 area 0
 network 10.1.1.0 0.0.0.3 area 0
 network 10.2.1.0 0.0.0.3 area 0
 network 11.0.0.0 0.0.0.255 area 0
!



****r3 configuration
interface Loopback0
 ip address 2.2.2.3 255.255.255.255
!
interface Loopback1
 ip address 192.168.0.1 255.255.255.0
!
interface Ethernet0/0
 no ip address
 shutdown
 duplex auto
!
interface GigabitEthernet0/0
 no ip address
 shutdown
 media-type gbic
 speed 1000
 duplex full
 negotiation auto
!
interface FastEthernet1/0
 ip address 10.2.1.2 255.255.255.252
 speed auto
 duplex auto
 mpls ip
 mpls ldp discovery transport-address interface
!
interface FastEthernet1/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
router ospf 1
 network 2.2.2.0 0.0.0.255 area 0
 network 10.2.1.0 0.0.0.3 area 0
!
router bgp 1
 bgp log-neighbor-changes
 network 192.168.0.0
 neighbor 2.2.2.1 remote-as 1
 neighbor 2.2.2.1 update-source Loopback0
!
 


*** show command

- on router r1 ,we will see the ospf and bgp routes
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 3 subnets
C        2.2.2.1 is directly connected, Loopback0
O        2.2.2.2 [110/2] via 10.1.1.2, 00:20:58, GigabitEthernet0/0
O        2.2.2.3 [110/3] via 10.1.1.2, 00:19:48, GigabitEthernet0/0
      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C        10.1.1.0/30 is directly connected, GigabitEthernet0/0
L        10.1.1.1/32 is directly connected, GigabitEthernet0/0
O        10.2.1.0/30 [110/2] via 10.1.1.2, 00:20:58, GigabitEthernet0/0
      11.0.0.0/32 is subnetted, 1 subnets
O        11.0.0.1 [110/2] via 10.1.1.2, 00:20:58, GigabitEthernet0/0
B     192.168.0.0/24 [200/0] via 2.2.2.3, 00:11:33



- show mpls on r2, we will the ldp neighbor to router r1 and r3

R2#show mpls ldp neighbor 
    Peer LDP Ident: 2.2.2.3:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 10.2.1.2.45290 - 10.2.1.1.646
        State: Oper; Msgs sent/rcvd: 42/42; Downstream
        Up time: 00:28:45
        LDP discovery sources:
          FastEthernet1/0, Src IP addr: 10.2.1.2
        Addresses bound to peer LDP Ident:
          10.2.1.2        2.2.2.3         192.168.0.1    
    Peer LDP Ident: 2.2.2.1:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 2.2.2.1.646 - 2.2.2.2.64149
        State: Oper; Msgs sent/rcvd: 40/41; Downstream
        Up time: 00:27:44
        LDP discovery sources:
          GigabitEthernet0/0, Src IP addr: 10.1.1.1
        Addresses bound to peer LDP Ident:
          10.1.1.1        2.2.2.1        


- traceroute to network 192.168.0.0/24 from r1

R1#traceroute 192.168.0.1 
Type escape sequence to abort.
Tracing the route to 192.168.0.1
VRF info: (vrf in name/id, vrf out name/id)
  1 10.1.1.2 [MPLS: Label 17 Exp 0] 16 msec 16 msec 16 msec
  2 10.2.1.2 16 msec 48 msec 36 msec

No comments:

Post a Comment