MPLS
-
IP address yapılandırması.
Cihazların IP address ve mask adreslerini ayarlayalım.
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname S1[S1]interface Vlanif 1[S1-Vlanif1]ip address 10.0.1.2 24 |
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname R1[R1]interface GigabitEthernet 0/0/1[R1-GigabitEthernet0/0/1]ip address 10.0.1.1 24[R1-GigabitEthernet0/0/1]quit[R1]interface s1/0/0[R1-Serial1/0/0]ip address 10.0.12.1 24[R1-Serial1/0/0]quit[R1]interface loopback 0[R1-LoopBack0]ip address 2.2.2.2 24 |
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname R2[R2]interface s1/0/0[R2-Serial1/0/0]ip address 10.0.12.2 24[R2-Serial1/0/0]quit[R2]interface s2/0/0[R2-Serial2/0/0]ip address 10.0.23.2 24[R2-Serial2/0/0]quit[R2]interface loopback 0[R2-LoopBack0]ip address 3.3.3.3 24 |
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname R3[R3]interface GigabitEthernet 0/0/2[R3-GigabitEthernet0/0/2]ip address 10.0.2.1 24[R3-GigabitEthernet0/0/2]quit[R3]interface s2/0/0[R3-Serial2/0/0]ip address 10.0.23.3 24[R3-Serial2/0/0]quit[R3]interface loopback 0[R3-LoopBack0]ip address 4.4.4.4 24 |
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname S2[S2]interface Vlanif 1[S2-Vlanif1]ip address 10.0.2.2 24 |
Yapılandırmayı tamamladıktan sonra doğrudan kontrol edelim.
-
Single-area OSPF yapılandıralım.
10.0.12.0/24, 10.0.23.0/24, 10.0.1.0/24 ve 10.0.2.0/24 dahil olmak üzere networku yapılandıralım ve OSPF area 0 olarak ayarlayalım.
[S1]ospf 1 router-id 1.1.1.1[S1-ospf-1]area 0[S1-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255 |
[R1]ospf 1 router-id 2.2.2.2[R1-ospf-1]area 0[R1-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255[R1-ospf-1-area-0.0.0.0]network 10.0.12.0 0.0.0.255[R1-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255 |
[R2]ospf 1 router-id 3.3.3.3[R2-ospf-1]area 0[R2-ospf-1-area-0.0.0.0]network 10.0.12.0 0.0.0.255[R2-ospf-1-area-0.0.0.0]network 10.0.23.0 0.0.0.255[R2-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255 |
[R3]ospf 1 router-id 4.4.4.4[R3-ospf-1]area 0[R3-ospf-1-area-0.0.0.0]net[R3-ospf-1-area-0.0.0.0]network 10.0.23.0 0.0.0.255[R3-ospf-1-area-0.0.0.0]network 10.0.2.0 0.0.0.255[R3-ospf-1-area-0.0.0.0]network 4.4.4.0 0.0.0.255 |
[S2]ospf 1 router-id 5.5.5.5[S2-ospf-1]area 0[S2-ospf-1-area-0.0.0.0]network 10.0.2.0 0.0.0.255 |
Yapılandırma bittikten sonra routing tablolarını ve network bağlantılarını kontrol edelim.
[R2]ping 10.0.1.2PING 10.0.1.2:56 data bytes, press CTRL_C to breakReply from 10.0.1.2:bytes=56 Sequence=1 ttl=253 time=36 msReply from 10.0.1.2:bytes=56 Sequence=2 ttl=253 time=31 msReply from 10.0.1.2:bytes=56 Sequence=3 ttl=253 time=31 msReply from 10.0.1.2:bytes=56 Sequence=4 ttl=253 time=31 msReply from 10.0.1.2:bytes=56 Sequence=5 ttl=253 time=31 ms— 10.0.1.2 ping statistics —5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/32/36 ms |
[R2]ping 10.0.2.2PING 10.0.2.2:56 data bytes, press CTRL_C to breakReply from 10.0.2.2:bytes=56 Sequence=1 ttl=253 time=38 msReply from 10.0.2.2:bytes=56 Sequence=2 ttl=253 time=33 msReply from 10.0.2.2:bytes=56 Sequence=3 ttl=253 time=33 msReply from 10.0.2.2:bytes=56 Sequence=4 ttl=253 time=33 msReply from 10.0.2.2:bytes=56 Sequence=5 ttl=253 time=33 ms— 10.0.2.2 ping statistics —5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 33/34/38 ms |
OSPF in routing tablosuna bakmak için display ip routing-table komutunu çalıştıralım.
[R2]display ip routing-tableRoute Flags:R – relay, D – download to fib—————————————————————————-Routing Tables:PublicDestinations :14 Routes : 14Destination/Mask Proto Pre Cost Flags NextHop Interface10.0.1.0/24 OSPF 10 1563 D 10.0.12.1 Serial1/0/010.0.2.0/24 OSPF 10 1563 D 10.0.23.3 Serial2/0/010.0.12.0/24 Direct 0 0 D 10.0.12.2 Serial1/0/010.0.12.1/32 Direct 0 0 D 10.0.12.1 Serial1/0/010.0.12.2/32 Direct 0 0 D 127.0.0.1 InLoopBack010.0.12.255/32 Direct 0 0 D 127.0.0.1 InLoopBack010.0.23.0/24 Direct 0 0 D 10.0.23.2 Serial2/0/010.0.23.2/32 Direct 0 0 D 127.0.0.1 InLoopBack010.0.23.3/32 Direct 0 0 D 10.0.23.3 Serial2/0/010.0.23.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 |
-
MPLS LDP konfigürasyonu.
MPLS ve LDP de global olarak LSR i ayarlayalım.
[R1]mpls lsr-id 2.2.2.2[R1]mplsInfo:Mpls starting, please wait… OK![R1-mpls]mpls ldp |
[R2]mpls lsr-id 3.3.3.3 c[R2]mplsInfo:Mpls starting, please wait… OK![R2-mpls]mpls ldp |
[R3]mpls lsr-id 4.4.4.4[R3]mplsInfo:Mpls starting, please wait… OK![R3-mpls]mpls ldp |
Cihazlarda MPLS ve LDP etkinleştirelim.
[R1]interface Serial 1/0/0[R1-Serial1/0/0]mpls[R1-Serial1/0/0]mpls ldp |
[R2]interface Serial 1/0/0[R2-Serial1/0/0]mpls[R2-Serial1/0/0]mpls ldp[R2-Serial1/0/0]interface Serial 2/0/0[R2-Serial2/0/0]mpls[R2-Serial2/0/0]mpls ldp |
[R3]interface Serial 2/0/0[R3-Serial2/0/0]mpls[R3-Serial2/0/0]mpls ldp |
Yapılandırmayı tamamladıktan sonra cihazların MPLS durumlarına display mpls ldp session komutu ile bakalım.
R1, R2 ve R3 arasında local LDP oturumun durumu Operasyonel olduğuna bakalım.
[R1]display mpls ldp sessionLDP Session(s) in Public NetworkCodes:LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)A ‘*’ before a session means the session is being deleted.—————————————————————————-PeerID Status LAM SsnRole SsnAge KASent/Rcv—————————————————————————-3.3.3.3:0 Operational DU Passive 0000:00:10 41/41—————————————————————————- TOTAL:1 session(s) Found.[R2]display mpls ldp sessionLDP Session(s) in Public NetworkCodes:LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)A ‘*’ before a session means the session is being deleted.—————————————————————————-PeerID Status LAM SsnRole SsnAge KASent/Rcv—————————————————————————-2.2.2.2:0 Operational DU Active 0000:00:11 46/464.4.4.4:0 Operational DU Passive 0000:00:10 43/43—————————————————————————-TOTAL:2 session(s) Found. |
[R3]display mpls ldp sessionLDP Session(s) in Public NetworkCodes:LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)A ‘*’ before a session means the session is being deleted.—————————————————————————-PeerID Status LAM SsnRole SsnAge KASent/Rcv—————————————————————————-3.3.3.3:0 Operational DU Active 0000:00:11 46/46—————————————————————————-TOTAL:1 session(s) Found. |
-
LSP’leri LDP kullanarak ayarlayalım.
Display mpls ldp lsp komutunu LSR konfigürasyonunu görüntülemek için çalıştıralım.
[R1]display mpls ldp lspLDP LSP Information—————————————————————————-DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface—————————————————————————-2.2.2.2/32 3/NULL 3.3.3.3 127.0.0.1 InLoop0*2.2.2.2/32 Liberal/1024 DS/3.3.3.33.3.3.3/32 NULL/3 – 10.0.12.2 S1/0/03.3.3.3/32 1024/3 3.3.3.3 10.0.12.2 S1/0/04.4.4.4/32 NULL/1025 – 10.0.12.2 S1/0/04.4.4.4/32 1025/1025 3.3.3.3 10.0.12.2 S1/0/0—————————————————————————-TOTAL:5 Normal LSP(s) Found.TOTAL:1 Liberal LSP(s) Found.TOTAL:0 Frr LSP(s) Found.A ‘*’ before an LSP means the LSP is not establishedA ‘*’ before a Label means the USCB or DSCB is staleA ‘*’ before a UpstreamPeer means the session is in GR stateA ‘*’ before a DS means the session is in GR stateA ‘*’ before a NextHop means the LSP is FRR LSP |
[R2]display mpls ldp lspLDP LSP Information—————————————————————————-DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface—————————————————————————-2.2.2.2/32 NULL/3 – 10.0.12.1 S1/0/02.2.2.2/32 1024/3 2.2.2.2 10.0.12.1 S1/0/02.2.2.2/32 1024/3 4.4.4.4 10.0.12.1 S1/0/0*2.2.2.2/32 Liberal/1024 DS/4.4.4.43.3.3.3/32 3/NULL 2.2.2.2 127.0.0.1 InLoop03.3.3.3/32 3/NULL 4.4.4.4 127.0.0.1 InLoop0*3.3.3.3/32 Liberal/1024 DS/2.2.2.2*3.3.3.3/32 Liberal/1025 DS/4.4.4.44.4.4.4/32 NULL/3 – 10.0.23.3 S2/0/04.4.4.4/32 1025/3 2.2.2.2 10.0.23.3 S2/0/04.4.4.4/32 1025/3 4.4.4.4 10.0.23.3 S2/0/0*4.4.4.4/32 Liberal/1025 DS/2.2.2.2—————————————————————————-TOTAL:8 Normal LSP(s) Found.TOTAL:4 Liberal LSP(s) Found.TOTAL:0 Frr LSP(s) Found.A ‘*’ before an LSP means the LSP is not establishedA ‘*’ before a Label means the USCB or DSCB is staleA ‘*’ before a UpstreamPeer means the session is in GR stateA ‘*’ before a DS means the session is in GR stateA ‘*’ before a NextHop means the LSP is FRR LSP |
[R3]display mpls ldp lspLDP LSP Information—————————————————————————-DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface—————————————————————————-2.2.2.2/32 NULL/1024 – 10.0.23.2 S2/0/02.2.2.2/32 1024/1024 3.3.3.3 10.0.23.2 S2/0/03.3.3.3/32 NULL/3 – 10.0.23.2 S2/0/03.3.3.3/32 1025/3 3.3.3.3 10.0.23.2 S2/0/04.4.4.4/32 3/NULL 3.3.3.3 127.0.0.1 InLoop0*4.4.4.4/32 Liberal/1025 DS/3.3.3.3—————————————————————————-TOTAL:5 Normal LSP(s) Found.TOTAL:1 Liberal LSP(s) Found.TOTAL:0 Frr LSP(s) Found.A ‘*’ before an LSP means the LSP is not establishedA ‘*’ before a Label means the USCB or DSCB is staleA ‘*’ before a UpstreamPeer means the session is in GR stateA ‘*’ before a DS means the session is in GR stateA ‘*’ before a NextHop means the LSP is FRR LSP |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,
[R1]mpls[R1-mpls]lsp-trigger all |
[R2]mpls[R2-mpls]lsp-trigger all |
[R3]mpls[R3-mpls]lsp-trigger all |
Kurulan LDP LSP konfigürasyonunu görüntülemek için display mpls ldp lsp komutunu kullanalım.
[R1]display mpls ldp lspLDP LSP Information—————————————————————————-DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface—————————————————————————-2.2.2.0/24 3/NULL 3.3.3.3 2.2.2.2 Loop02.2.2.2/32 3/NULL 3.3.3.3 127.0.0.1 InLoop0*2.2.2.2/32 Liberal/1024 DS/3.3.3.3*3.3.3.0/24 Liberal/3 DS/3.3.3.33.3.3.3/32 NULL/3 – 10.0.12.2 S1/0/03.3.3.3/32 1024/3 3.3.3.3 10.0.12.2 S1/0/04.4.4.4/32 NULL/1025 – 10.0.12.2 S1/0/04.4.4.4/32 1025/1025 3.3.3.3 10.0.12.2 S1/0/010.0.1.0/24 3/NULL 3.3.3.3 10.0.1.1 GE0/0/1*10.0.1.0/24 Liberal/1026 DS/3.3.3.310.0.2.0/24 NULL/1027 – 10.0.12.2 S1/0/010.0.2.0/24 1027/1027 3.3.3.3 10.0.12.2 S1/0/010.0.12.0/24 3/NULL 3.3.3.3 10.0.12.1 S1/0/0*10.0.12.0/24 Liberal/3 DS/3.3.3.310.0.23.0/24 NULL/3 – 10.0.12.2 S1/0/010.0.23.0/24 1026/3 3.3.3.3 10.0.12.2 S1/0/0—————————————————————————-TOTAL:12 Normal LSP(s) Found.TOTAL:4 Liberal LSP(s) Found.TOTAL:0 Frr LSP(s) Found.A ‘*’ before an LSP means the LSP is not establishedA ‘*’ before a Label means the USCB or DSCB is staleA ‘*’ before a UpstreamPeer means the session is in GR stateA ‘*’ before a DS means the session is in GR stateA ‘*’ before a NextHop means the LSP is FRR LSP |
[R2]display mpls ldp lspLDP LSP Information—————————————————————————-DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface—————————————————————————-*2.2.2.0/24 Liberal/3 DS/2.2.2.22.2.2.2/32 NULL/3 – 10.0.12.1 S1/0/02.2.2.2/32 1024/3 2.2.2.2 10.0.12.1 S1/0/02.2.2.2/32 1024/3 4.4.4.4 10.0.12.1 S1/0/0*2.2.2.2/32 Liberal/1024 DS/4.4.4.43.3.3.0/24 3/NULL 2.2.2.2 3.3.3.3 Loop03.3.3.0/24 3/NULL 4.4.4.4 3.3.3.3 Loop03.3.3.3/32 3/NULL 2.2.2.2 127.0.0.1 InLoop03.3.3.3/32 3/NULL 4.4.4.4 127.0.0.1 InLoop0*3.3.3.3/32 Liberal/1024 DS/2.2.2.2*3.3.3.3/32 Liberal/1025 DS/4.4.4.4*4.4.4.0/24 Liberal/3 DS/4.4.4.44.4.4.4/32 NULL/3 – 10.0.23.3 S2/0/04.4.4.4/32 1025/3 2.2.2.2 10.0.23.3 S2/0/04.4.4.4/32 1025/3 4.4.4.4 10.0.23.3 S2/0/0*4.4.4.4/32 Liberal/1025 DS/2.2.2.210.0.1.0/24 NULL/3 – 10.0.12.1 S1/0/010.0.1.0/24 1026/3 2.2.2.2 10.0.12.1 S1/0/010.0.1.0/24 1026/3 4.4.4.4 10.0.12.1 S1/0/0*10.0.1.0/24 Liberal/1026 DS/4.4.4.410.0.2.0/24 NULL/3 – 10.0.23.3 S2/0/010.0.2.0/24 1027/3 2.2.2.2 10.0.23.3 S2/0/010.0.2.0/24 1027/3 4.4.4.4 10.0.23.3 S2/0/0*10.0.2.0/24 Liberal/1027 DS/2.2.2.210.0.12.0/24 3/NULL 2.2.2.2 10.0.12.2 S1/0/010.0.12.0/24 3/NULL 4.4.4.4 10.0.12.2 S1/0/0*10.0.12.0/24 Liberal/3 DS/2.2.2.2*10.0.12.0/24 Liberal/1027 DS/4.4.4.410.0.23.0/24 3/NULL 2.2.2.2 10.0.23.2 S2/0/010.0.23.0/24 3/NULL 4.4.4.4 10.0.23.2 S2/0/0*10.0.23.0/24 Liberal/1026 DS/2.2.2.2*10.0.23.0/24 Liberal/3 DS/4.4.4.4—————————————————————————-TOTAL:20 Normal LSP(s) Found.TOTAL:12 Liberal LSP(s) Found.TOTAL:0 Frr LSP(s) Found.A ‘*’ before an LSP means the LSP is not establishedA ‘*’ before a Label means the USCB or DSCB is staleA ‘*’ before a UpstreamPeer means the session is in GR stateA ‘*’ before a DS means the session is in GR stateA ‘*’ before a NextHop means the LSP is FRR LSP |
[R3]display mpls ldp lspLDP LSP Information—————————————————————————-DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface—————————————————————————-2.2.2.2/32 NULL/1024 – 10.0.23.2 S2/0/02.2.2.2/32 1024/1024 3.3.3.3 10.0.23.2 S2/0/0*3.3.3.0/24 Liberal/3 DS/3.3.3.33.3.3.3/32 NULL/3 – 10.0.23.2 S2/0/03.3.3.3/32 1025/3 3.3.3.3 10.0.23.2 S2/0/04.4.4.0/24 3/NULL 3.3.3.3 4.4.4.4 Loop04.4.4.4/32 3/NULL 3.3.3.3 127.0.0.1 InLoop0*4.4.4.4/32 Liberal/1025 DS/3.3.3.310.0.1.0/24 NULL/1026 – 10.0.23.2 S2/0/010.0.1.0/24 1026/1026 3.3.3.3 10.0.23.2 S2/0/010.0.2.0/24 3/NULL 3.3.3.3 10.0.2.1 GE0/0/2*10.0.2.0/24 Liberal/1027 DS/3.3.3.310.0.12.0/24 NULL/3 – 10.0.23.2 S2/0/010.0.12.0/24 1027/3 3.3.3.3 10.0.23.2 S2/0/010.0.23.0/24 3/NULL 3.3.3.3 10.0.23.3 S2/0/0*10.0.23.0/24 Liberal/3 DS/3.3.3.3—————————————————————————-TOTAL:12 Normal LSP(s) Found.TOTAL:4 Liberal LSP(s) Found.TOTAL:0 Frr LSP(s) Found.A ‘*’ before an LSP means the LSP is not establishedA ‘*’ before a Label means the USCB or DSCB is staleA ‘*’ before a UpstreamPeer means the session is in GR stateA ‘*’ before a DS means the session is in GR stateA ‘*’ before a NextHop means the LSP is FRR LSP |
-
LDP policy oluşturalım.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,
[R1]display mpls lsp—————————————————————————-LSP Information:LDP LSP—————————————————————————-FEC In/Out Label In/Out IF Vrf Name3.3.3.3/32 NULL/3 -/S1/0/03.3.3.3/32 1024/3 -/S1/0/02.2.2.2/32 3/NULL -/-4.4.4.4/32 NULL/1025 -/S1/0/04.4.4.4/32 1025/1025 -/S1/0/010.0.12.0/24 3/NULL -/-10.0.1.0/24 3/NULL -/-2.2.2.0/24 3/NULL -/-10.0.23.0/24 NULL/3 -/S1/0/010.0.23.0/24 1026/3 -/S1/0/010.0.2.0/24 NULL/1027 -/S1/0/010.0.2.0/24 1027/1027 -/S1/0/0 |
LSPs on R1 to R2 and R3 are displayed. If the inbound policy is configured on R1, only routes to R2 are allowed.
[R1]ip ip-prefix prefix1 permit 10.0.12.0 24[R1]mpls ldp[R1-mpls-ldp]inbound peer 3.3.3.3 fec ip-prefix prefix1[R1-mpls-ldp]quit[R1]display mpls lsp—————————————————————————-LSP Information:LDP LSP—————————————————————————-FEC In/Out Label In/Out IF Vrf Name2.2.2.2/32 3/NULL -/-10.0.12.0/24 3/NULL -/-10.0.1.0/24 3/NULL -/-2.2.2.0/24 3/NULL -/- |
Final Configurations
<R1>display current-configuration[V200R001C00SPC200]#sysname R1#mpls lsr-id 2.2.2.2mplslsp-trigger all#mpls ldpinbound peer 3.3.3.3 fec ip-prefix prefix1#interface Serial1/0/0link-protocol pppip address 10.0.12.1 255.255.255.0mplsmpls ldp#interface GigabitEthernet0/0/1ip address 10.0.1.1 255.255.255.0#interface LoopBack0ip address 2.2.2.2 255.255.255.0#ospf 1 router-id 2.2.2.2area 0.0.0.0network 10.0.1.0 0.0.0.255network 10.0.12.0 0.0.0.255network 2.2.2.0 0.0.0.255#ip ip-prefix prefix1 index 10 permit 10.0.12.0 24#return |
[R2]display current-configuration[V200R001C00SPC200]#sysname R2#mpls lsr-id 3.3.3.3mplslsp-trigger all#mpls ldp#interface Serial1/0/0link-protocol pppip address 10.0.12.2 255.255.255.0mplsmpls ldp#interface Serial2/0/0link-protocol pppip address 10.0.23.2 255.255.255.0mplsmpls ldp#interface LoopBack0ip address 3.3.3.3 255.255.255.0#ospf 1 router-id 3.3.3.3area 0.0.0.0network 10.0.12.0 0.0.0.255network 10.0.23.0 0.0.0.255network 3.3.3.0 0.0.0.255#return |
[R3]display current-configuration[V200R001C00SPC200]#sysname R3#mpls lsr-id 4.4.4.4mplslsp-trigger all#mpls ldp#interface Serial2/0/0link-protocol pppip address 10.0.23.3 255.255.255.0mplsmpls ldp#interface GigabitEthernet0/0/2ip address 10.0.2.1 255.255.255.0#interface LoopBack0ip address 4.4.4.4 255.255.255.0#ospf 1 router-id 4.4.4.4area 0.0.0.0network 10.0.2.0 0.0.0.255network 10.0.23.0 0.0.0.255network 4.4.4.0 0.0.0.255#Return |