当前位置:网站首页>MPLS experiment
MPLS experiment
2022-07-04 12:07:00 【Webmaster blog】
Catalog
The experimental requirements :
1. Configuration of public network IP Address
5. Configure customer loopback and ip Address
9. Republish static 、 Direct connection
Preface
How to complete this experiment according to the experimental requirements ?
The experimental requirements :
1.R1 And R5MPLS VPN
2.R6 And R7MPLS VPN
3.R7 You can visit R2/R3/R4 Loopback
experimental analysis :
1. Configuration of public network IP Address
Configure the public network ospf 、r4 Silent interface 、r7-r4 default
R2:
#
interface GigabitEthernet0/0/2
ip address 23.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.0
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 23.1.1.1 0.0.0.0
R3:
#
interface GigabitEthernet0/0/0
ip address 23.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 34.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.0
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 23.1.1.2 0.0.0.0
network 34.1.1.1 0.0.0.0
R4:
#
interface GigabitEthernet0/0/0
ip address 34.1.1.2 255.255.255.0
#
interface GigabitEthernet4/0/0
ip address 47.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.0
#
ospf 1 router-id 4.4.4.4
silent-interface GigabitEthernet4/0/0 --- Silent interface , because 4 You don't need to be with 7 Establish neighbors between , Don't send it either hello Packet to router 7.
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 34.1.1.2 0.0.0.0
network 47.1.1.1 0.0.0.0 --- Declare 47 Network segment
At this time, the public network has been connected , for example R2 On pingR4 The loopback of --- Test the public network
R7:
#
interface GigabitEthernet0/0/1
ip address 47.1.1.2 255.255.255.0
#
interface LoopBack0
ip address 192.168.4.2 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 47.1.1.1 ---R7 As a customer, you need to use a default to access the public network
here R7 Sure ping through R2、R3、R4 The loopback of
R2 On pingR4 Loopback address ---- Test the public network
R7 On pingR2、R3、R4 The loopback address of ---- test R7 Can I access the public network loopback
2. To configure MPLS-LDP
R2:
[R2]mpls lsr-id 2.2.2.2
[R2]mpls
[R2-mpls]mpls ldp
[R2-mpls-ldp]int g0/0/2
[R2-GigabitEthernet0/0/2]mpls
[R2-GigabitEthernet0/0/2]mpls ldp
R3:
R2]mpls lsr-id 3.3.3.3
[R2]mpls
[R2-mpls]mpls ldp
[R2-mpls-ldp]int g0/0/0
[R2-GigabitEthernet0/0/0]mpls
[R2-GigabitEthernet0/0/0]mpls ldp
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]mpls
[R2-GigabitEthernet0/0/1]mpls ldp
R4:
[R4]mpls ls
[R4]mpls lsr-id 4.4.4.4
[R4]mpls
Info: Mpls starting, please wait... OK!
[R4-mpls]mpls ldp
[R4-mpls-ldp]int g0/0/0
[R4-GigabitEthernet0/0/0]mpls
[R4-GigabitEthernet0/0/0]mpls ldp
By means of R3 Check on mpls Neighbors of , Find out 3 And 2、4 Build neighbors normally , prove mpls The environment is ready

