华为:OSPF虚链路技术

华为:OSPF虚链路技术

1. 每台设备上配置接口以及环回口地址:

R1:

interface GigabitEthernet0/0/0

ip address 10.0.12.1 255.255.255.0

#

interface GigabitEthernet0/0/1

ip address 10.0.13.1 255.255.255.0

#

interface LoopBack0

ip address 10.0.1.1 255.255.255.255

R2:

interface GigabitEthernet0/0/0

ip address 10.0.12.2 255.255.255.0

#

interface GigabitEthernet0/0/2

ip address 10.0.23.2 255.255.255.0

#

interface LoopBack0

ip address 10.0.2.2 255.255.255.255

R3:

interface GigabitEthernet0/0/0

ip address 10.0.34.3 255.255.255.0

#

interface GigabitEthernet0/0/1

ip address 10.0.13.3 255.255.255.0

#

interface GigabitEthernet0/0/2

ip address 10.0.23.3 255.255.255.0

#

interface LoopBack0

ip address 10.0.3.3 255.255.255.255

R4:

interface GigabitEthernet0/0/0

ip address 10.0.34.4 255.255.255.0

#

interface LoopBack0

ip address 10.0.4.4 255.255.255.255

2. 每台设备上配置ospf协议,并划好区域

R1:

ospf 1 router-id 10.0.1.1

area 0.0.0.0

network 10.0.12.0 0.0.0.255

network 10.0.1.1 0.0.0.0

area 0.0.0.1

network 10.0.13.0 0.0.0.255

R2:

ospf 1 router-id 10.0.2.2

area 0.0.0.0

network 10.0.2.2 0.0.0.0

network 10.0.12.0 0.0.0.255

area 0.0.0.1

network 10.0.23.0 0.0.0.255

R3:

ospf 1 router-id 10.0.3.3

area 0.0.0.1

network 10.0.3.3 0.0.0.0

network 10.0.23.0 0.0.0.255

network 10.0.13.0 0.0.0.255

area 0.0.0.2

network 10.0.34.0 0.0.0.255

R4:

ospf 1 router-id 10.0.4.4

area 0.0.0.2

network 10.0.4.4 0.0.0.0

network 10.0.34.0 0.0.0.255

3. 使用虚链路使区域2与区域-逻辑相连:

R1:

ospf 1

area 0.0.0.1

vlink-peer 10.0.3.3

R2:

ospf 1

area 0.0.0.1

vlink-peer 10.0.3.3

R3:

ospf 1

area 0.0.0.1

vlink-peer 10.0.2.2

vlink-peer 10.0.1.1

此时R1、R2能ping通R4

[R1]ping 10.0.4.4

PING 10.0.4.4: 56 data bytes, press CTRL_C to break

Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=254 time=40 ms

Reply from 10.0.4.4: bytes=56 Sequence=2 ttl=254 time=40 ms

4. 优先使用路径R4-R3-R1,并以R4-R3-R2路径为备份路径:

R3:

interface GigabitEthernet0/0/2

ospf cost 10

R2:

interface GigabitEthernet0/0/2

ospf cost 10

5. 使用虚链路作为区域0链路的冗余备份

目前,R1与R2之间只有单条链路连接,如果出现链路故障,就会导致区域0被分割的问题。为了解决这一问题,增强网络的可靠性,可以以区域1为传输区域,在R1与R2之间建立–条虚链路作为冗余备份。

R1:

ospf 1

area 0.0.0.1

vlink-peer 10.0.1.1

R2:

ospf 1

area 0.0.0.1

vlink-peer 10.0.2.2

6. 配置虚链路的认证功能

R1:

ospf 1

area 0.0.0.1

vlink-peer 10.0.3.3 hmac-md5 1 plain huawei

vlink-peer 10.0.2.2 hmac-md5 1 plain huawei

R2:

ospf 1

area 0.0.0.1

vlink-peer 10.0.1.1 hmac-md5 1 plain huawei

vlink-peer 10.0.3.3 hmac-md5 1 plain huawei

R3:

ospf 1

area 0.0.0.1

vlink-peer 10.0.1.1 hmac-md5 1 plain huawei

vlink-peer 10.0.2.2 hmac-md5 1 plain huawei

最终配置:

R1:

sysname R1

#

interface GigabitEthernet0/0/0

ip address 10.0.12.1 255.255.255.0

#

interface GigabitEthernet0/0/1

ip address 10.0.13.1 255.255.255.0

#

interface LoopBack0

ip address 10.0.1.1 255.255.255.255

#

ospf 1 router-id 10.0.1.1

area 0.0.0.0

network 10.0.12.0 0.0.0.255

network 10.0.1.1 0.0.0.0

area 0.0.0.1

network 10.0.13.0 0.0.0.255

vlink-peer 10.0.3.3 hmac-md5 1 plain huawei

vlink-peer 10.0.2.2 hmac-md5 1 plain huawei

#

R2:

sysname R2

#

interface GigabitEthernet0/0/0

ip address 10.0.12.2 255.255.255.0

#

interface GigabitEthernet0/0/2

ip address 10.0.23.2 255.255.255.0

ospf cost 10

#

interface LoopBack0

ip address 10.0.2.2 255.255.255.255

#

ospf 1 router-id 10.0.2.2

area 0.0.0.0

network 10.0.2.2 0.0.0.0

network 10.0.12.0 0.0.0.255

area 0.0.0.1

network 10.0.23.0 0.0.0.255

vlink-peer 10.0.1.1 hmac-md5 1 plain huawei

vlink-peer 10.0.3.3 hmac-md5 1 plain huawei

#

R3:

sysname R3

#

interface GigabitEthernet0/0/0

ip address 10.0.34.3 255.255.255.0

#

interface GigabitEthernet0/0/1

ip address 10.0.13.3 255.255.255.0

#

interface GigabitEthernet0/0/2

ip address 10.0.23.3 255.255.255.0

ospf cost 10

#

interface LoopBack0

ip address 10.0.3.3 255.255.255.255

#

ospf 1 router-id 10.0.3.3

area 0.0.0.1

network 10.0.3.3 0.0.0.0

network 10.0.23.0 0.0.0.255

network 10.0.13.0 0.0.0.255

vlink-peer 10.0.1.1 hmac-md5 1 plain huawei

vlink-peer 10.0.2.2 hmac-md5 1 plain huawei

area 0.0.0.2

network 10.0.34.0 0.0.0.255

#

R4:

sysname R4

#

interface GigabitEthernet0/0/0

ip address 10.0.34.4 255.255.255.0

#

interface LoopBack0

ip address 10.0.4.4 255.255.255.255

#

ospf 1 router-id 10.0.4.4

area 0.0.0.2

network 10.0.4.4 0.0.0.0

network 10.0.34.0 0.0.0.255

#

郑重声明:本文内容及图片均整理自互联网,不代表本站立场,版权归原作者所有,如有侵权请联系管理员(admin#wlmqw.com)删除。
上一篇 2022年8月12日 06:10
下一篇 2022年8月12日 06:11

相关推荐

联系我们

联系邮箱:admin#wlmqw.com
工作时间:周一至周五,10:30-18:30,节假日休息