个人技术分享

敲半天一个闪退全™给我干没了呜呜呜,eNSP,wcnm!wcnm!wcnm!

在这里插入图片描述
→b站传送门,感谢大佬←

→华为eNSP中型企业局域网网络规划设计(下)←

→拓扑图传送门,可以自己配置着玩←
在这里插入图片描述

1.部门可以访问公司资源和互联网资源
2.部门之间不能互访
3.服务器要有单独的服务器区和交换机内部网络使用私有ip地址

配置vlan/各端口类型/链路聚合

SW1~8, SW10

#
vlan batch 10 20 30 40 50 60 100
#

SW1

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
 stp edged-port enable
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10
#

SW2

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 20
 stp edged-port enable
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 20
#

SW3

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 30
 stp edged-port enable
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 30
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 30
#

SW4

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 40
 stp edged-port enable
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 40
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 40
#

SW5

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 50
 stp edged-port enable
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 50
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 50
#

SW6

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 60
 stp edged-port enable
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 60
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 60
#

SW7

[SW7]port-group trunk
[SW7-port-group-trunk]group-member g0/0/1 to g0/0/7
[SW7-port-group-trunk]p l t
[SW7-port-group-trunk]p t a v all

//链路聚合
[SW7]int Eth-Trunk 1
[SW7-Eth-Trunk1]trunkport g0/0/10
[SW7-Eth-Trunk1]trunkport g0/0/11 
[SW7-Eth-Trunk1]p l t
[SW7-Eth-Trunk1]p t a v all

[SW7]v b 77 78

#
interface GigabitEthernet0/0/8
 port link-type access
 port default vlan 77
#
interface GigabitEthernet0/0/9
 port link-type access
 port default vlan 78
#
interface Vlanif77
 ip address 192.168.77.7 255.255.255.0
#
interface Vlanif78
 ip address 192.168.78.7 255.255.255.0
#

SW8

[SW8]port-group trunk
[SW8-port-group-trunk]group-member g0/0/1 to g0/0/7
[SW8-port-group-trunk]p l t
[SW8-port-group-trunk]p t a v all

//链路聚合
[SW8]int Eth-Trunk 1
[SW8-Eth-Trunk1]trunkport g0/0/10
[SW8-Eth-Trunk1]trunkport g0/0/11 
[SW8-Eth-Trunk1]p l t
[SW8-Eth-Trunk1]p t a v all

[SW8]v b 87 88

#
interface GigabitEthernet0/0/8
 port link-type access
 port default vlan 87
#
interface GigabitEthernet0/0/9
 port link-type access
 port default vlan 88
#
interface Vlanif87
 ip address 192.168.87.8 255.255.255.0
#
interface Vlanif88
 ip address 192.168.88.8 255.255.255.0
#

SW9

[SW9]v b 200 201 91 92

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 200
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 201
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 91
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 92
#
interface Vlanif200
 ip address 192.168.200.254 255.255.255.0
#
interface Vlanif201
 ip address 192.168.201.254 255.255.255.0
#
interface Vlanif91
 ip address 192.168.91.254 255.255.255.0
#
interface Vlanif92
 ip address 192.168.92.254 255.255.255.0
#

Server1
在这里插入图片描述
Server2
在这里插入图片描述

SW10

#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 100
 stp edged-port enable
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 100
#
interface Vlanif100
 ip address 192.68.100.254 255.255.255.0
#

AR-DHCP

#
interface GigabitEthernet0/0/0
 ip address 192.168.100.1 255.255.255.0 
#

AR1

#
interface GigabitEthernet0/0/0
 ip address 192.168.77.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.87.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 192.168.13.1 255.255.255.0 
#
interface GigabitEthernet4/0/0
 ip address 192.168.91.1 255.255.255.0 
#
interface GigabitEthernet4/0/1
 ip address 192.168.12.1 255.255.255.0 
#

AR2

#
interface GigabitEthernet0/0/0
 ip address 192.168.78.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.88.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 192.168.23.2 255.255.255.0 
#
interface GigabitEthernet4/0/0
 ip address 192.168.92.2 255.255.255.0 
#
interface GigabitEthernet4/0/1
 ip address 192.168.12.2 255.255.255.0 
#

AR3

#
interface GigabitEthernet0/0/0
 ip address 192.168.13.3 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.23.3 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 100.1.11.3 255.255.255.0 
#

AR5

#
interface GigabitEthernet0/0/0
 ip address 100.2.33.254 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 100.1.33.5 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 100.1.11.5 255.255.255.0 
#

Server3

在这里插入图片描述

配置mstp

将SW7设置为vlan 10 20 30 100的根桥,SW8为备份根桥
将SW8设置为vlan 40 50 60的根桥,SW7为备份根桥

SW1~8,SW10

[SW7]stp mode mstp

#
stp region-configuration
 region-name region1
 instance 1 vlan 10 20 30 100
 instance 2 vlan 40 50 60
 active region-configuration
#

SW7

[SW7]stp instance 1 root primary
[SW7]stp instance 2 root secondary

SW8

[SW8]stp instance 1 root secondary
[SW8]stp instance 2 root primary 

配置vrrp

SW7

#
interface Vlanif10
 ip address 192.168.10.7 255.255.255.0
 vrrp vrid 10 virtual-ip 192.168.10.254
 vrrp vrid 10 priority 120
