Configuring LDP

From ImageStream Router Documentation

Revision as of 21:50, 25 November 2009 by Syoder (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

LDP Configuration Example 1

Networks

5.5.5.0/24 MPLS router network. Each MPLS router should be allocated one IP from this network.
10.5.0.0/24 Network connecting LER1 and LSR1.
10.6.0.0/24 Network connecting LER2 and LSR1.
10.20.0.0/24 Customer A network site 1 connected to LER1.
10.21.0.0/24 Customer A network site 2 connected to LER2.
Simple 3 MPLS router setup using LDP and OSPF.

MPLS ex1.png

LER1 Configuration

wan.conf configuration

!
interface Loopback0
 ip address 5.5.5.1 255.255.255.255
!
interface Ethernet0
 description MPLS Core
 ip address 10.5.0.2 255.255.255.0
!
interface Ethernet1
 description Customer A Site 1
 ip address 10.20.0.1 255.255.255.0
!

Quagga configuration

interface eth0
 mpls ip
 mpls labelspace 0
!
mpls ldp
 egress connected
!
router ospf
 redistribute connected
 network 10.5.0.0/24 area 0.0.0.0
!

LER2 Configuration

wan.conf configuration

!
interface Loopback0
 ip address 5.5.5.2 255.255.255.255
!
interface Ethernet0
 description MPLS Core
 ip address 10.6.0.2 255.255.255.0
!
interface Ethernet1
 description Customer A Site 2
 ip address 10.21.0.1 255.255.255.0
!

Quagga configuration

interface eth0
 mpls ip
 mpls labelspace 0
!
mpls ldp
 egress connected
!
router ospf
 redistribute connected
 network 10.6.0.0/24 area 0.0.0.0
!

LSR1 Configuration

wan.conf configuration

!
interface Loopback0
 ip address 5.5.5.3 255.255.255.255
!
interface Ethernet0
 description MPLS Core
 ip address 10.5.0.1 255.255.255.0
!
interface Ethernet1
 description MPLS Core
 ip address 10.6.0.1 255.255.255.0
!

Quagga configuration

interface eth0
 mpls ip
 mpls labelspace 0
!
interface eth1
 mpls ip
 mpls labelspace 0
!
mpls ldp
 egress connected
!
router ospf
 redistribute connected
 network 10.5.0.0/24 area 0.0.0.0
 network 10.6.0.0/24 area 0.0.0.0
!

Verifying Configuration

LER1

LER1# sh ip ospf neighbor

    Neighbor ID Pri State           Dead Time Address         Interface            RXmtL RqstL DBsmL
5.5.5.3           1 Full/DR           33.167s 10.5.0.1        eth1:10.5.0.2            0     0     0

OSPF is running and connected to neighbor LSR1 at 5.5.5.3.

LER1# sh ldp neighbor
Peer LDP Ident: 5.5.5.3:0; Local LDP Ident: 5.5.5.1:0
        TCP connection: 10.5.0.2.12940 - 10.5.0.1.646
        State: OPERATIONAL; Msgs sent/recv: 62/181; UNSOLICITED
        Up time: 00:10:06
        LDP discovery sources:
          eth1
        Addresses bound to peer:
          10.5.0.1      5.5.5.3 10.0.0.252      10.6.0.1

LDP is running and connected to neighbor 5.5.5.3.

LER1# sh ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

K>* 0.0.0.0/0 via 10.0.0.1, eth0
C>* 5.5.5.1/32 is directly connected, dummy0
O>* 5.5.5.2/32 [110/20] via 10.5.0.1, eth1 (label 10052), 00:10:11
O>* 5.5.5.3/32 [110/20] via 10.5.0.1, eth1 (label 10042), 00:10:36
O   10.0.0.0/24 [110/20] via 10.5.0.1, eth1, 00:10:02
C>* 10.0.0.0/24 is directly connected, eth0
O   10.5.0.0/24 [110/10] is directly connected, eth1, 00:11:30
C>* 10.5.0.0/24 is directly connected, eth1
O>* 10.6.0.0/24 [110/20] via 10.5.0.1, eth1 (label 10044), 00:10:37
C>* 10.20.0.0/24 is directly connected, eth2
O>* 10.21.0.0/24 [110/20] via 10.5.0.1, eth1 (label 10053), 00:10:11
C>* 127.0.0.0/8 is directly connected, lo

MPLS labeled routes are installed for 5.5.5.2/32, 5.5.5.3/32, 10.6.0.0/24 and 10.21.0.0/24

LER1# sh mpls forwarding
Insegments:
  Lbl Spc  Label Owner
    0      10016 ldp
    0      10017 ldp
    0      10018 ldp
Total 3

Outsegments:
  Interface          Label Next Hop        Owner
  eth1               10040 10.5.0.1        ldp
  eth1               10042 10.5.0.1        ldp
  eth1               10044 10.5.0.1        ldp
  eth1               10052 10.5.0.1        ldp
  eth1               10053 10.5.0.1        ldp
Total 5

Cross Connects:

Total 0

LER1# sh ldp database
  5.5.5.1/32  local binding:   label: gen 10016
  10.20.0.0/24  local binding:   label: gen 10017
  10.5.0.0/24  local binding:   label: gen 10018
  5.5.5.3/32  remote binding:  label: gen 10042 lsr: 5.5.5.3:0 ingress
  10.5.0.0/24  remote binding:  no outlabel lsr: 5.5.5.3:0
  10.6.0.0/24  remote binding:  label: gen 10044 lsr: 5.5.5.3:0 ingress
  5.5.5.2/32  remote binding:  label: gen 10052 lsr: 5.5.5.3:0 ingress
  10.21.0.0/24  remote binding:  label: gen 10053 lsr: 5.5.5.3:0 ingress
  10.0.0.0/24  remote binding:  no outlabel lsr: 5.5.5.3:0

The MPLS forwarding table shows 3 incoming labels have been created. These correspond to the local bindings for 5.5.5.1/32, 10.20.0.0/24 and 10.5.0.0/24. There are also outgoing labels created corresponding to the remote bindings for 5.5.5.3/32, 10.6.0.0/24, 5.5.5.2/32 and 10.21.0.0/24. This Label Edge Router has no cross connects.

LER2

LER2# sh ip ospf neighbor

    Neighbor ID Pri State           Dead Time Address         Interface            RXmtL RqstL DBsmL
5.5.5.3           1 Full/DR           34.762s 10.6.0.1        eth1:10.6.0.2            0     0     0

OSPF is running and connected to neighbor LSR1 at 5.5.5.3.

LER2# sh ldp neighbor
Peer LDP Ident: 5.5.5.3:0; Local LDP Ident: 5.5.5.2:0
        TCP connection: 10.6.0.2.41445 - 10.6.0.1.646
        State: OPERATIONAL; Msgs sent/recv: 132/396; UNSOLICITED
        Up time: 00:30:14
        LDP discovery sources:
          eth1
        Addresses bound to peer:
          10.6.0.1      5.5.5.3 10.0.0.252      10.5.0.1

LDP is running and connected to neighbor 5.5.5.3.

LER2# sh ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

K>* 0.0.0.0/0 via 10.0.0.1, eth0
O>* 5.5.5.1/32 [110/20] via 10.6.0.1, eth1 (label 10069), 00:30:23
C>* 5.5.5.2/32 is directly connected, dummy0
O>* 5.5.5.3/32 [110/20] via 10.6.0.1, eth1 (label 10066), 00:30:23
O   10.0.0.0/24 [110/20] via 10.6.0.1, eth1, 00:30:19
C>* 10.0.0.0/24 is directly connected, eth0
O>* 10.5.0.0/24 [110/20] via 10.6.0.1, eth1 (label 10067), 00:30:24
O   10.6.0.0/24 [110/10] is directly connected, eth1, 00:31:14
C>* 10.6.0.0/24 is directly connected, eth1
O>* 10.20.0.0/24 [110/20] via 10.6.0.1, eth1 (label 10070), 00:30:23
C>* 10.21.0.0/24 is directly connected, eth2
C>* 127.0.0.0/8 is directly connected, lo

MPLS labeled routes are installed for 5.5.5.1/32, 5.5.5.3/32, 10.5.0.0/24 and 10.20.0.0/24

LER2# sh mpls forwarding
Insegments:
  Lbl Spc  Label Owner
    0      10018 ldp
    0      10019 ldp
    0      10020 ldp
    0      10021 ldp
Total 4

Outsegments:
  Interface          Label Next Hop        Owner
  eth1               10066 10.6.0.1        ldp
  eth1               10067 10.6.0.1        ldp
  eth1               10069 10.6.0.1        ldp
  eth1               10070 10.6.0.1        ldp
Total 4

Cross Connects:

Total 0

LER2# sh ldp database
  10.0.0.0/24  remote binding:  no outlabel lsr: 5.5.5.3:0
  5.5.5.3/32  remote binding:  label: gen 10066 lsr: 5.5.5.3:0 ingress
  10.5.0.0/24  remote binding:  label: gen 10067 lsr: 5.5.5.3:0 ingress
  10.6.0.0/24  remote binding:  no outlabel lsr: 5.5.5.3:0
  5.5.5.1/32  remote binding:  label: gen 10069 lsr: 5.5.5.3:0 ingress
  10.20.0.0/24  remote binding:  label: gen 10070 lsr: 5.5.5.3:0 ingress
  5.5.5.2/32  local binding:   label: gen 10018
  10.0.0.0/24  local binding:   label: gen 10019
  10.21.0.0/24  local binding:   label: gen 10020
  10.6.0.0/24  local binding:   label: gen 10021

The MPLS forwarding table shows 4 incoming labels have been created. These correspond to the local bindings for 5.5.5.2/32, 10.0.0.0/24, 10.21.0.0/24 and 10.6.0.0/24. There are also outgoing labels created corresponding to the remote bindings for 5.5.5.3/32, 10.5.0.0/24, 5.5.5.1/32 and 10.20.0.0/24. This Label Edge Router has no cross connects.

LSR1

LSR1# sh ip ospf neighbor

    Neighbor ID Pri State           Dead Time Address         Interface            RXmtL RqstL DBsmL
5.5.5.1           1 Full/Backup       39.977s 10.5.0.2        eth1:10.5.0.1            0     0     0
5.5.5.2           1 Full/Backup       33.293s 10.6.0.2        eth2:10.6.0.1            0     0     0

OSPF is running and connected to neighbor LER1 at 5.5.5.1 and LER2 and 5.5.5.2.

LSR1# sh ldp neighbor
Peer LDP Ident: 5.5.5.1:0; Local LDP Ident: 5.5.5.3:0
        TCP connection: 10.5.0.1.34306 - 10.5.0.2.35890
        State: OPERATIONAL; Msgs sent/recv: 175/513; UNSOLICITED
        Up time: 00:38:11
        LDP discovery sources:
          eth1
        Addresses bound to peer:
          10.5.0.2      5.5.5.1 10.0.0.253      10.20.0.1

Peer LDP Ident: 5.5.5.2:0; Local LDP Ident: 5.5.5.3:0
        TCP connection: 10.6.0.1.34306 - 10.6.0.2.58785
        State: OPERATIONAL; Msgs sent/recv: 167/482; UNSOLICITED
        Up time: 00:38:01
        LDP discovery sources:
          eth2
        Addresses bound to peer:
          10.6.0.2      5.5.5.2 10.0.0.251      10.21.0.1

LDP is running and connected to neighbor 5.5.5.1 and 5.5.5.2.

LSR1# sh ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

K>* 0.0.0.0/0 via 10.0.0.1, eth0
O>* 5.5.5.1/32 [110/20] via 10.5.0.2, eth1 (label 10016), 00:41:25
O>* 5.5.5.2/32 [110/20] via 10.6.0.2, eth2 (label 10018), 00:41:00
C>* 5.5.5.3/32 is directly connected, dummy0
O   10.0.0.0/24 [110/20] via 10.5.0.2, eth1, 00:40:46
                         via 10.6.0.2, eth2, 00:40:46
C>* 10.0.0.0/24 is directly connected, eth0
O   10.5.0.0/24 [110/10] is directly connected, eth1, 00:42:11
C>* 10.5.0.0/24 is directly connected, eth1
O   10.6.0.0/24 [110/10] is directly connected, eth2, 00:42:11
C>* 10.6.0.0/24 is directly connected, eth2
O>* 10.20.0.0/24 [110/20] via 10.5.0.2, eth1 (label 10017), 00:41:25
O>* 10.21.0.0/24 [110/20] via 10.6.0.2, eth2 (label 10020), 00:41:00
C>* 127.0.0.0/8 is directly connected, lo

MPLS labeled routes are installed for 5.5.5.1/32, 5.5.5.2/32, 10.20.0.0/24 and 10.21.0.0/24

LSR1# sh mpls forwarding
Insegments:
  Lbl Spc  Label Owner
    0      10042 ldp
    0      10043 ldp
    0      10044 ldp
    0      10052 ldp
    0      10053 ldp
    0      10066 ldp
    0      10067 ldp
    0      10068 ldp
    0      10069 ldp
    0      10070 ldp
Total 10

Outsegments:
  Interface          Label Next Hop        Owner
  eth2               10006 10.6.0.2        ldp
  eth2               10008 10.6.0.2        ldp
  eth1               10016 10.5.0.2        ldp
  eth1               10017 10.5.0.2        ldp
  eth2               10018 10.6.0.2        ldp
  eth2               10020 10.6.0.2        ldp
Total 6

Cross Connects:
  Lbl Spc  In Label Out Label Interface        Next Hop        Owner
    0         10069     10016 eth1             10.5.0.2        ldp
    0         10070     10017 eth1             10.5.0.2        ldp
Total 2

LSR1# sh ldp database
  5.5.5.3/32  local binding:   label: gen 10042
  10.5.0.0/24  local binding:   label: gen 10043
  10.6.0.0/24  local binding:   label: gen 10044
  5.5.5.1/32  remote binding:  label: gen 10016 lsr: 5.5.5.1:0 ingress
  10.20.0.0/24  remote binding:  label: gen 10017 lsr: 5.5.5.1:0 ingress
  10.5.0.0/24  remote binding:  no outlabel lsr: 5.5.5.1:0
  5.5.5.2/32  local binding:   label: gen 10052
  10.21.0.0/24  local binding:   label: gen 10053
  10.0.0.0/24  remote binding:  no outlabel lsr: 5.5.5.1:0
  5.5.5.3/32  local binding:   label: gen 10066
  10.5.0.0/24  local binding:   label: gen 10067
  10.6.0.0/24  local binding:   label: gen 10068
  5.5.5.1/32  local binding:   label: gen 10069
  10.20.0.0/24  local binding:   label: gen 10070
  5.5.5.2/32  remote binding:  label: gen 10018 lsr: 5.5.5.2:0 ingress
  10.0.0.0/24  remote binding:  no outlabel lsr: 5.5.5.2:0
  10.21.0.0/24  remote binding:  label: gen 10020 lsr: 5.5.5.2:0 ingress
  10.6.0.0/24  remote binding:  no outlabel lsr: 5.5.5.2:0

The MPLS forwarding table shows incoming labels have been created for the local bindings 5.5.5.3/32, 10.5.0.0/24, 10.6.0.0/24, 5.5.5.2/32, 10.21.0.0/24, 5.5.5.1/32 and 10.20.0.0/24. It appears that multiple labels are created for the same local binding however since this router is a label switch router it will use a new label to announce to each of its LDP peers. There are also outgoing labels created corresponding to the remote bindings for 5.5.5.1/32, 10.20.0.0/24, 5.5.5.2/32 and 10.21.0.0/24. No outgoing label is created for locally connected networks 10.5.0.0/24 and 10.6.0.0/24. Only routes that are exported via OSPF will be labeled. This Label Switch Router has 2 cross connects for 5.5.5.1/32 and 10.20.0.0/24.

LER2:/usr/local/sand# ping 10.20.0.1 -I 10.21.0.1
PING 10.20.0.1 (10.20.0.1) from 10.21.0.1 : 56(84) bytes of data.
64 bytes from 10.20.0.1: icmp_seq=1 ttl=63 time=2.12 ms
64 bytes from 10.20.0.1: icmp_seq=2 ttl=63 time=0.000 ms

--- 10.20.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.000/1.064/2.129/1.065 ms
LSR1:/usr/local/sand# tcpdump -n -i eth1 mpls -v
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 68 bytes
02:36:01.310626 MPLS (label 10017, exp 0, [S], ttl 63)
       IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: ICMP (1), length: 84) 10.21.0.1 > 10.20.0.1: ICMP echo request, id 27403, seq 1, length 64
