-
[MPLS] IP/MPLS BasicsProtocols/BGP_OSPF_MPLS_VPN 2021. 6. 8. 16:19
<L3 base Topology>
1. OSPF Topology
123456789101112131415161718192021222324252627R1#show run | b router ospf 1router ospf 1router-id 1.1.1.1network 1.1.1.1 0.0.0.0 area 0network 1.1.12.1 0.0.0.0 area 0network 1.1.14.1 0.0.0.0 area 0R2#show run | b router ospf 1router ospf 1router-id 1.1.2.2network 1.1.2.2 0.0.0.0 area 0network 1.1.12.2 0.0.0.0 area 0network 1.1.23.2 0.0.0.0 area 0R3#show run | b router ospf 1router ospf 1router-id 1.1.3.3network 1.1.3.3 0.0.0.0 area 0network 1.1.23.3 0.0.0.0 area 0network 1.1.34.3 0.0.0.0 area 0R4#show run | b router ospf 1router ospf 1router-id 1.1.4.4network 1.1.4.4 0.0.0.0 area 0network 1.1.14.4 0.0.0.0 area 0network 1.1.34.4 0.0.0.0 area 02. LDP Topology
123456789101112131415161718192021222324252627R1#mpls label protocol ldp // Configure the use of LDP on all interfaces to forward label binding.mpls ldp router-id Loopback0 // Specifies the preferred interface for determining the LDP router ID.interface Ethernet0/0.12mpls ip // Configures MPLS hop-by-hop forwarding on the interface.R2#mpls label protocol ldpmpls ldp router-id Loopback0interface Ethernet0/0.12mpls ipinterface Ethernet0/0.23mpls ipR3#mpls label protocol ldpmpls ldp router-id Loopback0interface Ethernet0/0.23mpls ipinterface Ethernet0/0.34mpls ipR4#mpls label protocol ldpmpls ldp router-id Loopback0interface Ethernet0/0.34mpls ip2.1 LDP session extablishment procedure
2.2 LDP Initialization Message
2.3 Captured ICMP on R2 from R1 to R4
ICMP request was pushed with Label 18 on R1.3. MP-BGP Topology
MP-BGP is enabed on PE routers.
1234567891011121314151617181920212223R1#show run | b router bgprouter bgp 1 // start bgp routing with process id 1bgp router-id 1.1.1.1 // Use 1.1.1.1 for BGP identifierneighbor 1.1.4.4 remote-as 1 // Make a peer with 1.1.4.4 to send myAS:1 in OPEN messageneighbor 1.1.4.4 update-source Loopback0!address-family vpnv4 // start Multi-protocol BGP for MPLS VPN version 4neighbor 1.1.4.4 activate // activate MPLS VPN version 4 with 1.1.4.4neighbor 1.1.4.4 send-community extended // 'extended' community makes it possible to use RT, SOO communitiesexit-address-familyR4#show run | b router bgprouter bgp 1bgp router-id 1.1.4.4neighbor 1.1.1.1 remote-as 1neighbor 1.1.1.1 update-source Loopback0!address-family vpnv4neighbor 1.1.1.1 activateneighbor 1.1.1.1 send-community both // 'both' options sends extended community, large community, and standard communities attributes to the neighbor.exit-address-family*BGP OPEN message has 'My AS' and BGP Identifier and extensions for MP-BGP.
4. MPLS VPN Topology
*Configuration
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071R1#ip vrf customer1 // 'Virtual Routing/Forwarding' has a routing table for each customer(VPN).rd 1:100 // 'Route Distinguisher' can be an idientifier for a customer. AS:NN(customer number)route-target export 1:101 // 'route-target' is an extended community of BGP.// 'export 1:101' can send a packet to 'import 1:101'route-target import 1:102 // 'import 1:102' can receive a packet for 'export 1:102'!ip vrf customer2 // Create a private routing table for 'customer2'rd 1:200 // 'customer2' has 1:200 identifierroute-target export 1:201 // 'rt export 1:201' can send packets to 'rt import 1:201'route-target import 1:202!interface Ethernet0/0.15encapsulation dot1Q 15ip vrf forwarding customer1 // apply a virtual routing table (customer1) to this interface)ip address 10.1.15.1 255.255.255.0!interface Ethernet0/0.17encapsulation dot1Q 17ip vrf forwarding customer2ip address 10.1.17.1 255.255.255.0!router bgp 1address-family ipv4 vrf customer1redistribute connected // Redistribute connection routes to customer1 BGP routing table.redistribute static // Redistribute static routes to customer1 BGP routing table.exit-address-family!address-family ipv4 vrf customer2redistribute connectedredistribute staticexit-address-family!ip route vrf customer1 10.1.1.0 255.255.255.0 10.1.15.5 // can reach customer1 network via 10.1.15.5 GW.ip route vrf customer2 10.1.1.0 255.255.255.0 10.1.17.7 // can reach customer2 network via 10.1.17.7 GW.R4#ip vrf customer1rd 1:100route-target export 1:102route-target import 1:101!ip vrf customer2rd 1:200route-target export 1:202route-target import 1:201!interface Ethernet0/0.46encapsulation dot1Q 46ip vrf forwarding customer1ip address 10.1.46.4 255.255.255.0!interface Ethernet0/0.48encapsulation dot1Q 48ip vrf forwarding customer2ip address 10.1.48.4 255.255.255.0!router bgp 1address-family ipv4 vrf customer1redistribute connectedredistribute staticexit-address-family!address-family ipv4 vrf customer2redistribute connectedredistribute staticexit-address-family* show command1234567891011121314151617181920212223242526272829303132333435363738394041R1#show ip bgp vpnv4 rd 1:100BGP table version is 13, local router ID is 1.1.1.1Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,x best-external, a additional-path, c RIB-compressed,Origin codes: i - IGP, e - EGP, ? - incompleteRPKI validation codes: V valid, I invalid, N Not foundNetwork Next Hop Metric LocPrf Weight PathRoute Distinguisher: 1:100 (default for vrf customer1)*> 10.1.1.0/24 10.1.15.5 0 32768 ?*>i 10.1.2.0/24 1.1.4.4 0 100 0 ?*> 10.1.15.0/24 0.0.0.0 0 32768 ?*>i 10.1.46.0/24 1.1.4.4 0 100 0 ?R1#R1#show ip bgp vpnv4 rd 1:100 10.1.2.0/24BGP routing table entry for 1:100:10.1.2.0/24, version 10Paths: (1 available, best #1, table customer1)Not advertised to any peerRefresh Epoch 1Local1.1.4.4 (metric 31) (via default) from 1.1.4.4 (1.1.4.4)Origin incomplete, metric 0, localpref 100, valid, internal, bestExtended Community: RT:1:102mpls labels in/out nolabel/22 // push label 22 for 10.1.2.0 via 1.1.4.4rx pathid: 0, tx pathid: 0x0R1#R1#show mpls forwarding-tableLocal Outgoing Prefix Bytes Label Outgoing Next HopLabel Label or Tunnel Id Switched interface17 Pop Label 1.1.2.2/32 0 Et0/0.12 1.1.12.218 Pop Label 1.1.23.0/24 0 Et0/0.12 1.1.12.219 19 1.1.4.4/32 0 Et0/0.12 1.1.12.2 // 'push' label 19 for 1.1.4.420 20 1.1.3.3/32 0 Et0/0.12 1.1.12.221 21 1.1.34.0/24 0 Et0/0.12 1.1.12.222 No Label 10.1.1.0/24[V] 590 Et0/0.15 10.1.15.523 No Label 10.1.15.0/24[V] 2714 aggregate/customer124 No Label 10.1.1.0/24[V] 652 Et0/0.17 10.1.17.725 No Label 10.1.17.0/24[V] 590 aggregate/customer2R1#cs * ICMP packet for 10.1.2.2 on R1
the packet has label 19 and 22.
R5에서 R6으로 ping 갈 때 22 lable 먼저 붙고 그 다음 19가 붙는 것을 알 수 있다.
22 label은 BGP Label로 BGP에 의해 붙였고, 19 label은 IGP Label로 LDP에서 붙인 것을 알 수 있다.
'Protocols > BGP_OSPF_MPLS_VPN' 카테고리의 다른 글
[MPLS] OSPF Super Backbone Area (2) (0) 2021.06.23 [MPLS] OSPF Super Backbone Area (1) (0) 2021.06.23 OSPF metric/cost (0) 2021.02.16 OSPF Link-state/Adjacency changes (0) 2021.02.16 The OSPF Packet Types and Flow (0) 2021.02.11