#
interface Vlanif20
 ip address 192.168.20.7 255.255.255.0
 vrrp vrid 20 virtual-ip 192.168.20.254
 vrrp vrid 20 priority 120
#
interface Vlanif30
 ip address 192.168.30.7 255.255.255.0
 vrrp vrid 30 virtual-ip 192.168.30.254
 vrrp vrid 30 priority 120
#
interface Vlanif40
 ip address 192.168.40.7 255.255.255.0
 vrrp vrid 40 virtual-ip 192.168.40.254
#
interface Vlanif50
 ip address 192.168.50.7 255.255.255.0
 vrrp vrid 50 virtual-ip 192.168.50.254
#
interface Vlanif60
 ip address 192.168.60.7 255.255.255.0
 vrrp vrid 60 virtual-ip 192.168.60.254
#
interface Vlanif100
 ip address 192.168.100.7 255.255.255.0
 vrrp vrid 100 virtual-ip 192.168.100.254
 vrrp vrid 100 priority 120
#

SW8

#
interface Vlanif10
 ip address 192.168.10.8 255.255.255.0
 vrrp vrid 10 virtual-ip 192.168.10.254
#
interface Vlanif20
 ip address 192.168.20.8 255.255.255.0
 vrrp vrid 20 virtual-ip 192.168.20.254
#
interface Vlanif30
 ip address 192.168.30.8 255.255.255.0
 vrrp vrid 30 virtual-ip 192.168.30.254
#
interface Vlanif40
 ip address 192.168.40.8 255.255.255.0
 vrrp vrid 40 virtual-ip 192.168.40.254
 vrrp vrid 40 priority 120
#
interface Vlanif50
 ip address 192.168.50.8 255.255.255.0
 vrrp vrid 50 virtual-ip 192.168.50.254
 vrrp vrid 50 priority 120
#
interface Vlanif60
 ip address 192.168.60.8 255.255.255.0
 vrrp vrid 60 virtual-ip 192.168.60.254
 vrrp vrid 60 priority 120
#
interface Vlanif100
 ip address 192.168.100.8 255.255.255.0
 vrrp vrid 100 virtual-ip 192.168.100.254
#

配置dhcp

AR-DHCP

#
ip pool vlan10
 gateway-list 192.168.10.254 
 network 192.168.10.0 mask 255.255.255.0 
 excluded-ip-address 192.168.10.7 192.168.10.8 
#
ip pool vlan20
 gateway-list 192.168.20.254 
 network 192.168.20.0 mask 255.255.255.0 
 excluded-ip-address 192.168.20.7 192.168.20.8 
#
ip pool vlan30
 gateway-list 192.168.30.254 
 network 192.168.30.0 mask 255.255.255.0 
 excluded-ip-address 192.168.30.7 192.168.30.8 
#
ip pool vlan40
 gateway-list 192.168.40.254 
 network 192.168.40.0 mask 255.255.255.0 
 excluded-ip-address 192.168.40.7 192.168.40.8 
#
ip pool vlan50
 gateway-list 192.168.50.254 
 network 192.168.50.0 mask 255.255.255.0 
 excluded-ip-address 192.168.50.7 192.168.50.8 
#
ip pool vlan60
 gateway-list 192.168.60.254 
 network 192.168.60.0 mask 255.255.255.0 
 excluded-ip-address 192.168.60.7 192.168.60.8 
#

[DHCP]dhcp en
[DHCP-GigabitEthernet0/0/0]dhcp select global

//因为dhcp服务器没有路由,需要手动配置一条
[DHCP]ip route-static 0.0.0.0 0 192.168.100.254

配置dhcp中继

SW7

[SW7]dhcp en
[SW7]int Vlanif 10
[SW7-Vlanif10]dhcp select relay
[SW7-Vlanif10]dhcp relay server-ip 192.168.100.1
[SW7]int Vlanif 20
[SW7-Vlanif10]dhcp select relay
[SW7-Vlanif10]dhcp relay server-ip 192.168.100.1
[SW7]int Vlanif 30
[SW7-Vlanif10]dhcp select relay
[SW7-Vlanif10]dhcp relay server-ip 192.168.100.1
[SW7]int Vlanif 40
[SW7-Vlanif10]dhcp select relay
[SW7-Vlanif10]dhcp relay server-ip 192.168.100.1
[SW7]int Vlanif 50
[SW7-Vlanif10]dhcp select relay
[SW7-Vlanif10]dhcp relay server-ip 192.168.100.1
[SW7]int Vlanif 60
[SW7-Vlanif10]dhcp select relay
[SW7-Vlanif10]dhcp relay server-ip 192.168.100.1

SW8

[SW8]dhcp en
[SW8]int vlanif 10 
[SW8-Vlanif10] dhcp relay server-ip 192.168.100.1
[SW8]int vlanif 20 
[SW8-Vlanif10] dhcp relay server-ip 192.168.100.1
[SW8]int vlanif 30 
[SW8-Vlanif10] dhcp relay server-ip 192.168.100.1
[SW8]int vlanif 40 
[SW8-Vlanif10] dhcp relay server-ip 192.168.100.1
[SW8]int vlanif 50 
[SW8-Vlanif10] dhcp relay server-ip 192.168.100.1
[SW8]int vlanif 60 
[SW8-Vlanif10] dhcp relay server-ip 192.168.100.1

检查一下,成功拿到ip地址
在这里插入图片描述