当前位置:网站首页>Huawei simulator ENSP - hcip - MPLS experiment

Huawei simulator ENSP - hcip - MPLS experiment

2022-07-05 23:29:00 Fried chicken shop owner Z

Topology :

 Please add a picture description

The experimental requirements :

  1. R1 And R5MPLS Virtual private line

  2. R6 And R7MPLS Virtual private line

  3. R7 You can visit R2/3/4 The loopback of

  4. B1、B2 Using static routing protocol ;A1 Use RIP agreement ;A2 Use OSPF agreement ;A1、A2 Can pass R7 Visit the public network

  5. All loopback addresses use 192.168.1.0;CE And PE Direct link usage 2.0、3.0;R5 Loopback 4.1;R6 Loopback 4.2

Ideas :

 Configure router interface IP-> Configure the public network IGP agreement -> Configure the public network MPLS-> Configure the public network BGP agreement -> Configure private network IGP agreement -> To configure nat

Configuration command :

R1:

sys 
sys r1
// Configure router interface IP Address 
int g0/0/0
ip add 192.168.2.1 24
int lo0
ip add 192.168.1.1 24
// Static routing 
ip route-static 192.168.3.0 24 192.168.2.2
ip route-static 192.168.4.0 24 192.168.2.2
 

R2:

sys 
sys r2
// Configure router interface IP Address 
int g0/0/2 
ip add 23.0.0.1 24
int lo0 
ip add 2.2.2.2 24
// To configure ospf
ospf 1 router-id 2.2.2.2
a 0
network 23.0.0.0 0.0.0.255
network 2.2.2.2 0.0.0.255
// Global activation MPLS
mpls lsr-id 2.2.2.2
mpls
mpls ldp
// Interface activation MPLS
int g0/0/2
mpls
mpls ldp
// establish VRF Space 
ip vpn-instance B1
route-distinguisher 100:100
vpn-target 100:1 export-extcommunity
vpn-target 100:2 import-extcommunity
int g0/0/0
ip binding vpn-instance B1
ip vpn-instance A1
route-distinguisher 200:100
vpn-target 200:1 export-extcommunity
vpn-target 200:2 import-extcommunity
int g0/0/1
ip binding vpn-instance A1
int g0/0/0
ip add 192.168.2.2 24
int g0/0/1
ip add 192.168.2.4 24
// Static routing 
ip route-static vpn-instance B1 192.168.1.0 24 192.168.2.1
// To configure RIP
rip 1 vpn-instance A1
v 2
net 192.168.2.0
// To configure BGP agreement 
bgp 1
router-id 2.2.2.2
peer 4.4.4.4 as 1
peer 4.4.4.4 connect-interface LoopBack 0
peer 4.4.4.4 next-hop-local
ipv4-family vpnv4
peer 4.4.4.4 enable
ipv4-family vpn-instance B1
import-route direct
import-route static
ipv4-family vpn-instance A1
import-route direct
import-route rip 1
// stay RIP Medium weight distribution BGP
rip 1
import-route bgp
default-route originate 

R3:

sys 
sys r3
// Configure router interface IP Address 
int g0/0/0
ip add 23.0.0.2 24
int g0/0/1
ip add 34.0.0.1 24
int lo0
ip add 3.3.3.3 24
// To configure ospf
ospf 1 router-id 3.3.3.3
a 0
network 23.0.0.0 0.0.0.255
network 34.0.0.0 0.0.0.255
network 3.3.3.3 0.0.0.255
// Global activation MPLS
mpls lsr-id 3.3.3.3
mpls
mpls ldp
// Interface activation MPLS
int g0/0/0
mpls
mpls ldp
int g0/0/1
mpls
mpls ldp
 

R4:

sys 
sys r4
// Configure router interface IP Address 
int g0/0/0
ip add 34.0.0.2 24
int lo0
ip add 4.4.4.4 24
// To configure ospf
ospf 1 router-id 4.4.4.4
a 0
network 34.0.0.0 0.0.0.255
network 4.4.4.4 0.0.0.255
// Global activation MPLS
mpls lsr-id 4.4.4.4
mpls
mpls ldp
// Interface activation MPLS
int g0/0/0
mpls
mpls ldp
// establish VRF Space 
ip vpn-instance B2
route-distinguisher 100:200
vpn-target 100:1 import-extcommunity
vpn-target 100:2 export-extcommunity
int g0/0/1
ip binding vpn-instance B2
ip vpn-instance A2
route-distinguisher 200:200
vpn-target 200:1 import-extcommunity
vpn-target 200:2 export-extcommunity
int g0/0/2
ip binding vpn-instance A2
int g0/0/1
ip add 192.168.3.1 24
int g0/0/2
ip add 192.168.3.3 24
// Static routing 
ip route-static vpn-instance B2 192.168.4.0 24 192.168.3.2
// To configure ospf
ospf 2 vpn-instance A2 router-id 4.4.4.4
a 0
network 192.168.3.0 0.0.0.255
// To configure BGP agreement 
bgp 1
router-id 4.4.4.4
peer 2.2.2.2 as 1
peer 2.2.2.2 connect-interface LoopBack 0
peer 2.2.2.2 next-hop-local
ipv4-family vpnv4 
peer 2.2.2.2 enable
ipv4-family vpn-instance B2
import-route direct
import-route static
ipv4-family vpn-instance A2
import-route direct
import-route ospf 2
//OSPF Zhongzhong release bgp
ospf 2
import-route bgp
default-route-advertise always 
bgp  1
ipv4-family vpn-instance B2
default-route imported

R5:

sys 
sys r5
// Configure router interface IP Address 
int g0/0/0
ip add 192.168.3.2 24
int lo0
ip add 192.168.4.1 24
// Configure static routing 
ip route-static 192.168.1.0 24 192.168.3.1
ip route-static 192.168.2.0 24 192.168.3.1
 

R6:

sys 
sys r6
// Configure router interface IP Address 
int g0/0/0
ip add 192.168.2.3 24
int lo0
ip add 192.168.1.1 24
// To configure RIP
rip 1
v 2
net 192.168.1.0
net 192.168.2.0
 

R7:

sys 
sys r7
// Configure router interface IP Address 
int g0/0/0
ip add 192.168.3.4 24
int lo0
ip add 192.168.4.2 24
// To configure OSPF
ospf 1 router-id 7.7.7.7
a 0
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
// To configure nat
acl 2000 
rule permit source 192.168.0.0 0.0.255.255
int g0/0/1
nat outbound 2000
 

verification :

B1(192.168.1.1)ping B2(192.168.4.1)

 Please add a picture description
A1(192.168.1.1)ping A2(192.168.4.2)
 Please add a picture description

原网站

版权声明
本文为[Fried chicken shop owner Z]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140317270748.html