HCIP---MPLS实验

1.拓扑结构

HCIP---MPLS实验_第1张图片

2.配置IGP

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255 
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255  

 3.配置MPLS

R2

[R2]mpls lsr-id 2.2.2.2
[R2]mpls
[R2-mpls]mpls ldp

[R2-GigabitEthernet0/0/1]mpls
[R2-GigabitEthernet0/0/1]mpls ldp

R3

[R3]mpls lsr-id 3.3.3.3
[R3]mpls
[R3-mpls]mpls ldp

[R3-GigabitEthernet0/0/0]mpls
[R3-GigabitEthernet0/0/0]mpls ldp

[R3-GigabitEthernet0/0/1]mpls
[R3-GigabitEthernet0/0/1]mpls ldp 

R4

[R4]mpls lsr-id 4.4.4.4
[R4]mpls
[R4-mpls]mpls ldp

[R4-GigabitEthernet0/0/0]mpls
[R4-GigabitEthernet0/0/0]mpls ldp

HCIP---MPLS实验_第2张图片
4.配置MPLS VPN

[R2]ip -instance a
[R2--instance-a]route-distinguisher 1:1
[R2--instance-a]-target 1:1
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip binding -instance a
[R2-GigabitEthernet0/0/0]ip address 192.168.2.2 24
[R2]ip -instance b
[R2--instance-a]route-distinguisher 2:2
[R2--instance-a]-target 2:2
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip binding -instance b
[R2-GigabitEthernet0/0/1]ip address 192.168.2.2 24

5.在子公司之间的虚拟空间中建立动态路由

[R1]ospf 2 router-id 1.1.1.1 
[R1-ospf-2]area 0.0.0.0 
[R1-ospf-2-area-0.0.0.0]network 192.168.1.0 0.0.0.255 
[R1-ospf-2-area-0.0.0.0]network 192.168.2.0 0.0.0.255 

[R2]ospf 2 -instance a
[R2-ospf-2]area 0
[R2-ospf-2-area-0.0.0.0]network 192.168.2.0 0.0.0.255 
[R2]ospf 3 -instance b
[R2-ospf-3]area 0
[R2-ospf-3-area-0.0.0.0]network 192.168.2.0 0.0.0.255 

HCIP---MPLS实验_第3张图片

6.配置BGP并进行双向重发布

[R2]bgp 1
[R2-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 LoopBack 0
[R2-bgp]ipv4-family v4
[R2-bgp-af-v4]peer 4.4.4.4 enable 

[R2]bgp  1
[R2-bgp]ipv4-family -instance a
[R2-bgp-a]import-route ospf 2
[R2-bgp]ipv4-family -instance b
[R2-bgp-b]import-route ospf 3
[R2]ospf 2
[R2-ospf-2]import-route bgp
[R2]ospf 3
[R2-ospf-3]import-route bgp 

HCIP---MPLS实验_第4张图片

7.配置NAT与缺省

[R7]acl 2000
[R7-acl-basic-2000]rule 1 permit source any 
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
[R7]ip route-static 0.0.0.0 0 47.1.1.4

[R3]ip route-static 0.0.0.0 0 34.1.1.4

HCIP---MPLS实验_第5张图片

8.测试

HCIP---MPLS实验_第6张图片 

HCIP---MPLS实验_第7张图片 

 

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