MPLS

在L3及L2 header之間插入Label。32-bit Label 中的 20-bit Label值用作決定Next hop。避免用recursive routing。LSR之間是LDP neighbor.


※ Router Role ※


mpls router role

※ 設定MPLS ※


mpls topo

R2(config)#int e0/0
R2(config-if)#mpls ip

show mpls forwarding table

Untagged 指此Router把所有Label除去, 因R1不屬於MPLS範圍。
Pop 指把Label的外層除去, 因R2知道R3擁有網段:192.168.34.0/24。提早一hop便Pop掉, 稱作PHP 或implicit null. 如想把label留到最後一hop, 要enable explicit null, 以保留QoS值。

R3(config)#mpls ldp explicit-null


※ Label Range ※


Default Label Range: 16 – 1,048,575

R2(config)#mpls label range 50 100


※ TDP ※


Cisco 專用TDP, 一般用LDP。

R2(config)#mpls label protocol tdp

mpls2

※ VRF Lite ※


vrf lite

R1(config)#ip vrf RED
R1(config)#ip vrf BLUE

R1(config)#int r e0/0, e0/3
R1(config-if)#ip vrf forwarding RED

R1(config)#int r e0/1-2
R1(config-if)#ip vrf forwarding BLUE

VRF-lite OSPF

R1(config)#router ospf 1 vrf RED
R1(config-router)#network 0.0.0.0 255.255.255.255 area 0

R1(config)#router ospf 1 vrf BLUE
R1(config-router)#network 0.0.0.0 255.255.255.255 area 0

R2(config)#router ospf 1
R2(config-router)#network 0.0.0.0 255.255.255.255 area 0

VRF-lite RIP

R1(config)#router rip
R1(config-router)#address-family ipv4 vrf RED
R1(config-router-af)#network 192.168.12.0
R1(config-router-af)#network 192.168.15.0
R1(config-router-af)#version 2
R1(config-router-af)#no auto-summary

R2(config)#router rip
R2(config-router)#network 192.168.12.0
R2(config-router)#network 172.16.0.0
R2(config-router)#version 2
R2(config-router)#no auto-summary

VRF-lite EIGRP

R1(config)#router eigrp 1
R1(config-router)#address-family ipv4 vrf BLUE
R1(config-router-af)#network 192.168.13.0 0.0.0.255
R1(config-router-af)#network 192.168.14.0 0.0.0.255
R1(config-router-af)#no auto-summary

R3(config)#router eigrp 10
R3(config-router)#network 192.168.13.0 0.0.0.255
R3(config-router)#network 172.16.1.0 0.0.0.255
R3(config-router)#no auto-summary

mpls4


※ MPLS VPN ※


mpls vpn

R3 及 R4 Routing Table沒料, 只用mpls table.
96 bit RD <自己AS number>:<任意number>, 區分公司。
64 bit RT 用作控制發出或接收的route.

//VRF
R2/R5(config)#ip vrf RED
R2/R5(config-vrf)#rd 65000:100
R2/R5(config-vrf)#route-target both 100:100

R2/R5(config)#ip vrf BLUE
R2/R5(config-vrf)#rd 65000:200
R2/R5(config-vrf)#route-target both 200:200

R2/R5(config)#int e0/x
R2/R5(config-if)#ip vrf forwarding RED
R2/R5(config)#int e0/x
R2/R5(config-if)#ip vrf forwarding BLUE

//MP-BGP
R2(config)#router bgp 65000
R2(config-router)#no synchronization //就算IGP沒對應route, 都要把iBGP route入routing table, 因在mpls network
R2(config-router)#neighbor 5.5.5.5 remote-as 65000
R2(config-router)#neighbor 5.5.5.5 update-source lo0
R2(config-router)#no auto-summary
R2(config-router)#address-family vpnv4
R2(config-router-af)#neighbor 5.5.5.5 activate
R2(config-router-af)#neighbor 5.5.5.5 send-community

R5(config)#router bgp 65000
R5(config-router)#no synchronization //就算IGP沒對應route, 都要把iBGP route入routing table, 因在mpls network
R5(config-router)#neighbor 2.2.2.2 remote-as 65000
R5(config-router)#neighbor 2.2.2.2 update-source lo0
R5(config-router)#no auto-summary
R5(config-router)#address-family vpnv4
R5(config-router-af)#neighbor 2.2.2.2 activate
R5(config-router-af)#neighbor 2.2.2.2 send-community

//RIP
R2(config)#router rip
R2(config-router)#address-family ipv4 vrf RED
R2(config-router)#network 192.168.27.0
R2(config-router)#no auto-summary
R2(config-router)#version 2

R7(config)#router rip
R7(config-router)#network 172.16.0.0
R7(config-router)#network 192.168.27.0
R7(config-router)#no auto-summary
R7(config-router)#version 2

//RIP Redistribute
R2/R5(config)#router bgp 65000
R2/R5(config-router)#address-family ipv4 vrf RED
R2/R5(config-router-af)#redistribute rip

R2/R5#show ip bgp vpnv4 vrf RED

R2/R5(config)#router rip
R2/R5(config-router)#address-family ipv4 vrf RED
R2/R5(config-router-af)#redistribute bgp 65000 metric 1

//EIGRP
R2(config)#router eigrp 1
R2(config-router)#address-family ipv4 vrf BLUE
R2(config-router-af)#autonomous-system 20
R2(config-router-af)#network 192.168.12.0 0.0.0.255
R2(config-router-af)#no auto-summary

R1(config)#router eigrp 20
R1(config-router)#network 192.168.12.0 0.0.0.255
R1(config-router)#network 172.16.1.0 0.0.0.255
R1(config-router)#no auto-summary

//EIGRP Redistribute
R2/R5(config)#router bgp 65000
R2/R5(config-router)#address-family ipv4 vrf BLUE
R2/R5(config-router-af)#redistribute eigrp 20

R2/R5#show ip bgp vpnv4 vrf BLUE

R2/R5(config)#router eigrp 1
R2/R5(config-router)#address-family ipv4 vrf BLUE
R2/R5(config-router-af)#redistribute bgp 65000 metric 1 0 0 1 1

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Open chat
💬How Can We Help?
Hello 👋How can we help you?