華為小實驗(路由下發、MSTP、VRRP、DHCP、DHCP中繼、NAT、鏈路聚合)
- 前言
- 一、題目及需求
- 二、每個配置
- 1、R1
- 2、R2
- 3、R3
- 4、R4
- 5、LSW1
- 6、LSW2
- 7、LSW3
- 總結
前言
華為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 trunk
port trunk allow-pass vlan 2 to 4094
#
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 trunk
port trunk allow-pass vlan 2 to 4094
#
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 trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
總結
題目不難,東西也不多,練練手的,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/247626.html
標籤:其他
上一篇:大資料學習筆記第3課 基于Yarn的Spark實時計算
下一篇:編程,又一次的開始
