HCIP-mpls实验

发布时间:2024年01月23日

一.实验拓扑

二.实验步骤

1、骨干链路IP地址及环回接口的配置

R2

?
[r2]int g0/0/2
[r2-GigabitEthernet0/0/2]ip a 23.0.0.1 24
[r2-GigabitEthernet0/0/2]int lo0
[r2-LoopBack0]ip a 2.2.2.2 24

?

R3

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip a 23.0.0.2 24
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip a 34.0.0.1 24
[r3-GigabitEthernet0/0/1]int lo0
[r3-LoopBack0]ip a 3.3.3.3 24

R4

[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip a 34.0.0.2 24
[r4-GigabitEthernet0/0/0]int g4/0/0
[r4-GigabitEthernet4/0/0]ip a 47.0.0.2 24
[r4-GigabitEthernet4/0/0]int lo0
[r4-LoopBack0]ip a 4.4.4.4 24

R7

[r7]int g0/0/1
[r7-GigabitEthernet0/0/1]ip a 47.0.0.1 24

其余配置根据网址划分分配!

2、启动IGP协议OSPF

R2

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

R3? ?

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 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]a 0??
[r4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 47.0.0.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

其余配置根据网址划分分配!

3、配置IP地址及环回接口

以R1、R5、R6、R7为例:

R1

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip a 192.168.2.1 24
[r1-GigabitEthernet0/0/0]int lo0
[r1-LoopBack0]ip a 192.168.1.1 24

R6

[r6-GigabitEthernet0/0/0]ip a 172.16.2.1 24
[r6-GigabitEthernet0/0/0]int lo0
[r6-LoopBack0]ip a 172.16.1.1 24

R5

[r5-GigabitEthernet0/0/0]ip a 192.168.3.1 24
[r5-GigabitEthernet0/0/0]int lo0
[r5-LoopBack0]ip a 192.168.4.1 24?

R7

[r7-GigabitEthernet0/0/0]ip a 172.168.3.1 24
[r7-GigabitEthernet0/0/0]int lo0
[r7-LoopBack0]ip a 172.16.4.1 24

其余配置根据网址划分分配!

4、静态配置路由

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]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1

R5

[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

R4

[r4]ip route-static vpn-instance a 192.168.4.0 24 192.168.3.1

其余配置根据网址划分分配!

5、动态路由配置

R6

[r6]rip 1
[r6-rip-1]v 2
[r6-rip-1]network 172.16.0.0

R2

[r2]rip 1 vpn-instance b
[r2-rip-1]v 2? ?
[r2-rip-1]network 172.16.0.0

R7

[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]a 0
[r7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R4

[r4]ospf 2 vpn-instance b router-id 4.4.4.4
[r4-ospf-2]a 0? ??
[r4-ospf-2-area-0.0.0.0]network 172.16.0.0 0.0.255.255

其余配置根据网址划分分配!

9、发布路由

R2

[r2-bgp]ipv4-family vpn-instance a? ? ? ? ? ? ? ? ?将R1静态与直连重发布
[r2-bgp-a]import-route static?
[r2-bgp-a]import-route direct?

R4

[r4-bgp]ipv4-family vpn-instance a? ???????????????将R5静态与直连重发布
[r4-bgp-a]import-route static?
[r4-bgp-a]import-route direct?

R2

[r2-bgp]ipv4-family vpn-instance b? ? ? ? ? ? ? ?? 将RIP与BGP进行双向重发布
[r2-bgp-b]import-route rip 1
[r2]rip? ?
[r2-rip-1]import-route bgp?

R4

[r4-bgp]ipv4-family vpn-instance b? ? ? ? ? ? ? ???将BGP与OSPF进行双向重发布
[r4-bgp-b]import-route ospf 2
[r4]ospf 2
[r4-ospf-2]import-route bgp?
文章来源:https://blog.csdn.net/dgw2648633809/article/details/135763680
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。