Lab 3.  LDP (Label Disribution Protocol) Basic

Protocol yang berfungsi membuat dan mendistribusikan label 2 yaitu LDP dan TDP
(Tag Distribution Protocol) merupakan propriety cisco namun sudah tidak
digunakan lagi, sekarang router cisco sendiri defaultnya menggunakan LDP
(label Disribution protocol).

Perintah "mpls label protocol ldp" apabila dikonfigurasikan di global config
mode akan menjadikan semua interface menggunakan LDP sebagai label distribution
protocolnya.


Semua LSR (Label Switch Rouer) yang menjalankan LDP akan diberikan router-id
layaknya OSPF. EIGRP atau BGP, dimana defaultnya akan didasarkan pada IP terti
nggi loopback yang ada. jika tidak ada akan menggunakan ip aktif tertinggi
atau bisa kita define sendiri menggunakan perintah "mpls ldp router-id".
sebaiknya LDP Router-id kita konfigurasikan sendiri agar transport address
mpls-nya stabil.

perintah "mpls ip" pada interface berfungsi mengaktifkan MPLS Forwarding IPv4
paket melalui jalur routingnya.

Konfigurasi IP Address dan OSPF  di Router 1

R1(config)#int lo0
R1(config-if)#ip add
*Aug 11 17:19:44.404: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#int e0/1
R1(config-if)#ip add 12.12.12.1 255.255.255.0
R1(config-if)#no shut


R1(config)#router ospf 1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 12.12.12.1 0.0.0.0 area 0
R1(config-router)#exit


Verifikasi OSPF di Router 1

R1(config)#do sh ip route ospf
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
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/11] via 12.12.12.2, 00:02:26, Ethernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/21] via 12.12.12.2, 00:01:27, Ethernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/31] via 12.12.12.2, 00:00:03, Ethernet0/1
      23.0.0.0/24 is subnetted, 1 subnets
O        23.23.23.0 [110/20] via 12.12.12.2, 00:02:16, Ethernet0/1
      34.0.0.0/24 is subnetted, 1 subnets
O        34.34.34.0 [110/30] via 12.12.12.2, 00:00:13, Ethernet0/1





Router 2

R2(config)#int lo0
R2(config-if)#ip add 2.
*Aug 11 17:20:36.921: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#int e0/1   
R2(config-if)#ip add 12.12.12.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int e0/0
R2(config-if)#ip add 23.23.23.2 255.255.255.0
R2(config-if)#no shut



R2(config)#router ospf 1
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#network 12.12.12.2 0.0.0.0 area 0
R2(config-router)#network 23.23.23.2 0.0.0.0 area 0
*Aug 11 17:26:06.234: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/1 from LOADING to FULL, Loading Done
R2(config-router)#network 23.23.23.2 0.0.0.0 area 0
R2(config-router)#exit


Verifikasi Router OSPF di Router 2

R2(config)#do sh ip route ospf
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
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/11] via 12.12.12.1, 00:03:43, Ethernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/11] via 23.23.23.3, 00:02:56, Ethernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/21] via 23.23.23.3, 00:01:22, Ethernet0/0
      34.0.0.0/24 is subnetted, 1 subnets
O        34.34.34.0 [110/20] via 23.23.23.3, 00:01:32, Ethernet0/0
R2(config)#



Router 3

R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int lo0
R3(config-if)#ip add
*Aug 11 17:22:07.123: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#int e0/0
R3(config-if)#ip add 23.23.23.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int e0/1
R3(config-if)#ip add 34.34.34.3 255.255.255.0
R3(config-if)#no shut


R3(config)#router ospf 1
R3(config-router)#network 3.3.3.3 0.0.0.0 area 0
R3(config-router)#network 23.23.23.3 0.0.0.0 area 0
R3(config-router)#network 34.34.34.3
*Aug 11 17:26:55.018: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet0/0 from LOADING to FULL, Loading Done
R3(config-router)#network 34.34.34.3 0.0.0.0 area 0
R3(config-router)#exit


Verifikasi OSPF di Router 3

