Configuring LDP

From ImageStream Router Documentation

Revision as of 21:22, 25 November 2009 by Syoder (Talk | contribs)
Jump to: navigation, search

Contents

LDP Configuration Example 1

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/DR           39.563s 10.5.0.2        eth1:10.5.0.1            0     0     0
5.5.5.2           1 Full/DR           39.209s 10.6.0.2        eth2:10.6.0.1            0     0     0
LSR1# sh ldp neighbor
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.34538
        State: OPERATIONAL; Msgs sent/recv: 10533/31591; UNSOLICITED
        Up time: 1d 19:50:32
        LDP discovery sources:
          eth2
        Addresses bound to peer:
          10.6.0.2      5.5.5.2 10.0.0.251      10.21.0.1

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.48610
        State: OPERATIONAL; Msgs sent/recv: 10543/31619; UNSOLICITED
        Up time: 1d 19:50:37
        LDP discovery sources:
          eth1
        Addresses bound to peer:
          10.5.0.2      5.5.5.1 10.0.0.253      10.20.0.1



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
  *    via 10.5.0.2, eth1 (label 10949), 1d19h56m
  *    via 10.6.0.2, eth2 (label 11076), 1d19h55m
C>* 5.5.5.3/32 is directly connected, dummy0
O   10.0.0.0/24 [110/20] via 10.5.0.2, eth1, 1d19h50m
                         via 10.6.0.2, eth2, 1d19h50m
C>* 10.0.0.0/24 is directly connected, eth0
O   10.5.0.0/24 [110/10] is directly connected, eth1, 1d20h20m
C>* 10.5.0.0/24 is directly connected, eth1
O   10.6.0.0/24 [110/10] is directly connected, eth2, 1d20h20m
C>* 10.6.0.0/24 is directly connected, eth2
  *    via 10.5.0.2, eth1 (label 10948), 1d20h19m
  *    via 10.6.0.2, eth2 (label 11075), 1d20h19m
C>* 127.0.0.0/8 is directly connected, lo

LSR1# sh mpls forwarding
Insegments:
  Lbl Spc  Label Owner
    0      13211 ldp
    0      13212 ldp
    0      13213 ldp
    0      13214 ldp
    0      13215 ldp
    0      13221 ldp
    0      13222 ldp
    0      13223 ldp
    0      13224 ldp
    0      13225 ldp
    0      13226 ldp
Total 11

Outsegments:
  Interface          Label Next Hop        Owner
  eth2               10877 10.6.0.2        ldp
  eth1               10948 10.5.0.2        ldp
  eth1               10949 10.5.0.2        ldp
  eth2               11075 10.6.0.2        ldp
  eth2               11076 10.6.0.2        ldp
Total 5

Cross Connects:
  Lbl Spc  In Label Out Label Interface        Next Hop        Owner
    0         13223     10949 eth1             10.5.0.2        ldp
    0         13224     10948 eth1             10.5.0.2        ldp
Total 2


LER1:/usr/local/sand# ping 5.5.5.2 -I 5.5.5.1
PING 5.5.5.2 (5.5.5.2) from 5.5.5.1 : 56(84) bytes of data.
64 bytes from 5.5.5.2: icmp_seq=1 ttl=63 time=0.587 ms
64 bytes from 5.5.5.2: icmp_seq=2 ttl=63 time=0.522 ms

--- 5.5.5.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.522/0.554/0.587/0.040 ms
LSR1:/usr/local/sand# tcpdump -n -i eth2 mpls -v
tcpdump: listening on eth2, link-type EN10MB (Ethernet), capture size 68 bytes
23:38:23.447911 MPLS (label 11076, exp 0, [S], ttl 63)
        IP (tos 0x0, ttl  63, id 0, offset 0, flags [DF], proto: ICMP (1), length: 84) 5.5.5.1 > 5.5.5.2: ICMP echo request, id 17677, seq 1, length 64
23:38:23.447911 MPLS (label 13223, exp 0, [S], ttl 64)
        IP (tos 0x0, ttl  64, id 32161, offset 0, flags [none], proto: ICMP (1), length: 84) 5.5.5.2 > 5.5.5.1: ICMP echo reply, id 17677, seq 1, length 64
23:38:24.451179 MPLS (label 11076, exp 0, [S], ttl 63)
        IP (tos 0x0, ttl  63, id 0, offset 0, flags [DF], proto: ICMP (1), length: 84) 5.5.5.1 > 5.5.5.2: ICMP echo request, id 17677, seq 2, length 64
23:38:24.451378 MPLS (label 13223, exp 0, [S], ttl 64)
        IP (tos 0x0, ttl  64, id 32162, offset 0, flags [none], proto: ICMP (1), length: 84) 5.5.5.2 > 5.5.5.1: ICMP echo reply, id 17677, seq 2, length 64
Personal tools
Router software releases