Configuring LDP

From ImageStream Router Documentation

Revision as of 18:55, 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 5.5.5.0/24 area 0.0.0.0
 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 5.5.5.0/24 area 0.0.0.0
 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 5.5.5.0/24 area 0.0.0.0
 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# sh ip ospf neighbor 

    Neighbor ID Pri State           Dead Time Address         Interface            RXmtL RqstL DBsmL
5.5.5.3           1 Full/Backup       37.665s 10.5.0.1        eth1:10.5.0.2            0     0     0
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.58045 - 10.5.0.1.646
        State: OPERATIONAL; Msgs sent/recv: 10514/31536; UNSOLICITED
        Up time: 1d 19:43:48
        LDP discovery sources:
          eth1
        Addresses bound to peer:
          10.5.0.1      5.5.5.3 10.0.0.252      10.6.0.1


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
  *    via 10.5.0.1, eth1 (label 13215), 1d19h49m
  *    via 10.5.0.1, eth1 (label 13214), 1d19h49m
O   10.0.0.0/24 [110/20] via 10.5.0.1, eth1, 1d19h43m
C>* 10.0.0.0/24 is directly connected, eth0
O   10.5.0.0/24 [110/10] is directly connected, eth1, 1d20h13m
C>* 10.5.0.0/24 is directly connected, eth1
  *    via 10.5.0.1, eth1 (label 13212), 1d20h13m
C>* 10.20.0.0/24 is directly connected, eth2
  *    via 10.5.0.1, eth1 (label 13213), 1d20h13m
C>* 127.0.0.0/8 is directly connected, lo
LER1# sh mpls forwarding
Insegments:
  Lbl Spc  Label Owner
    0      10011 ldp
    0      10947 ldp
    0      10948 ldp
    0      10949 ldp
Total 4

Outsegments:
  Interface          Label Next Hop        Owner
  eth1               12599 10.5.0.1        ldp
  eth1               12662 10.5.0.1        ldp
  eth1               13212 10.5.0.1        ldp
  eth1               13213 10.5.0.1        ldp
  eth1               13214 10.5.0.1        ldp
  eth1               13215 10.5.0.1        ldp
Total 6

Cross Connects:

Total 0
LER2# sh ip ospf neighbor 

    Neighbor ID Pri State           Dead Time Address         Interface            RXmtL RqstL DBsmL
5.5.5.3           1 Full/Backup       31.762s 10.6.0.1        eth1:10.6.0.2            0     0     0
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.60038 - 10.6.0.1.646
        State: OPERATIONAL; Msgs sent/recv: 10514/31539; UNSOLICITED
        Up time: 1d 19:46:15
        LDP discovery sources:
          eth1
        Addresses bound to peer:
          10.6.0.1      5.5.5.3 10.0.0.252      10.5.0.1
 
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
  *    via 10.6.0.1, eth1 (label 13223), 1d19h52m
C>* 5.5.5.2/32 is directly connected, dummy0
  *    via 10.6.0.1, eth1 (label 13225), 1d19h52m
O   10.0.0.0/24 [110/20] via 10.6.0.1, eth1, 1d19h46m
C>* 10.0.0.0/24 is directly connected, eth0
  *    via 10.6.0.1, eth1 (label 13221), 1d20h15m
O   10.6.0.0/24 [110/10] is directly connected, eth1, 1d20h31m
C>* 10.6.0.0/24 is directly connected, eth1
  *    via 10.6.0.1, eth1 (label 13224), 1d20h15m
C>* 10.21.0.0/24 is directly connected, eth2
C>* 127.0.0.0/8 is directly connected, lo
LER2# sh mpls forwarding
Insegments:
  Lbl Spc  Label Owner
    0      11074 ldp
    0      11075 ldp
    0      11076 ldp
    0      11077 ldp
Total 4

Outsegments:
  Interface          Label Next Hop        Owner
  eth1               10023 10.6.0.1        ldp
  eth1               10025 10.6.0.1        ldp
  eth1               10056 10.6.0.1        ldp
  eth1               10058 10.6.0.1        ldp
  eth1               10065 10.6.0.1        ldp
  eth1               10066 10.6.0.1        ldp
  eth1               13221 10.6.0.1        ldp
  eth1               13223 10.6.0.1        ldp
  eth1               13224 10.6.0.1        ldp
  eth1               13225 10.6.0.1        ldp
Total 10

Cross Connects:

Total 0
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