MPLS VPN experiment

Table of contents

MPLS VPN experiment 

Topology

Purpose

basic configuration

R2

R3

R4

Configure IGP (ospf) on the public network

R2

R3

R4

Activate MPLS

R2

R3

R4

VRF creation

R2

R4

Draw the interface into the VRF space

R2

R4

Configure the interface IP address

R2

R4

Basic configuration of site 1

Basic configuration of site 2

Configure static routes on CE and PE

start BGP

Establish MP-BGP Neighborhood

Publish site 1 information

Publish direct routes and static routes

TestEdit

Publish the routing information of Site 2

Publishing routes (neetwork publishing)

test

 Connectivity test


MPLS VPN experiment 

Topology

Purpose

        Site 1 and Site 2 need to be built together through MPLS VPN         

R2、R4--- PE

R3 --- P

R1、R5---CE

basic configuration

R2

[R2]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEthernet0/0/1              23.0.0.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         2.2.2.2/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[R2]

R3

[R3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              23.0.0.2/24          up         up        
GigabitEthernet0/0/1              24.0.0.1/24          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         3.3.3.3/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[R3]

R4

[R4]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              34.0.0.2/24          up         up        
GigabitEthernet0/0/1              unassigned           up         down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[R4]

Configure IGP (ospf) on the public network

R2

[R2]ospf router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

R3

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

R4

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

Activate MPLS

R2

[R2]mpls lsr-id 2.2.2.2
[R2]mpls 
Info: Mpls starting, please wait... OK!
[R2-mpls]mpls ld
[R2-mpls-ldp]  int g 0/0/01
[R2-GigabitEthernet0/0/1]mpls 
[R2-GigabitEthernet0/0/1]mpls ld

R3

[R3]mpls lsr-id 3.3.3.3
[R3]mpls 
Info: Mpls starting, please wait... OK!
[R3-mpls]mpls ldp
[R3-mpls-ldp]int g 0/0/0
[R3-GigabitEthernet0/0/0]mpls 
[R3-GigabitEthernet0/0/0]mpls ldp
[R3-GigabitEthernet0/0/0]int g 0/0/1	
[R3-GigabitEthernet0/0/1]mpls 
[R3-GigabitEthernet0/0/1]mpls ldp 
[R3-GigabitEthernet0/0/1]

R4

[R4]mpls lsr-id 4.4.4.4
[R4]mpls 
Info: Mpls starting, please wait... OK!
[R4-mpls]mpls ldp
[R4-mpls-ldp]int g 0/0/0	
[R4-GigabitEthernet0/0/0]mpls 	
[R4-GigabitEthernet0/0/0]mpls ldp 
[R4-GigabitEthernet0/0/0]

VRF creation

R2

[R2]ip vpn-instance a --- VRF空间命名时大小写敏感
[R2-vpn-instance-a]
[R2-vpn-instance-a]route-distinguisher 100:1 --- 配置RD值
[R2-vpn-instance-a-af-ipv4]
[R2-vpn-instance-a-af-ipv4]vpn-target 100:1 export-extcommunity --- 配置出站RT
 EVT Assignment result: 
Info: VPN-Target assignment is successful.
[R2-vpn-instance-a-af-ipv4]vpn-target 100:2 import-extcommunity --- 配置入站RT
 IVT Assignment result: 
Info: VPN-Target assignment is successful.

R4

[R4]ip vpn-instance b
[R4-vpn-instance-b]
Apr 19 2023 11:44:15-08:00 R4 %%01LDP/4/SSNHOLDTMREXP(l)[1]:Sessions were delete
d because the session hold timer expired and the notification of the expiry was 
sent to the peer 3.3.3.3. 
[R4-vpn-instance-b]route-distinguisher 200:1	
[R4-vpn-instance-b-af-ipv4]vpn-target 100:2 export-extcommunity 
 EVT Assignment result: 
Info: VPN-Target assignment is successful.
[R4-vpn-instance-b-af-ipv4]vpn-target 100:1 import-extcommunity 
 IVT Assignment result: 
Info: VPN-Target assignment is successful.
[R4-vpn-instance-b-af-ipv4]

Draw the interface into the VRF space

R2

[R2-GigabitEthernet0/0/0]ip binding vpn-instance a
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R2-GigabitEthernet0/0/0]

R4

[R4-GigabitEthernet0/0/1]ip binding vpn-instance b
Apr 19 2023 11:46:19-08:00 R4 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the DOWN state. 
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R4-GigabitEthernet0/0/1]

Notice:

        After drawing, all the previously configured IPV4 and IPV6 will be cleared

Configure the interface IP address

R2

[R2-GigabitEthernet0/0/0]ip address 192.168.2.2 24

R4

[R4]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.3.1 24

Basic configuration of site 1

[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip ad	
[R1-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R1]int l 0
[R1-LoopBack0]ip address 192.168.1.1 24

Basic configuration of site 2

[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.3.2 24
[R5-LoopBack0]ip address 192.168.4.1 24

Configure static routes on CE and PE

[R1]ip route-static 192.168.3.0 24 192.168.2.2
[R1]ip route-static 192.168.4.0 24 192.168.2.2

[R2]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1

[R5]ip route-static 192.168.2.0 24 192.168.3.1
[R5]ip route-static 192.168.1.0 24 192.168.3.1

[R4]ip route-static vpn-instance b 192.168.4.0 24 192.168.3.2

start BGP

        Just use IBGP

[R2]bgp 1
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 4.4.4.4 as 1
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0

[R4]bgp 1
[R4-bgp]router-id 4.4.4.4
[R4-bgp]peer 2.2.2.2 as 1
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0

Establish MP-BGP Neighborhood

        Enter VPNV4 after the BGPV4 neighbor relationship is established

[R2-bgp]ipv4-family vpnv4
[R2-bgp-af-vpnv4]
[R2-bgp-af-vpnv4]peer 4.4.4.4 enable --- 因为PE设备之间需要传递VPNV4路由 ,所以,在普通的BGPV4邻居关系建立的基础上,需要在VPNV4地址族中激活邻居关系

[R4-bgp]ipv4-family vpnv4
[R4-bgp-af-vpnv4]peer 2.2.2.2 enable

Publish site 1 information

[R2-bgp]ipv4-family vpn-instance a --- 在VRF空间中发布路由信息

Publish direct routes and static routes

[R2-bgp-a]import-route direct 
[R2-bgp-a]import-route static

test

Publish the routing information of Site 2

[R4-bgp]ipv4-family vpn-instance b

Publishing routes (neetwork publishing)

[R4-bgp-b]network 192.168.3.0 24
[R4-bgp-b]network 192.168.4.0 24

test

 Connectivity test

 

Guess you like

Origin blog.csdn.net/qq_57289939/article/details/130245924