当前位置:网站首页>MPLS experiment
MPLS experiment
2022-07-05 06:26:00 【Lucky_ Lu0】
One 、 Experimental content

Two 、 The topology
3、 ... and 、 To configure
1. Configure the public network part ip
r2
[r2]int g 0/0/2
[r2-GigabitEthernet0/0/2]ip add 23.1.1.1 24
[r2]int lo0
[r2-LoopBack0]ip add 2.2.2.2 24
r3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[r3]int lo0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 34.1.1.1 24
r4
[r4]int lo0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 34.1.1.2 24
[r4]int g 0/0/2
[r4-GigabitEthernet0/0/2]ip add 47.1.1.1 24
r7
[r7]int g 0/0/0
[r7-GigabitEthernet0/0/0]ip add 47.1.1.2 24
2. Use ospf Make the public network part communicate
r2
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[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.1.1.2 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 34.1.1.1 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.1.1.2 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 47.1.1.1 0.0.0.0
r7
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 47.1.1.2 0.0.0.0
because r7 The client side. , There is no need to r7 send out hello package , So we need to restrain g0/0/2 Interface , Again r7 Write a default route to r4,r7 You can access r2/3/4
[r4-ospf-1]silent-interface g0/0/2
[r7]ip route-static 0.0.0.0 0 47.1.1.1
3. stay r2/3/4 On the configuration mpls
r2
[r2]mpls lsr-id 2.2.2.2
[r2]mpls
[r2-mpls]mpls ldp
[r2-mpls-ldp]int g 0/0/2
[r2-GigabitEthernet0/0/2]mpls
[r2-GigabitEthernet0/0/2]mpls ldp
r3
[r3]mpls lsr-id 3.3.3.3
[r3]mpls
[r3-mpls]mpls ldp
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/0]mpls
[r3-GigabitEthernet0/0/0]mpls ldp
r4
[r4]mpls lsr-id 4.4.4.4
[r4]mpls
[r4-mpls]mpls ldp
[r4-mpls-ldp]int g 0/0/0
[r4-GigabitEthernet0/0/0]mpls
[r4-GigabitEthernet0/0/0]mpls ldp
Check mpls My neighbor table , Build neighbors normally

