ensp小实验走起来(路由下发、MSTP、VRRP、DHCP、DHCP中继、NAT、链路聚合)之配置

华为小实验(路由下发、MSTP、VRRP、DHCP、DHCP中继、NAT、链路聚合)


前言

华为ensp小实验走起来。

一、题目及需求

在这里插入图片描述

要求按照拓扑图配置相关命令使得图中所有终端能够网络互通。
(1)MSTP+链路聚合:在SW1和SW2之间配置链路聚合,要求正常情况下有2条链路活跃、一条链路备份。常情况下各VLAN流量路径要求:VLAN10:SW3->SW2->R1;VLAN20:SW3->SW1->R1
(2)VRRP:正常情况下要求VLAN10的Master为SW2;VLAN20的Master为SW1
(3)DHCP:R3为DHCP中继代理,R2为DHCP服务器,为PC4、PC5提供动态分配IP服务。
(4)按照拓扑图中的要求在各三层交换机和路由器上配置路由,使得所有PC终端能够网络互通(10分)。
(5)NAT:使用EasyIp进行转换使得Client1能够使用R1的外网口IP访问外网;并使用NAT-Server使得Client1访问Server1的web服务时能够使用目标网址23.0.0.3/24的8080端口进行访问

二、每个配置

1、R1

 sysname R1
#
acl number 3000  
 rule 5 permit ip source 192.168.10.0 0.0.0.255 
#
interface GigabitEthernet0/0/0
 ip address 10.0.0.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 11.0.0.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 12.0.0.1 255.255.255.0 
 nat outbound 3000
#
ospf 1 
 area 0.0.0.0 
  network 10.0.0.0 0.0.0.255 
  network 11.0.0.0 0.0.0.255 
  network 12.0.0.0 0.0.0.255 
#
user-interface con 0
 authentication-mode password

2、R2

sysname R2
#
dhcp enable
#
ip pool 1
 gateway-list 192.168.40.1 
 network 192.168.40.0 mask 255.255.255.0 
 dns-list 8.8.8.8 
#
interface GigabitEthernet0/0/0
 ip address 12.0.0.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 23.0.0.2 255.255.255.0 
 dhcp select global
#
interface GigabitEthernet0/0/2
 ip address 24.0.0.2 255.255.255.0 
#
ospf 1 
 import-route direct
 import-route static
 import-route rip 1 cost 1 type 1
 area 0.0.0.0 
  network 12.0.0.0 0.0.0.255 
#
rip 1
 undo summary
 default-route originate
 version 2
 network 23.0.0.0
 import-route ospf 1 cost 3
#
ip route-static 192.168.30.0 255.255.255.0 24.0.0.4
#
user-interface con 0
 authentication-mode password
 idle-timeout 0 0

3、R3

 sysname R3
#
dhcp enable
#
interface GigabitEthernet0/0/0
 ip address 23.0.0.1 255.255.255.0 
 nat server protocol tcp global 23.0.0.3 8080 inside 192.168.50.100 www
#
interface GigabitEthernet0/0/1
 ip address 192.168.40.1 255.255.255.0 
 dhcp select relay
 dhcp relay server-ip 23.0.0.2
#
interface GigabitEthernet0/0/2
 ip address 192.168.50.1 255.255.255.0 
#
rip 1
 undo summary
 version 2
 network 23.0.0.0
 network 192.168.40.0
 network 192.168.50.0
#
user-interface con 0
 authentication-mode password
 idle-timeout 0 0

4、R4

 sysname R4
#
interface GigabitEthernet0/0/0
 ip address 192.168.30.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
 ip address 24.0.0.4 255.255.255.0 
#
ip route-static 0.0.0.0 0.0.0.0 24.0.0.2
#
user-interface con 0
 authentication-mode password
 idle-timeout 0 0

5、LSW1

sysname sw1
#
vlan batch 10 20 100
#
stp instance 1 root secondary
stp instance 2 root primary
#
lacp priority 1000
#
stp region-configuration
 region-name huawei
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#
interface Vlanif10
 ip address 192.168.10.10 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.10.1
#
interface Vlanif20
 ip address 192.168.20.10 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.20.1
 vrrp vrid 2 priority 120
 vrrp vrid 2 track interface GigabitEthernet0/0/5 reduced 30
#
interface Vlanif100
 ip address 10.0.0.10 255.255.255.0
#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
 max active-linknumber 2
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 20
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 1
#
interface GigabitEthernet0/0/4
 eth-trunk 1
#
interface GigabitEthernet0/0/5
 port link-type access
 port default vlan 100
#
ospf 1
 area 0.0.0.0
  network 10.0.0.0 0.0.0.255
  network 192.168.20.0 0.0.0.255

6、LSW2

sysname sw2
#
vlan batch 10 20 100
#
stp instance 1 root primary
stp instance 2 root secondary
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
stp region-configuration
 region-name huawei
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#
interface Vlanif10
 ip address 192.168.10.20 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.10.1
 vrrp vrid 1 priority 120
 vrrp vrid 1 track interface GigabitEthernet0/0/5 reduced 30
#
interface Vlanif20
 ip address 192.168.20.20 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.20.1
#
interface Vlanif100
 ip address 11.0.0.20 255.255.255.0
#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
 max active-linknumber 2
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 1
#
interface GigabitEthernet0/0/4
 eth-trunk 1
#
interface GigabitEthernet0/0/5
 port link-type access
 port default vlan 100
#
ospf 1
 area 0.0.0.0
  network 11.0.0.0 0.0.0.255
  network 192.168.10.0 0.0.0.255

7、LSW3

sysname sw3
#
vlan batch 10 20 100
#
stp region-configuration
 region-name huawei
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 20
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 20
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10

总结

题目不难,东西也不多,练练手的。

猜你喜欢

转载自blog.csdn.net/Lucien010230/article/details/112495190