MPLS实验

一、实验拓扑

MPLS实验_第1张图片

 MPLS实验_第2张图片

 

二、实验要求

1、R1与R5 MPLS VPN;

2、R2与R6 MPLS VPN;

3、R7可以访问R2/3/4的环回;

三、实验思路

1、IP地址的配置;

2、R2/3/4的IGP配置;

3、R2/3/4的MPLS配置;

4、R2/3/4的MPLS VPN配置;

5、R2/4的BGP配置;

6、内网宣告R1/5使用静态路由配置,R6/7使用动态路由配置;

7、R7的缺省路由配置,NAT配置;

8、测试;

四、实验配置

R1配置

//基础配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int l0
[R1-LoopBack0]ip add 192.168.1.1 24
[R1-LoopBack0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.2.1 24

//静态路由配置
[R1]ip route-static 0.0.0.0 0 192.168.2.2

R2配置

//基础配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 23.1.1.1 24
[R2-GigabitEthernet0/0/2]int l0
[R2-LoopBack0]ip add 2.2.2.2 24

//OSPF配置
[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.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0

//MPLS配置
[R2]mpls lsr-id 2.2.2.2
[R2]mpls
[R2-mpls]mpls ldp
[R2-mpls-ldp]int g0/0/2
[R2-GigabitEthernet0/0/2]mpls
[R2-GigabitEthernet0/0/2]mpls ldp

//MPLS VPN配置
[R2]ip -instance A1	
[R2--instance-A1]ipv4-family
[R2--instance-A1-af-ipv4]route-distinguisher 1:1
[R2--instance-A1-af-ipv4]-target 1:1
[R2--instance-A1-af-ipv4]int g0/0/1
[R2-GigabitEthernet0/0/1]ip binding -instance A1
[R2-GigabitEthernet0/0/1]ip add 192.168.2.2 24

[R2]ip -instance B1
[R2--instance-B1]ipv4-family
[R2--instance-B1-af-ipv4]route-distinguisher 2:2
[R2--instance-B1-af-ipv4]-target 2:2
[R2--instance-B1-af-ipv4]int g0/0/0	
[R2-GigabitEthernet0/0/0]ip binding -instance B1
[R2-GigabitEthernet0/0/0]ip add 192.168.2.2 24

//BGP配置
[R2]bgp 2
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 4.4.4.4 as-number 2
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R2-bgp]peer 4.4.4.4 next-hop-local	
[R2-bgp]ipv4-family v4
[R2-bgp-af-v4]peer 4.4.4.4 enable

//内网静态宣告
[R2]ip route-static -instance B1 192.168.1.0 24 192.168.2.1
[R2]bgp 2	
[R2-bgp]ipv4 -instance B1
[R2-bgp-B1]import-route direct 
[R2-bgp-B1]import-route static 

//内网动态宣告
[R2]rip 1 -instance A1
[R2-rip-1]ver 2
[R2-rip-1]network 192.168.2.0	
[R2-rip-1]import-route bgp
[R2-rip-1]q
[R2]bgp 2
[R2-bgp]ipv4-family -instance A1
[R2-bgp-A1]import-route rip 1

R3配置

//基础配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int l0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 34.1.1.1 24

//OSPF配置
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 34.1.1.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0

//MPLS配置
[R3]mpls lsr-id 3.3.3.3
[R3]mpls
[R3-mpls]mpls ldp
[R3-mpls-ldp]int g0/0/0
[R3-GigabitEthernet0/0/0]mpls
[R3-GigabitEthernet0/0/0]mpls ldp
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]mpls
[R3-GigabitEthernet0/0/1]mpls ldp

R4配置

//基础配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int l0
[R4-LoopBack0]ip add 4.4.4.4 24
[R4-LoopBack0]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 34.1.1.2 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 47.1.1.2 24

//OSPF配置
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 47.1.1.2 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 34.1.1.2 0.0.0.0