3. To configure MPLS-VPN
R2
From the topology, you need to create two spaces
[R2]ip vpn-instance a
[R2-vpn-instance-a]ipv4-family
[R2-vpn-instance-a-af-ipv4]route-distinguisher 1:1 --- Definition RD
[R2-vpn-instance-a-af-ipv4]vpn-target 1:1 --- Definition RT
hold VRF Space a Bound to the 1-2 On the interface of
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip binding vpn-instance a
[R2-GigabitEthernet0/0/0]ip add 192.168.2.2 24
[R2]ip vpn-instance b
[R2-vpn-instance-b]ipv4-family
[R2-vpn-instance-b-af-ipv4]route-distinguisher 2:2
[R2-vpn-instance-b-af-ipv4]vpn-target 2:2
hold VRF Space b Bound to the 6-2 On the interface of
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip binding vpn-instance b
[R2-GigabitEthernet0/0/1]ip add 192.168.2.2 24
Errors may be reported in the normal topology , Because the address conflicts , But we go through [R2]dis ip interface brief Check the interface and find two IP Addresses coexist , Because they are in different routing tables , No contradiction , This route does not exist in the ordinary route table , Their routes are in their own vrf In the routing table of the space
[R2]dis ip interface brief --- View the interface configuration
<R2>dis ip routing-table --- View routing table
<R2>dis ip routing-table vpn-instance a --- see vrf Space a The routing table for
R4:
From the topology, you need to create two spaces
[R4]ip vpn-instance a1
[R4-vpn-instance-a1]ipv4-family
[R4-vpn-instance-a1-af-ipv4]route-distinguisher 1:1
[R4-vpn-instance-a1-af-ipv4]vpn-target 1:1
hold VRF Space a1 Bound to the 4-5 On the interface of
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip binding vpn-instance a1
[R4-GigabitEthernet0/0/1]ip address 192.168.3.1 24
[R4]ip vpn-instance b1
[R4-vpn-instance-b1]ipv4-family
[R4-vpn-instance-b1-af-ipv4]route-distinguisher 2:2
[R4-vpn-instance-b1-af-ipv4]vpn-target 2:2
hold VRF Space b1 Bound to the 4-7 On the interface of
[R4-vpn-instance-b1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip binding vpn-instance b1
[R4-GigabitEthernet0/0/2]ip add 192.168.3.1 24
see R2 Interface on ---- Found two interfaces IP The address is the same , But no conflict
View routing table --- It is found that the routing table does not exist 192.168.2.2 The routing entry for
see vrf Space a、b The routing table for ---- Found out 192.168.2.2. The routing
4. To configure MP-BGP
PE And PE To establish MP-BPG Neighborhood
R2:
[R2]bgp 1
[R2-bgp]router-id 2.2.2.2
Establish a normal connection with the opposite end first BGP Neighborhood , It can be used to deliver normal public network routing
[R2-bgp]peer 4.4.4.4 as-number 1
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
At the same time, it needs to be in IPV4 In the family model , Establish a... With the opposite end VPNV4 The relationship between , Used to convey VPNV4 route
[R2-bgp]ipv4-family vpnv4
[R2-bgp-af-vpnv4]peer 4.4.4.4 enable
R4:
[R4]bgp 1
[R4-bgp]router-id 4.4.4.4
Establish a normal connection with the opposite end first BGP Neighborhood , It can be used to deliver normal public network routing
[R4-bgp]peer 2.2.2.2 as-number 1
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
At the same time, it needs to be in IPV4 In the family model , Establish a... With the opposite end VPNV4 The relationship between , Used to convey VPNV4 route
[R4-bgp]ipv4-family vpnv4
[R4-bgp-af-vpnv4]peer 2.2.2.2 enable
At this time, the configuration of the entire public network has been completed , Next, you need to configure the customer
5. Configure customer loopback and ip Address
R1:
[R1]int LoopBack 0
[R1-LoopBack0]ip add 192.168.1.1 24
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.2.1 24
When the configuration is complete ping R2 The interface on the left , here R1 Sure ping through
R6:
[R6]int LoopBack 0
[R6-LoopBack0]ip add 192.168.1.1 24
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 192.168.2.1 24
R5:
[R5]int LoopBack 0
[R5-LoopBack0]ip add 192.168.4.1 24
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.3.2 24
R7:
[R7]int LoopBack 0
[R7-LoopBack0]ip add 192.168.4.2 24
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 192.168.3.2 24
6. Configuration dynamics
Because it is easier to configure dynamically , So first configure the dynamic
R6:
[R6]rip 1
[R6-rip-1]version 2
[R6-rip-1]network 192.168.1.0
[R6-rip-1]network 192.168.2.0
R2:
[R2]rip 1 vpn-instance b
[R2-rip-1]network 192.168.2.0
At this time in R2 Upper vpn Space b The routing table can see that it has passed rip Learning to 192.168.1.0 route
R7:
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 192.168.3.2 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 192.168.4.2 0.0.0.0
R4:
[R4]ospf 2 vpn-instance b1 --- Need to be in vrp Space b1 Start the ospf process 2
[R4-ospf-2]area 0
[R4-ospf-2-area-0.0.0.0]network 192.168.3.1 0.0.0.0
At this time in R4 Upper vpn Space b1 The routing table can see that it has passed ospf Learning to 192.168.4.2 route
At this time in R2 Upper vrf Of b The spatial routing table can see that it has passed rip Learning to 192.168.1.0 route
At this time in R4 Upper vpn Space b1 The routing table can see that it has passed ospf Learning to 192.168.4.2 route
7. Two way republication
here 2-6 Of RIP,4-7 Of OSPF ,2-4 Of BGP It's all connected , Need to be in R2 and R4 Two way republishing on
R2:
[R2]rip 1 vpn-instance b
[R2-rip-1]import-route bgp ---- hold BGP Resend cloth in rip
[R2]bgp 1
[R2-bgp]ipv4-family vpn-instance b
[R2-bgp-b]import-route rip 1 --- hold rip Resend cloth in BGP
R4:
[R4]bgp 1
[R4-bgp]ipv4-family vpn-instance b1
[R4-bgp-b1]import-route ospf 2 --- hold ospf 2 Resend cloth in BGP
[R4]ospf 2 vpn-instance b1
[R4-ospf-2]import-route bgp ---- hold BGP Resend cloth in ospf 2
At this point, the two-way republication is complete , You can see in the R6 Learned from the routing table 3.0 and 4.2 route , stay R7 Learned from the routing table 1.1 and 2.0 route
At this time in R6 On can ping through R7 The loopback of
for example R7ping R3 Loopback 3.3.3.3 It defaults by checking the routing table g0/0/1 Arrived at --- Without a label
R7ping R1 Loopback 192.168.1.1 It's through g0/0/0 Interface MPLS-VPN With two layers of labels , The outer label puts the router 3 cheated , The inner label is for R2 I know where to go R6

8. Configure static
Static requires that each routing table is complete
R1:
[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:
R2 Go up to 1.0 Network segment needs to be static , Go to 3.0 ,4.0 The network segment needs R4 Give it
[R2]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1 --- Go to 1.0 Segment static
R5:
[R5]ip route-static 192.168.1.0 24 192.168.3.1
[R5]ip route-static 192.168.2.0 24 192.168.3.1
R4:
stay R4 Check out vpn Space a1 The routing table of is missing to 4.0 Segment routing , Therefore, we need to write static to 4.0
[R4]ip route-static vpn-instance a1 192.168.4.0 24 192.168.3.2
9. Republish static 、 Direct connection
R2:
R2 Need to put your own 1.0,2.0 The network segment is published to R4
[R2]bgp 1
[R2-bgp]ipv4-family vpn-instance a
[R2-bgp-a]import-route direct
[R2-bgp-a]import-route static
Can be in vpn Space is a Of BGP See these two in the table 1.0 ,2.0 Route to 4 了
R4:
R4 Need to put your own 1.0,2.0 The network segment is published to R2
[R4]bgp 1
[R4-bgp]ipv4-family vpn-instance a1
[R4-bgp-a1]import-route direct
[R4-bgp-a1]import-route static
stay vpn Space is a Of BGP See these two in the routing table 1.0 ,2.0 Route to 4 了
ping192.168.4.2 Impassability is due to isolation ,ping4.1 It can explain us mpls-vpn Static configuration succeeded
thus , This experiment is completed !
边栏推荐
- template<typename MAP, typename LIST, typename First, typename ... Keytypes > recursive call with indefinite parameters - beauty of Pan China
- Heartbeat error attempted replay attack
- OSI model notes
- 2021 annual summary - it seems that I have done everything except studying hard
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
- Summary of collection: (to be updated)
- Test question bank management system - database design [easy to understand]
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
- QQ set group information
- Reptile learning winter vacation series (2)
猜你喜欢
Some summaries of the 21st postgraduate entrance examination 823 of network security major of Shanghai Jiaotong University and ideas on how to prepare for the 22nd postgraduate entrance examination pr
Login operation (for user name and password)
SQL greatest() function instance detailed example
Realize cross tenant Vnet connection through azure virtual Wan
Source code analysis of the implementation mechanism of multisets in guava class library
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
LVS load balancing cluster deployment - Dr direct routing mode
Reptile learning 4 winter vacation series (3)
Detailed explanation of classic process synchronization problems
Method of setting default items in C # ComboBox control code
随机推荐
How to create a new virtual machine
nn. Exploration and experiment of batchnorm2d principle
(2021-08-20) web crawler learning 2
Dos and path
Solaris 10 network services
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
Definition and method of string
Possible to restore a backup of SQL Server 2014 on SQL Server 2012?
2021-11-02
Method of setting default items in C # ComboBox control code
Polymorphic system summary
About the use of URL, href, SRC attributes
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
QQ get group member operation time
Shift EC20 mode and switch
Xiaobing · beauty appraisal
Take advantage of the world's sleeping gap to improve and surpass yourself -- get up early
Heartbeat error attempted replay attack
SSH principle and public key authentication
C language compilation process