当前位置:网站首页>华为设备配置OSPF伪连接
华为设备配置OSPF伪连接
2022-06-12 14:11:00 【Tony_long7483】

- 在CE1、AR6、CE2上配置普通OSPF,发布各接口的网段地址
[CE1-GigabitEthernet0/0/0]ip add 10.1.1.4 24
[CE1-GigabitEthernet0/0/1]ip add 40.1.1.4 24
[CE1]ospf 1
[CE1-ospf-1]area 0
[CE1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0]network 40.1.1.0 0.0.0.255
[AR6-GigabitEthernet0/0/1]ip add 40.1.1.6 24
[AR6-GigabitEthernet0/0/2]ip add 50.1.1.6 24
[AR6]ospf 1
[AR6-ospf-1]area 0
[AR6-ospf-1-area-0.0.0.0]network 40.1.1.0 0.0.0.255
[AR6-ospf-1-area-0.0.0.0]network 50.1.1.0 0.0.0.255
[CE2-GigabitEthernet0/0/0]ip add 10.2.1.5 24
[CE2-GigabitEthernet0/0/1]ip add 50.1.1.5 24
[CE2]ospf 1
[CE2-ospf-1]area 0
[CE2-ospf-1-area-0.0.0.0]network 10.2.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0]network 50.1.1.0 0.0.0.255 - 在PE、P上配置骨干网的基本BGP/MPLS IP VPN,包括:配置骨干网的IGP;配置骨干网的MPLS和LDP;在PE之间建立MP-IBGP对等体关系
[PE1-LoopBack1]ip add 1.1.1.1 32
[PE1-LoopBack10]ip add 5.5.5.5 32
[PE1-GigabitEthernet0/0/0]ip add 20.1.1.1 24
[PE1]mpls lsr-id 1.1.1.1
[PE1]mpls
[PE1]mpls ldp
[PE1-GigabitEthernet0/0/0]mpls
[PE1-GigabitEthernet0/0/0]mpls ldp
[PE1]ospf 1 router-id 1.1.1.1
[PE1-ospf-1]area 0
[PE1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[PE1]bgp 100
[PE1-bgp]peer 3.3.3.3 as-number 100
[PE1-bgp]peer 3.3.3.3 connect-interface LoopBack 1
[PE1-bgp]ipv4-family vpnv4
[PE1-bgp-af-vpnv4]peer 3.3.3.3 enable
[P-LoopBack1]ip add 2.2.2.2 32
[P]mpls lsr-id 2.2.2.2
[P]mpls
[P]mpls ldp
[P-GigabitEthernet0/0/0]ip add 20.1.1.2 24
[P-GigabitEthernet0/0/0]mpls
[P-GigabitEthernet0/0/0]mpls ldp
[P-GigabitEthernet0/0/1]ip add 30.1.1.2 24
[P-GigabitEthernet0/0/1]mpls
[P-GigabitEthernet0/0/1]mpls ldp
[P]ospf 1 router-id 2.2.2.2
[P-ospf-1]area 0
[P-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0]network 30.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[PE2-LoopBack1]ip add 3.3.3.3 32
[PE2-LoopBack10]ip add 6.6.6.6 32
[PE2]mpls lsr-id 3.3.3.3
[PE2]mpls
[PE2]mpls ldp
[PE2-GigabitEthernet0/0/0]ip add 30.1.1.3 24
[PE2-GigabitEthernet0/0/0]mpls
[PE2-GigabitEthernet0/0/0]mpls ldp
[PE2]ospf 1 router-id 3.3.3.3
[PE2-ospf-1]area 0
[PE2-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0]network 30.1.1.0 0.0.0.255
[PE2]bgp 100
[PE2-bgp]peer 1.1.1.1 as-number 100
[PE2-bgp]peer 1.1.1.1 connect-interface LoopBack 1
[PE2-bgp]ipv4-family vpnv4
[PE2-bgp-af-vpnv4]peer 1.1.1.1 enable - 配置PE与CE的连接:PE与CE间运行OSPF
[PE1]ip vpn-instance vpn1
[PE1-vpn-instance-vpn1]ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4]route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4]vpn-target 1:1
[PE1-GigabitEthernet0/0/1]ip binding vpn-instance vpn1
[PE1-GigabitEthernet0/0/1]ip add 10.1.1.1 24
[PE1]ospf 100 router-id 5.5.5.5 vpn-instance vpn1
[PE1-ospf-100]domain-id 10
[PE1-ospf-100]import-route bgp
[PE1-ospf-100]area 0
[PE1-ospf-100-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[PE1]bgp 100
[PE1-bgp]ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1]import-route direct
[PE1-bgp-vpn1]import-route ospf 100
[PE2]ip vpn-instance vpn1
[PE2-vpn-instance-vpn1]ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4]route-distinguisher 100:2
[PE2-vpn-instance-vpn1-af-ipv4]vpn-target 1:1
[PE2-GigabitEthernet0/0/1]ip binding vpn-instance vpn1
[PE2-GigabitEthernet0/0/1]ip add 10.2.1.3 24
[PE2]ospf 100 router-id 6.6.6.6 vpn-instance vpn1
[PE2-ospf-100]import-route direct
[PE2-ospf-100]import-route bgp
[PE2-ospf-100]domain-id 10
[PE2-ospf-100]area 0
[PE2-ospf-100-area-0.0.0.0]network 10.2.1.0 0.0.0.255
[PE2]bgp 100
[PE2-bgp]ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1]import-route direct
[PE2-bgp-vpn1]import-route ospf 100
看到去往对端CE的路由是通过用户网络的OSPF路由,不是通过骨干网的BGP路由
4. 配置伪连接
[CE1-GigabitEthernet0/0/1]ospf cost 10
[CE2-GigabitEthernet0/0/1]ospf cost 10
[PE1]int LoopBack 10
[PE1-LoopBack10]ip binding vpn-instance vpn1
[PE1-LoopBack10]ip add 5.5.5.5 32
[PE1]ospf 100
[PE1-ospf-100]area 0
[PE1-ospf-100-area-0.0.0.0]sham-link 5.5.5.5 6.6.6.6 cost 1
[PE2]int LoopBack 10
[PE2-LoopBack10]ip binding vpn-instance vpn1
[PE2-LoopBack10]ip add 6.6.6.6 32
[PE2]ospf 100
[PE2-ospf-100]area 0
[PE2-ospf-100-area-0.0.0.0]sham-link 6.6.6.6 5.5.5.5 cost 1
5. 检查配置
看到去往对端CE的路由变成了通过骨干网的BGP路由,并且有去往sham-link目的地址的路由
看到去往对端CE的OSPF路由开销变为3,下一跳为接入PE的g0/0/1接口,即,去往对端的VPN流量将通过骨干网转发

