MPLS
Basic Congiruation
mpls ldp router-id Loopback0 [force]
mpls label range 200 299
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0/0
ip address 10.0.12.2 255.255.255.0
mpls ip
!
interface Ethernet0/1
ip address 10.0.23.2 255.255.255.0
mpls ip
!
Load Sharing
When routing by FIB, the router uses source and destination address combination to determine the next hop. This behavior can be changed by the following command.
(config)# ip load-sharing per-packet
When routing by LFIB, the router determine the next hop depending on the payload. If the payload is IPv4 or IPv6 packet, it is routed by the source and destination address combination. If the payload is other packet type, it is routed by the lastest tag in the MPLS tagging.
Advanced Fetaure
PHP
The edge router will bind implicit null to the connected router to let the neighbor pop the tag so the edge router can lookup FIB directly. If this is not set, the router needs to lookup LFIB to pop the tag and then lookup FIB to do the route, which is very inefficient.
TTL Propagation
Use the following command to disable TTL propagation which is the default.
IOU2(config)#no mpls ip propagate-ttl
Explicit Null
The following command makes the router send explicit null(0) to other routers rather than implicit null(3) value which is the default.
IOU2(config)#mpls ldp explicit-null
Advertise to Specific Routers
! Disable advertising to all the neighbors
(config)# no mpls ldp advertise-labels
! Define which neigbhors to advertise
(config)# mpls ldp advertise-labels [for prefix-access-list [to peer-access-list]]
Command
Change the label protocol
(config)# mpls label protocol {ldp | tdp}
(config-if)# mpls label protocol {ldp | tdp | both}
IOU2#sh mpls ldp bindings
lib entry: 1.1.1.1/32, rev 2
local binding: label: 16
remote binding: lsr: 1.1.1.1:0, label: imp-null
remote binding: lsr: 3.3.3.3:0, label: 16
lib entry: 2.2.2.2/32, rev 4
local binding: label: imp-null
remote binding: lsr: 1.1.1.1:0, label: 16
remote binding: lsr: 3.3.3.3:0, label: 17
lib entry: 3.3.3.3/32, rev 6
local binding: label: 17
remote binding: lsr: 1.1.1.1:0, label: 17
remote binding: lsr: 3.3.3.3:0, label: imp-null
lib entry: 10.0.12.0/24, rev 8
local binding: label: imp-null
remote binding: lsr: 1.1.1.1:0, label: imp-null
remote binding: lsr: 3.3.3.3:0, label: 18
lib entry: 10.0.23.0/24, rev 10
local binding: label: imp-null
remote binding: lsr: 1.1.1.1:0, label: 18
remote binding: lsr: 3.3.3.3:0, label: imp-null
IOU2#sh mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label 1.1.1.1/32 0 Et0/0 10.0.12.1
17 Pop Label 3.3.3.3/32 0 Et0/1 10.0.23.3
IOU2#sh mpls ldp neighbor
Peer LDP Ident: 1.1.1.1:0; Local LDP Ident 2.2.2.2:0
TCP connection: 1.1.1.1.646 - 2.2.2.2.31656
State: Oper; Msgs sent/rcvd: 223/224; Downstream
Up time: 03:09:03
LDP discovery sources:
Ethernet0/0, Src IP addr: 10.0.12.1
Addresses bound to peer LDP Ident:
10.0.12.1 1.1.1.1
Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 2.2.2.2:0
TCP connection: 3.3.3.3.28092 - 2.2.2.2.646
State: Oper; Msgs sent/rcvd: 225/225; Downstream
Up time: 03:08:52
LDP discovery sources:
Ethernet0/1, Src IP addr: 10.0.23.3
Addresses bound to peer LDP Ident:
10.0.23.3 3.3.3.3
sh mpls ldp parameters