R3(config)#do sh ip route ospf
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
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/21] via 23.23.23.2, 00:01:47, Ethernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/11] via 23.23.23.2, 00:01:47, Ethernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/11] via 34.34.34.4, 00:00:25, Ethernet0/1
      12.0.0.0/24 is subnetted, 1 subnets
O        12.12.12.0 [110/20] via 23.23.23.2, 00:01:47, Ethernet0/0
R3(config)#



Router 4

R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4
*Aug 11 17:23:09.629: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config)#int e0/1
R4(config-if)#ip add 34.34.34.4 255.255.255.0
R4(config-if)#no shut

R4(config)#router ospf 1
R4(config-router)#network 4.4.4.4 0.0.0.0 area 0
R4(config-router)#network 34.34.34.4 0.0.0.0 area 0
R4(config-router)#exit


Verifikasi OSPF di Router 4

R4(config)#do sh ip route ospf
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
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/31] via 34.34.34.3, 00:00:40, Ethernet0/1
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/21] via 34.34.34.3, 00:00:40, Ethernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/11] via 34.34.34.3, 00:00:40, Ethernet0/1
      12.0.0.0/24 is subnetted, 1 subnets
O        12.12.12.0 [110/30] via 34.34.34.3, 00:00:40, Ethernet0/1
      23.0.0.0/24 is subnetted, 1 subnets
O        23.23.23.0 [110/20] via 34.34.34.3, 00:00:40, Ethernet0/1
R4(config)#



====================================================================

Aktifkan MPLS LDP di R1 R2 R3 R4 serta aktifkan mpls ip untuk forward ipv4

R1(config)#mpls label protocol ldp
R1(config)#mpls ldp router-id loopback 0 force
R1(config)#int e0/1
R1(config-if)#mpls ip
R1(config-if)#exit
R1(config)#do sh mpls interface
Interface              IP            Tunnel   BGP Static Operational
Ethernet0/1            Yes (ldp)     No       No  No     Yes   


R2(config)#mpls label protocol ldp
R2(config)#mpls ldp router-id loopback 0 force
R2(config)#int e0/1
R2(config-if)#mpls ip
R2(config-if)#int e0/0
R2(config-if)#mpls ip
R2(config)#do sh mpls interface
Interface              IP            Tunnel   BGP Static Operational
Ethernet0/0            Yes (ldp)     No       No  No     Yes       
Ethernet0/1            Yes (ldp)     No       No  No     Yes   


R3(config)#mpls label protocol ldp
R3(config)#mpls ldp router-id loopback 0 force
R3(config)#int e0/0
R3(config-if)#mpls ip
R3(config-if)#int e0/1
R3(config-if)#mpls ip
R3(config)#do sh mpls interface
Interface              IP            Tunnel   BGP Static Operational
Ethernet0/0            Yes (ldp)     No       No  No     Yes       
Ethernet0/1            Yes (ldp)     No       No  No     Yes   


R4(config)#mpls label protocol ldp
R4(config)#mpls ldp router-id loopback 0 force
R4(config)#int e0/1
R4(config-if)#mpls ip

R4(config)#do sh mpls interface
Interface              IP            Tunnel   BGP Static Operational
Ethernet0/1            Yes (ldp)     No       No  No     Yes       
R4(config)#

=========================================================================

Setalah LSR (Label Switch Router ) di konfigurasikan, maka ia akan melakukan
discovery kesemua neighbornya, discovery ini menggunakan hello message via
protocol UDP dengan IP 224.0.0.2 port 646 baik source dan destination. Setiap
hello message dikirim setaip 5 detik dan hold timer setiap 15 detik


R1#debug ip packet detail
IP packet debugging is on (detailed)
R1#
*Aug 11 17:38:07.573: IP: s=12.12.12.1 (local), d=224.0.0.2 (Ethernet0/1), len 62, sending broad/multicast
*Aug 11 17:38:07.573:     UDP src=646, dst=646
*Aug 11 17:38:07.573: IP: s=12.12.12.1 (local), d=224.0.0.2 (Ethernet0/1), len 62, sending full packet
*Aug 11 17:38:07.573:     UDP src=646, dst=646
R1#
*Aug 11 17:38:09.361: IP: s=12.12.12.2 (Ethernet0/1), d=224.0.0.2, len 62, rcvd 0
*Aug 11 17:38:09.362:     UDP src=646, dst=646


