Configuring LDP

From ImageStream Router Documentation

(Difference between revisions)
Jump to: navigation, search
(Verifying Configuration)
Line 29: Line 29:
  router ospf
  router ospf
   redistribute connected
   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.5.0.0/24 area 0.0.0.0
  !
  !
Line 58: Line 57:
  router ospf
  router ospf
   redistribute connected
   redistribute connected
-
  network 5.5.5.0/24 area 0.0.0.0
 
   network 10.6.0.0/24 area 0.0.0.0
   network 10.6.0.0/24 area 0.0.0.0
  !
  !
Line 91: Line 89:
  router ospf
  router ospf
   redistribute connected
   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.5.0.0/24 area 0.0.0.0
   network 10.6.0.0/24 area 0.0.0.0
   network 10.6.0.0/24 area 0.0.0.0
Line 99: Line 96:
===LER1===
===LER1===
-
  LER1# sh ip ospf neighbor  
+
  LER1# sh ip ospf neighbor
   
   
     Neighbor ID Pri State          Dead Time Address        Interface            RXmtL RqstL DBsmL
     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
+
  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.
OSPF is running and connected to neighbor LSR1 at 5.5.5.3.
  LER1# sh ldp neighbor
  LER1# sh ldp neighbor
  Peer LDP Ident: 5.5.5.3:0; Local LDP Ident: 5.5.5.1:0
  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
+
         TCP connection: 10.5.0.2.12940 - 10.5.0.1.646
-
         State: OPERATIONAL; Msgs sent/recv: 10514/31536; UNSOLICITED
+
         State: OPERATIONAL; Msgs sent/recv: 62/181; UNSOLICITED
-
         Up time: 1d 19:43:48
+
         Up time: 00:10:06
         LDP discovery sources:
         LDP discovery sources:
           eth1
           eth1
         Addresses bound to peer:
         Addresses bound to peer:
           10.5.0.1      5.5.5.3 10.0.0.252      10.6.0.1
           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.
LDP is running and connected to neighbor 5.5.5.3.
Line 124: Line 121:
  K>* 0.0.0.0/0 via 10.0.0.1, eth0
  K>* 0.0.0.0/0 via 10.0.0.1, eth0
  C>* 5.5.5.1/32 is directly connected, dummy0
  C>* 5.5.5.1/32 is directly connected, dummy0
-
  *   via 10.5.0.1, eth1 (label 13215), 1d19h49m
+
O>* 5.5.5.2/32 [110/20] via 10.5.0.1, eth1 (label 10052), 00:10:11
-
  *   via 10.5.0.1, eth1 (label 13214), 1d19h49m
+
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, 1d19h43m
+
  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
  C>* 10.0.0.0/24 is directly connected, eth0
-
  O  10.5.0.0/24 [110/10] is directly connected, eth1, 1d20h13m
+
  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
  C>* 10.5.0.0/24 is directly connected, eth1
-
  *   via 10.5.0.1, eth1 (label 13212), 1d20h13m
+
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
  C>* 10.20.0.0/24 is directly connected, eth2
-
  *   via 10.5.0.1, eth1 (label 13213), 1d20h13m
+
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
  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
  LER1# sh mpls forwarding
  Insegments:
  Insegments:
   Lbl Spc  Label Owner
   Lbl Spc  Label Owner
-
     0      10011 ldp
+
     0      10016 ldp
-
     0      10947 ldp
+
     0      10017 ldp
-
     0      10948 ldp
+
     0      10018 ldp
-
    0      10949 ldp
+
  Total 3
-
  Total 4
+
   
   
  Outsegments:
  Outsegments:
   Interface          Label Next Hop        Owner
   Interface          Label Next Hop        Owner
-
   eth1              12599 10.5.0.1        ldp
+
   eth1              10040 10.5.0.1        ldp
-
   eth1              12662 10.5.0.1        ldp
