Hcip实验

Hcip实验_第1张图片

 要求:全网可达\n\n

二、实验开始

配置IP地址以及环回(这里已经配置好具体可参考之前实验)

OSPF,RIP(r7配置OSPF,r8配置RIP,这里已经配置好)配置mpls步骤:\n1.IP可达—使用路由协议全网可达\n\n2.配置

MPLS-LDP\n\n[r2]mpls lsr-id 2.2.2.2    //必须先定义mpls的router-id,要为本地设备的真实IP地址,且邻居可达,因为该地址将用于建立TCP会话,建议使用环回地址\n\n[r2]mpls          //再开启mpls协议\n\n[r2-mpls]mpls ldp      //再激活LDP协议\n\n[r2-mpls-ldp]q\n\n之后需要在所有的标签经过的接口上开启协议\n\n[r2]interface GigabitEthernet 0/0/1\n\n[r2-GigabitEtherent0/0/1]mpls     //先开启MPLS\n\n[r2-GigabitEtherent0/0/1]mpls ldp     //再激活LDP协议\n\n[r2]route recursive-lookup tunnel      //开启隧道递归

R2

[r2]mpls lsr-id 2.2.2.2
[r2]mp1s
[r2-mpls]mpls ld
[r2-mpls-1dp]q
[r2]int g0/0/1
[r2-GigabitEthernete/0/1]mpls
[r2-GigabitEtherneto/0/1]mpls ldp
[r2]int g0/0/2
[r2-GigabitEthernete/0/2]mpls
[r2-GigabitEtherneto/0/2]mpls ldp
[r2]ip -instance 1
[r2--instance-1]route-distinguisher 1:1
[r2--instance-1-af-ipv4]-target 5:5 6:6 import-extcommunity IVT Assignment result:
Info: VPN-Target assignment is successful.
[r2--instance-1-af-ipv4]-target 1:1 export-extcommunity[r2-GigabitEtherneto/0/0]undo ip add
[r2-GigabitEthernet0/0/0]ip binding -instance 1 //注:这里需先[r2-GigabitEtherneto/0/o]ip add 12.1.1.2 24 //再配上ip[r2]ip route-static -instance 1 1.1.1.1 32 12.1.1.1
[r2]bgp 1
[r2-bgp]ipv4-family -instance 1
[r2-bgp-1]import-route static

R3

[r3]mpls lsr-id 3.3.3.3
[r3]mpls
[r3-mpls]mpls ld
[r3-mp1s-1dp]q
[r3]int go/0/0
[r3-GigabitEtherneto/0/0]mpls[r3-GigabitEthernet0/0/0]mpls ldp
[r3]int g0/0/1
[r3-GigabitEtherneto/0/1]mpls[r3-GigabitEthernet0/0/1]mpls ldp
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]mpls[r3-GigabitEthernet0/0/2]mpls ldp

R5

[r5]mpls lsr-id 5.5.5.5
[r5]mpls
Info: Mpls starting, please wait... OK!
[r5-mp1s]mp1s 1dp
[r5-mp1s-1dp]q
[r5]int go/0/0
[r5-GigabitEthernet0/0/0]mpls
[r5-GigabitEthernet0/0/0]mpls ldp
[r5]int go/0/1
[r5-GigabitEthernete/8/1]mpls
[r5-GigabitEtherneto/0/1]mpls ldp
[r5]ip
[r5]ip -instance 2
[r5--instance-2]route-distinguisher 5:5
[r5--instance-2-af-ipv4]-target 1:1 6:6 import-extcommunity IVT Assignment result:
Info:VPN-Target assignment is successful.
[r5--instance-2-af-ipv4]-target 5:5 export-extcommunity EVT Assignment result:
Info:VPN-Target assignment is successful.
[r5--instance-2-af-ipv4]q
[r5--instance-2]q
[r5]int go/0/2
[r5-GigabitEtherneto/0/2]undo ip add
[r5-GigabitEthernet0/0/2]ip binding -instance 2
[r5-GigabitEthernete/0/2]ip add 57.1.1.1 24
[r5]rip 1 -instance 2
[r5-rip-1]version 2
[r5-rip-1]network 57.0.0.0
[r5-rip-1]import-router bgp
[r5-rip-1]q
[r5]bgp 100
[r5-bgp]ipv4-family -instance 2
[r5-bgp-2]import-route rip 1
R6

[r6]ip
r6]ip -instance 3
[r6--instance-3]rou
[r6--instance-3]route-distinguisher 6:6
r6--instance-3-af-ipv4]-target 1:1 5:5 import-extcommunity IVT Assignment result:
Info: VPN-Target assignment is successful.
[r6--instance-3-af-ipv4]-target 6:6 export-extcommunity EVT Assignment result:
Info: VPN-Target assignment is successful.
[r6--instance-3-af-ipv4]q
[r6--instance-3]q
[r6]int go/0/2
r6-GigabitEtherneto/0/2]ip add 68.1.1.1 24
[r6]ospf 2
[r6]ospf 2 -instance 3
[r6-ospf-2]area 0
[r6-ospf-2-area-0.0.0.0]network 68.1.1.1 0.0.0.0
[r6]bgp 100
[r6-bgp]ipv4-family -instance 3
[r6-bgp-3]import-route ospf 2
 

 

你可能感兴趣的:(网络)