R1#sho mpls ldp neighbor
    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 1.1.1.1:0
TCP connection: 2.2.2.2.53489 - 1.1.1.1.646
State: Oper; Msgs sent/rcvd: 15/15; Downstream
Up time: 00:04:44
LDP discovery sources:
  Ethernet0/1, Src IP addr: 12.12.12.2
        Addresses bound to peer LDP Ident:
          23.23.23.2      12.12.12.2      2.2.2.2   


R1#sh mpls ldp discovery detail
 Local LDP Identifier:
    1.1.1.1:0
    Discovery Sources:
    Interfaces:
Ethernet0/1 (ldp): xmit/recv
    Enabled: Interface config
    Hello interval: 5000 ms; Transport IP addr: 1.1.1.1
    LDP Id: 2.2.2.2:0
      Src IP addr: 12.12.12.2; Transport IP addr: 2.2.2.2
      Hold time: 15 sec; Proposed local/peer: 15/15 sec
      Reachable via 2.2.2.2/32
      Password: not required, none, in use
            Clients: IPv4, mLDP


R1#sh mpld ldp bindings
         ^
% Invalid input detected at '^' marker.

R1#sh mpls ldp bindings
  lib entry: 1.1.1.1/32, rev 2
local binding:  label: imp-null
remote binding: lsr: 2.2.2.2:0, label: 16
  lib entry: 2.2.2.2/32, rev 4
local binding:  label: 16
remote binding: lsr: 2.2.2.2:0, label: imp-null
  lib entry: 3.3.3.3/32, rev 6
local binding:  label: 17
remote binding: lsr: 2.2.2.2:0, label: 17
  lib entry: 4.4.4.4/32, rev 8
local binding:  label: 18
remote binding: lsr: 2.2.2.2:0, label: 18
  lib entry: 12.12.12.0/24, rev 10
local binding:  label: imp-null
remote binding: lsr: 2.2.2.2:0, label: imp-null
  lib entry: 23.23.23.0/24, rev 12
local binding:  label: 19
remote binding: lsr: 2.2.2.2:0, label: imp-null
  lib entry: 34.34.34.0/24, rev 14
local binding:  label: 20
remote binding: lsr: 2.2.2.2:0, label: 19


R1#sh mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
16         Pop Label  2.2.2.2/32       0             Et0/1      12.12.12.2 
17         17         3.3.3.3/32       0             Et0/1      12.12.12.2 
18         18         4.4.4.4/32       0             Et0/1      12.12.12.2 
19         Pop Label  23.23.23.0/24    0             Et0/1      12.12.12.2 
20         19         34.34.34.0/24    0             Et0/1      12.12.12.2



R1#sh ip route | b Ga
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/11] via 12.12.12.2, 00:14:50, Ethernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/21] via 12.12.12.2, 00:13:51, Ethernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/31] via 12.12.12.2, 00:12:27, Ethernet0/1
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.12.12.0/24 is directly connected, Ethernet0/1
L        12.12.12.1/32 is directly connected, Ethernet0/1
      23.0.0.0/24 is subnetted, 1 subnets
O        23.23.23.0 [110/20] via 12.12.12.2, 00:14:40, Ethernet0/1
      34.0.0.0/24 is subnetted, 1 subnets
O        34.34.34.0 [110/30] via 12.12.12.2, 00:12:37, Ethernet0/1
R1#


R4(config)#do sh mpls ldp neighbor
    Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 4.4.4.4:0
TCP connection: 3.3.3.3.646 - 4.4.4.4.30114
State: Oper; Msgs sent/rcvd: 15/15; Downstream
Up time: 00:04:51
LDP discovery sources:
  Ethernet0/1, Src IP addr: 34.34.34.3
        Addresses bound to peer LDP Ident:
          23.23.23.3      34.34.34.3      3.3.3.3       


R4(config)#do sh mpls forwarding-table 4.4.4.4
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop   
Label      Label      or Tunnel Id     Switched      interface             
None       No Label   4.4.4.4/32       0                       


Selesei


Salam Ngoprek

Leave a Reply