+
   eth1              10042 10.5.0.1        ldp
-
   eth1              13212 10.5.0.1        ldp
+
   eth1              10044 10.5.0.1        ldp
-
   eth1              13213 10.5.0.1        ldp
+
   eth1              10052 10.5.0.1        ldp
-
   eth1              13214 10.5.0.1        ldp
+
   eth1              10053 10.5.0.1        ldp
-
  eth1              13215 10.5.0.1        ldp
+
  Total 5
-
  Total 6
+
   
   
  Cross Connects:
  Cross Connects:
   
   
  Total 0
  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# sh ip ospf neighbor  
  LER2# sh ip ospf neighbor  
Line 177: Line 189:
   
   
  K>* 0.0.0.0/0 via 10.0.0.1, eth0
  K>* 0.0.0.0/0 via 10.0.0.1, eth0
-
  *   via 10.6.0.1, eth1 (label 13223), 1d19h52m
+
O>* 5.5.5.1/32 [110/20] via 10.5.0.2, eth1 (label 10026), 00:00:44
-
  C>* 5.5.5.2/32 is directly connected, dummy0
+
  O>* 5.5.5.2/32 [110/20] via 10.6.0.2, eth2 (label 10152), 00:00:38
-
  *    via 10.6.0.1, eth1 (label 13225), 1d19h52m
+
C>* 5.5.5.3/32 is directly connected, dummy0
-
  O  10.0.0.0/24 [110/20] via 10.6.0.1, eth1, 1d19h46m
+
  O  10.0.0.0/24 [110/20] via 10.6.0.2, eth2, 00:00:24
 +
                          via 10.5.0.2, eth1, 00:00:24
  C>* 10.0.0.0/24 is directly connected, eth0
  C>* 10.0.0.0/24 is directly connected, eth0
-
  *    via 10.6.0.1, eth1 (label 13221), 1d20h15m
+
10.5.0.0/24 [110/10] is directly connected, eth1, 00:00:57
-
  O  10.6.0.0/24 [110/10] is directly connected, eth1, 1d20h31m
+
C>* 10.5.0.0/24 is directly connected, eth1
-
  C>* 10.6.0.0/24 is directly connected, eth1
+
  O  10.6.0.0/24 [110/10] is directly connected, eth2, 00:00:57
-
  *   via 10.6.0.1, eth1 (label 13224), 1d20h15m
+
  C>* 10.6.0.0/24 is directly connected, eth2
-
  C>* 10.21.0.0/24 is directly connected, eth2
+
O>* 10.20.0.0/24 [110/20] via 10.5.0.2, eth1 (label 10028), 00:00:44
 +
  O>* 10.21.0.0/24 [110/20] via 10.6.0.2, eth2 (label 10150), 00:00:38
  C>* 127.0.0.0/8 is directly connected, lo
  C>* 127.0.0.0/8 is directly connected, lo
 +
   
   
  LER2# sh mpls forwarding
  LER2# sh mpls forwarding

Revision as of 21:11, 25 November 2009

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# 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
O>* 5.5.5.1/32 [110/20] via 10.5.0.2, eth1 (label 10026), 00:00:44
O>* 5.5.5.2/32 [110/20] via 10.6.0.2, eth2 (label 10152), 00:00:38
C>* 5.5.5.3/32 is directly connected, dummy0
O   10.0.0.0/24 [110/20] via 10.6.0.2, eth2, 00:00:24
                         via 10.5.0.2, eth1, 00:00:24
C>* 10.0.0.0/24 is directly connected, eth0
O   10.5.0.0/24 [110/10] is directly connected, eth1, 00:00:57
C>* 10.5.0.0/24 is directly connected, eth1
O   10.6.0.0/24 [110/10] is directly connected, eth2, 00:00:57
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 10028), 00:00:44
O>* 10.21.0.0/24 [110/20] via 10.6.0.2, eth2 (label 10150), 00:00:38
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