可以看到对端CE的路由是作为区域内(Intra Area)路由学到的
边栏推荐
- Tlm/systemc: TLM socket binding problem
- Leetcode questions brushing February /1020 Number of enclaves
- Postgresql14 installation and use tutorial
- Lua callinfo structure, stkid structure resolution
- Details of bypassing safeseh mechanism by using modules that do not enable safeseh
- Analysis of lua source code
- Codeforces Round #798 (Div. 2)(A~D)
- Leetcode 2185. Counts the string containing the given prefix
- Leetcode 2176. Count equal and divisible pairs in an array
- SystemC time
猜你喜欢

Ppt cannot be opened, always prompt how to fix it

Alibaba cloud development board haas510 submission device attributes

Redis core configuration and advanced data types

For cross-border e-commerce, the bidding strategy focusing more on revenue - Google SEM

高考回忆录

Why do Chinese programmers change jobs?

浅谈中国程序员为什么要跳槽?

Pay attention to click and pursue more users to enter the website. What bidding strategy can you choose?

Introduction to database system (Fifth Edition) notes Chapter 1 Introduction

Is Shell Scripting really a big technology?
随机推荐
Player actual combat 22 to solve the problems of flower screen and Caton
Unhandled exception stack overflow
Dynamic search advertising intelligent search for matching keywords
Player actual combat 13 create qtopengl project to promote window control and reload qoopenglwedge
Lua callinfo structure, stkid structure resolution
Printing colored messages on the console with printf
【活动早知道】LiveVideoStack近期活动一览
C语言中主函数调用另外一个函数,汇编代码理解
[advanced MySQL] evolution of MySQL index data structure (IV)
Alibaba cloud development board haas510 sends the serial port data to the Internet of things platform
阿里云开发板HaaS510连接物联网平台--HaaS征文
280 weeks /2171 Take out the least number of magic beans
Notepad common settings
Conversion of player's actual 10 pixel format and size
Leetcode 2176. 统计数组中相等且可以被整除的数对
SystemC simulation scheduling mechanism
阿里云开发板HaaS510响应UART串口指令
Dial up and Ethernet
How to brush leetcode
How to package QT program learning records with inno setup