02:36:01.310626 MPLS (label 10053, exp 0, [S], ttl 64)
       IP (tos 0x0, ttl  64, id 55715, offset 0, flags [none], proto: ICMP (1), length: 84) 10.20.0.1 > 10.21.0.1: ICMP echo reply, id 27403, seq 1, length 64
02:36:02.309085 MPLS (label 10017, exp 0, [S], ttl 63)
       IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: ICMP (1), length: 84) 10.21.0.1 > 10.20.0.1: ICMP echo request, id 27403, seq 2, length 64
02:36:02.309392 MPLS (label 10053, exp 0, [S], ttl 64)
       IP (tos 0x0, ttl  64, id 55716, offset 0, flags [none], proto: ICMP (1), length: 84) 10.20.0.1 > 10.21.0.1: ICMP echo reply, id 27403, seq 2, length 64

4 packets captured
4 packets received by filter
0 packets dropped by kernel
LSR1:/usr/local/sand# tcpdump -n -i eth2 mpls -v
tcpdump: listening on eth2, link-type EN10MB (Ethernet), capture size 68 bytes
02:36:56.940921 MPLS (label 10070, exp 0, [S], ttl 64)
        IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: ICMP (1), length: 84) 10.21.0.1 > 10.20.0.1: ICMP echo request, id 27659, seq 1, length 64
02:36:56.940921 MPLS (label 10020, exp 0, [S], ttl 63)
        IP (tos 0x0, ttl  63, id 55717, offset 0, flags [none], proto: ICMP (1), length: 84) 10.20.0.1 > 10.21.0.1: ICMP echo reply, id 27659, seq 1, length 64
02:36:57.940760 MPLS (label 10070, exp 0, [S], ttl 64)
        IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: ICMP (1), length: 84) 10.21.0.1 > 10.20.0.1: ICMP echo request, id 27659, seq 2, length 64
02:36:57.941836 MPLS (label 10020, exp 0, [S], ttl 63)
        IP (tos 0x0, ttl  63, id 55718, offset 0, flags [none], proto: ICMP (1), length: 84) 10.20.0.1 > 10.21.0.1: ICMP echo reply, id 27659, seq 2, length 64
Personal tools
Router software releases