4. stay r2 Do on vrf Space
[r2]ip vpn-instance b1
[r2-vpn-instance-b1]ipv4-family
[r2-vpn-instance-b1-af-ipv4]route-distinguisher 1:1
[r2-vpn-instance-b1-af-ipv4]vpn-target 1:1
[r2-vpn-instance-b1-af-ipv4]q
[r2]ip vpn
[r2]ip vpn-instance a1
[r2-vpn-instance-a1]ipv4-family
[r2-vpn-instance-a1-af-ipv4]route-distinguisher 2:2
[r2-vpn-instance-a1-af-ipv4]vpn-target 2:2
Bind the two interfaces to b1a1 Space , Configure interface ip
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip binding vpn-instance b1
[r2-GigabitEthernet0/0/0]ip add 192.168.2.2 24
[r2-GigabitEthernet0/0/0]q
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip binding vpn-instance a1
[r2-GigabitEthernet0/0/1]ip add 192.168.2.2 24
start-up r2 Of bgp
[r2]bgp 1
[r4-bgp] router-id 2.2.2.2
[r2-bgp]peer 4.4.4.4 as-number 1
[r2-bgp]peer 4.4.4.4 connect-interface lo0
[r2-bgp]ipv4
[r2-bgp]ipv4-family vpnv4
[r2-bgp-af-vpnv4]peer 4.4.4.4 enable
5. stay r4 Do on vrf Space
[r4]ip vpn-instance b2
[r4-vpn-instance-b2]route-distinguisher 1:1
[r4-vpn-instance-b2-af-ipv4]vpn-target 1:1
[r4]ip vpn-instance a2
[r4-vpn-instance-a2]route-distinguisher 2:2
[r4-vpn-instance-a2-af-ipv4]vpn-target 2:2
take r4 The two interfaces on are bound to b2 a2 On , To configure ip
[r4]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip binding vpn-instance b2
[r4-GigabitEthernet0/0/1]ip add 192.168.3.2 24
[r4-GigabitEthernet0/0/1]int g 4/0/0
[r4-GigabitEthernet4/0/0]ip binding vpn-instance a2
[r4-GigabitEthernet4/0/0]ip add 192.168.3.2 24
start-up r4 Of bgp
[r4]bgp 1
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 2.2.2.2 as-number 1
[r4-bgp]peer 2.2.2.2 connect-interface lo0
[r4-bgp]ipv4-family vpnv4
[r4-bgp-af-vpnv4]peer 2.2.2.2 enable
Configure private network ip
r1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[r1]int lo0
[r1-LoopBack0]ip add 192.168.1.1 24
r6
[r6]int lo0
[r6-LoopBack0]ip add 192.168.1.2 24
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip add 192.168.2.1 24
r5
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[r5]int lo0
[r5-LoopBack0]ip add 192.168.4.1 24
r7
[r7]int lo0
[r7-LoopBack0]ip add 192.168.4.2 24
[r7]int g 0/0/2
[r7-GigabitEthernet0/0/2]ip add 192.168.3.1 24
6. Use rip The agreement declares r6 Direct connection network segment
[r6]rip 1
[r6-rip-1]version 2
[r6-rip-1]network 192.168.1.0
[r6-rip-1]network 192.168.2.0
Declare r2 And r6 Direct connection network segment ( Declare the interface vpn Space )
[r2]rip 1 vpn-instance a1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
Use ospf Declare r7 The direct network segment of
[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.0 0.0.0.255
[r7-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
stay r4 To announce , because r4 There's already one on the table ospf, Therefore, the protocol process number cannot be one , Declare vpn Space
[r4]ospf 2 vpn-instance a2
[r4-ospf-2]area 0
[r4-ospf-2-area-0.0.0.0]network 192.168.3.0 0.0.0.255
7. stay r2 Use two-way republishing on
Get into rip Of VPN Space import bgp
[r2]rip 1 vpn-instance a1
[r2-rip-1]import-route bgp
Get into bgpVPN Space import rip
[r2]bgp 1
[r2-bgp]ipv4-family vpn-instance a1
[r2-bgp-a1]import-route ripstay r4 Two way republishing on
Get into ospfvpn Space import bgp
[r4]ospf 2 vpn-instance a2
[r4-ospf-2]import-route bgp
Get into bgpVPN Space import ospf
[r4]bgp 1
[r4-bgp]ipv4-family vpn-instance a2
[r4-bgp-a2]import-route ospf 2
see r6 Routing table

r6 Learned r7 Upper 3.1 and 4.2 route
see r7

r7 I also learned r6 Of 1.0 and 2.0 route
8. stay b1 and b2 Use static routing
First, in the r1 Write two static
[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
stay r2vpn Space plus a route , Point to 1.0
[r2]ip route-static vpn-instance b1 192.168.1.0 24 192.168.2.1
Get into r2bgpVPN Space handle r2 Go to r1 Static and direct route import bgp
[r2]bgp 1
[r2-bgp]ipv4-family vpn-instance b1
[r2-bgp-b1]import-route static
[r2-bgp-b1]import-route direct
see r4vpn Space routing table

You can see r4vpn Space has learned 1.0 and 2.0 The routing
stay r4VPN Space plus a route to 4.0
[r4]ip route-static vpn-instance b2 192.168.4.0 24 192.168.3.1
stay r5 Write two static routes
[r5]ip route-static 192.168.1.0 24 192.168.3.2
[r5]ip route-static 192.168.2.0 24 192.168.3.2
Get into r4bgp Of vpn Space import r4 Go to r5 Direct static routing
[r4]bgp 1
[r4-bgp]ipv4-family vpn-instance b2
[r4-bgp-b2]import-route static
[r4-bgp-b2]import-route direct
see r2VPN Space routing table

r2VPN Space also learned 3.0 and 4.0 The routing
Use r1 visit 3.0
<r1>ping 192.168.3.1
PING 192.168.3.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.3.1: bytes=56 Sequence=1 ttl=252 time=70 ms
Reply from 192.168.3.1: bytes=56 Sequence=2 ttl=252 time=30 ms
Reply from 192.168.3.1: bytes=56 Sequence=3 ttl=252 time=40 ms
Reply from 192.168.3.1: bytes=56 Sequence=4 ttl=252 time=30 ms
Reply from 192.168.3.1: bytes=56 Sequence=5 ttl=252 time=40 ms
Successful visit
边栏推荐
- [BMZCTF-pwn] ectf-2014 seddit
- Redis-01.初识Redis
- MySQL advanced part 2: SQL optimization
- Leetcode-556: the next larger element III
- our solution
- Currently clicked button and current mouse coordinates in QT judgment interface
- 3. Oracle control file management
- Records of some tools 2022
- Single chip computer engineering experience - layered idea
- Niu Mei's math problems
猜你喜欢

WordPress switches the page, and the domain name changes back to the IP address

confidential! Netease employee data analysis internal training course, white whoring! (attach a data package worth 399 yuan)

Leetcode-6108: decrypt messages

Game theory acwing 894 Split Nim game

1.手动创建Oracle数据库

阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
![[2021]IBRNet: Learning Multi-View Image-Based Rendering Qianqian](/img/f1/e7a8a1a31bc5712d9f32d91305a2b0.jpg)
[2021]IBRNet: Learning Multi-View Image-Based Rendering Qianqian

Find the combination number acwing 887 Find combination number III

1.13 - RISC/CISC

高斯消元 AcWing 884. 高斯消元解异或线性方程组
随机推荐
MySQL advanced part 2: the use of indexes
Ffmpeg build download (including old version)
__ builtin_ Popcount() counts the number of 1s, which are commonly used in bit operations
Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
LeetCode 0107. Sequence traversal of binary tree II - another method
C - XOR to all (binary topic)
【LeetCode】Easy | 20. Valid parentheses
WordPress switches the page, and the domain name changes back to the IP address
Is it impossible for lamda to wake up?
Series of how MySQL works (VIII) 14 figures explain the atomicity of MySQL transactions and the principle of undo logging
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
Dataframe (1): introduction and creation of dataframe
Single chip computer engineering experience - layered idea
ollvm编译出现的问题纪录
LeetCode-61
Design specification for mobile folding screen
Leetcode-6111: spiral matrix IV
Relevant information of National Natural Science Foundation of China
Leetcode-6108: decrypt messages
Golang uses context gracefully