//MPLS配置
[R4]mpls lsr-id 4.4.4.4
[R4]mpls
[R4-mpls]mpls ldp
[R4-mpls-ldp]int g0/0/0
[R4-GigabitEthernet0/0/0]mpls
[R4-GigabitEthernet0/0/0]mpls ldp
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]mpls
[R4-GigabitEthernet0/0/1]mpls ldp

//MPLS VPN配置
[R4]ip -instance B2
[R4--instance-B2]ipv4-family 
[R4--instance-B2-af-ipv4]route-distinguisher 2:2
[R4--instance-B2-af-ipv4]-target 2:2
[R4--instance-B2-af-ipv4]int g4/0/0
[R4-GigabitEthernet4/0/0]ip binding -instance B2
[R4-GigabitEthernet4/0/0]ip add 192.168.3.2 24

[R4]ip -instance A2
[R4--instance-A2]ipv4-family 
[R4--instance-A2-af-ipv4]route-distinguisher 1:1
[R4--instance-A2-af-ipv4]-target 1:1
[R4--instance-A2-af-ipv4]int g0/0/2
[R4-GigabitEthernet0/0/2]ip binding -instance A2
[R4-GigabitEthernet0/0/2]ip add 192.168.3.2 24

//BGP配置
[R4]bgp 2
[R4-bgp]router-id 4.4.4.4
[R4-bgp]peer 2.2.2.2 as-number 2	
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R4-bgp]peer 2.2.2.2 next-hop-local
[R4-bgp]ipv4-family v4
[R4-bgp-af-v4]peer 2.2.2.2 enable

//内网宣告
[R4]ip route-static -instance B2 192.168.4.0 24 192.168.3.1
[R4]bgp 2
[R4-bgp]ipv4 -instance B2
[R4-bgp-B2]import-route direct 
[R4-bgp-B2]import-route static

//内网动态宣告
[R4]ospf 2 -instance A2
[R4-ospf-2]area 0
[R4-ospf-2-area-0.0.0.0]network 192.168.3.2 0.0.0.0
[R4-ospf-2-area-0.0.0.0]q
[R4-ospf-2]import-route bgp
[R4-ospf-2]q
[R4]bgp 2	
[R4-bgp]ipv4-family -instance A2
[R4-bgp-A2]import-route ospf 2

R5配置

//基础配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R5
[R5]int l0
[R5-LoopBack0]ip add 192.168.4.1 24
[R5-LoopBack0]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.3.1 24

//静态路由配置
[R5]ip route-static 0.0.0.0 0 192.168.3.2

R6配置

//基础配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R6
[R6]int l0
[R6-LoopBack0]ip add 192.168.1.1 24
[R6-LoopBack0]int g0/0/1
[R6-GigabitEthernet0/0/1]ip add 192.168.2.1 24

//RIP配置
[R6]rip 1
[R6-rip-1]ver 2
[R6-rip-1]network 192.168.2.0
[R6-rip-1]network 192.168.1.0

R7配置

//基础配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R7
[R7]int l0
[R7-LoopBack0]ip add 7.7.7.7 24
[R7-LoopBack0]int l1
[R7-LoopBack1]ip add 192.168.4.2 24
[R7-LoopBack0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 192.168.3.1 24
[R7-GigabitEthernet0/0/1]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 47.1.1.1 24

//OSPF配置
[R7]ospf 1
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 192.168.4.2 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 192.168.3.1 0.0.0.0

//缺省路由配置
[R7]ip route-static 0.0.0.0 0 47.1.1.2

//NAT配置
[R7]acl 2000
[R7-acl-basic-2000]rule permit source 192.168.4.2 0.0.0.0
[R7-acl-basic-2000]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000

五、测试

MPLS实验_第3张图片

 MPLS实验_第4张图片

 MPLS实验_第5张图片

 MPLS实验_第6张图片

MPLS实验_第7张图片 

MPLS实验_第8张图片 

MPLS实验_第9张图片 

MPLS实验_第10张图片 

MPLS实验_第11张图片 

MPLS实验_第12张图片 

MPLS实验_第13张图片 

MPLS实验_第14张图片 

 

你可能感兴趣的:(网络,华为,运维)