提示:文章完成后,目录可以自动生成,如何生成可以参考右边的帮助文档
文章目录
- 前言
- 一、项目需求:
- 二、拓扑设计
-
- 1.网络规划拓扑
- 2.IP与VLAN规划
- 3.详细配置
-
- 3.1 接入层交换机配置
- 3.2 汇聚层配置
- 3.3 核心层配置
- 3.4 防火墙配置
- 三、测试
-
- 1.VLAN间通信测试
-
- 1.1 VLAN 10与其他各VLAN间通信
- 1.2 其他各VLAN之间通信
- 2.内外网通信测试
-
- 2.1 VLAN 20与外网通信
- 2.2 VLAN 10/30/40外网通信
- 3.服务器测试
-
- 3.1 FTP服务器测试
- 3.2 HTTP服务器测试
- 4.DNS测试
- 5.dhcp测试
- 6.故障测试
-
- 5.1 接口故障测试
- 5.2 设备停机试验
- 四、总结
-
- 1. VLAN
- 2. ACL
- 3. LACP
- 4. DHCP
- 5. VRRP
- 6. MSTP
前言
结合各网络技术模块的知识,完成中小企业网络项目作为学习成果的检验和总结。
一、项目需求:
公司由总经理办公室、财务部、研发部、人力资源部四个部门组成。 具体要求包括以下几点: 1.R&D部是一个重要的部门,禁止其部门人员访问外网,以确保R&D信息不泄露。 。 2.为各部门设置VLAN,总经理室VLAN可与各部门互通网络,不允许与其他部门互通VLAN 20网络互通。 3、公司架设Web服务器,对Internet提供公司形象和电子商务服务。 四、确保安全,Internet公司内部网络之间应采取防护措施,防止外界未经授权访问内部网络。
二、拓扑设计
1.网络规划拓扑
2.IP与VLAN规划
名称 | 所属VLAN | 网段 |
---|---|---|
总经理室 | 10 | 192.168.10.0/24 |
研发部 | 20 | 192.168.20.0/24 |
财务部 | 30 | 192.168.30.0/24 |
人力部 | 40 | 192.168.40.0/24 |
SW1-SW2 | 50 | 192.168.50.0/24 |
SW1-FW1 | 60 | 192.168.60.0/24 |
SW2-FW1 | 70 | 192.168.70.0/24 |
3.详细配置
3.1 接入层交换机配置
# sysname LSW5 # vlan batch 10 20 # interface Vlanif1 # interface MEth0/0/1 # 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 trunk port trunk allow-pass vlan 2 to 4094 #
# sysname LSW6 # vlan batch 30 40 # interface Vlanif1 # interface MEth0/0/1 # interface Ethernet0/0/1 port link-type access port default vlan 30 # interface Ethernet0/0/2 port link-type access port default vlan 40 # interface Ethernet0/0/3 port link-type trunk port trunk allow-pass vlan 2 to 4094 #
3.2 汇聚层配置
# sysname LSW3 # vlan batch 10 20
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
stp region-configuration
region-name huawei.com
instance 1 vlan 10 20
instance 2 vlan 30 40
active region-configuration
#
interface Vlanif1
#
interface MEth0/0/1
#
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
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
#
sysname LSW4
#
vlan batch 30 40
#
stp region-configuration
region-name huawei.com
instance 1 vlan 10 20
instance 2 vlan 30 40
active region-configuration
#
interface Vlanif1
#
interface MEth0/0/1
#
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
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
3.3 核心层配置
#
sysname LSW1
#
vlan batch 10 20 30 40 50 60 70 80 90
#
stp instance 1 root primary
stp instance 2 root secondary
#
lacp priority 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
dhcp enable
#
diffserv domain default
#
stp region-configuration
region-name huawei.com
instance 1 vlan 10 20
instance 2 vlan 30 40
active region-configuration
#
acl number 3001
rule 5 deny ip source 192.168.30.0 0.0.0.255 destination 192.168.20.0 0.0.0.255
rule 10 deny ip source 192.168.40.0 0.0.0.255 destination 192.168.20.0 0.0.0.255
#
traffic classifier tcl operator and
if-match acl 3001
#
traffic behavior tbl
deny
#
traffic policy tpl
classifier tcl behavior tbl
#
drop-profile default
#
ip pool pool1
gateway-list 192.168.10.254
network 192.168.10.0 mask 255.255.255.0
dns-list 114.114.114.114
#
ip pool pool2
gateway-list 192.168.20.254
network 192.168.20.0 mask 255.255.255.0
dns-list 114.114.114.114
#
ip pool pool3
gateway-list 192.168.30.254
network 192.168.30.0 mask 255.255.255.0
dns-list 114.114.114.114
#
ip pool pool4
gateway-list 192.168.40.254
network 192.168.40.0 mask 255.255.255.0
dns-list 114.114.114.114
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 120
vrrp vrid 10 preempt-mode timer delay 5
vrrp vrid 10 track interface GigabitEthernet0/0/6 reduced 30
dhcp select global
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 120
vrrp vrid 20 preempt-mode timer delay 5
vrrp vrid 20 track interface GigabitEthernet0/0/6 reduced 30
dhcp select global
#
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
vrrp vrid 30 virtual-ip 192.168.30.254
dhcp select global
#
interface Vlanif40
ip address 192.168.40.1 255.255.255.0
vrrp vrid 40 virtual-ip 192.168.40.254
dhcp select global
#
interface Vlanif50
ip address 192.168.50.1 255.255.255.0
#
interface Vlanif60
ip address 192.168.60.1 255.255.255.0
#
interface Vlanif70
#
interface Vlanif80
ip address 192.168.5.1 255.255.255.0
#
interface Vlanif90
ip address 192.168.4.1 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
traffic-policy tpl inbound
mode lacp-static
least active-linknumber 2
max bandwidth-affected-linknumber 3
load-balance dst-ip
lacp timeout fast
lacp preempt enable
max active-linknumber 2
lacp preempt delay 20
lacp selected speed
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
traffic-policy tpl outbound
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
interface GigabitEthernet0/0/4
eth-trunk 1
#
interface GigabitEthernet0/0/5
eth-trunk 1
lacp priority 100
#
interface GigabitEthernet0/0/6
shutdown
port link-type trunk
port trunk pvid vlan 60
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/7
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
ip route-static 0.0.0.0 0.0.0.0 192.168.60.2
ip route-static 192.168.4.0 255.255.255.0 192.168.50.2
ip route-static 192.168.5.0 255.255.255.0 192.168.50.2
ip route-static 192.168.30.0 255.255.255.0 192.168.50.2
ip route-static 192.168.40.0 255.255.255.0 192.168.50.2
#
user-interface con 0
user-interface vty 0 4
#
port-group link-type
#
port-group tr
#
return
#
sysname LSW2
#
vlan batch 10 20 30 40 50 60 70 80 90
#
stp instance 1 root secondary
stp instance 2 root primary
#
lacp priority 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
dhcp enable
#
diffserv domain default
#
stp region-configuration
region-name huawei.com
instance 1 vlan 10 20
instance 2 vlan 30 40
active region-configuration
#
acl number 3002
rule 5 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.30.0 0.0.0.255
rule 10 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.40.0 0.0.0.255
#
traffic classifier tcl operator and
if-match acl 3002
#
traffic behavior tbl
deny
#
traffic policy tpl
classifier tcl behavior tbl
#
drop-profile default
#
dhcp server group dhcpgroup3
dhcp-server 192.168.30.252 0
#
dhcp server group dhcpgroup4
dhcp-server 192.168.40.252 0
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
#
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
vrrp vrid 30 virtual-ip 192.168.30.254
vrrp vrid 30 priority 120
vrrp vrid 30 preempt-mode timer delay 5
vrrp vrid 30 track interface GigabitEthernet0/0/6 reduced 30
dhcp select relay
dhcp relay server-select dhcpgroup3
#
interface Vlanif40
ip address 192.168.40.1 255.255.255.0
vrrp vrid 40 virtual-ip 192.168.40.254
vrrp vrid 40 priority 120
vrrp vrid 40 preempt-mode timer delay 5
vrrp vrid 40 track interface GigabitEthernet0/0/6 reduced 30
dhcp select relay
dhcp relay server-select dhcpgroup4
#
interface Vlanif50
ip address 192.168.50.2 255.255.255.0
#
interface Vlanif60
#
interface Vlanif70
ip address 192.168.70.1 255.255.255.0
#
interface Vlanif80
ip address 192.168.5.1 255.255.255.0
#
interface Vlanif90
ip address 192.168.4.1 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
traffic-policy tpl inbound
mode lacp-static
least active-linknumber 2
max bandwidth-affected-linknumber 3
load-balance dst-ip
lacp timeout fast
lacp preempt enable
max active-linknumber 2
lacp preempt delay 20
lacp selected speed
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
traffic-policy tpl outbound
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
interface GigabitEthernet0/0/4
eth-trunk 1
#
interface GigabitEthernet0/0/5
eth-trunk 1
lacp priority 100
#
interface GigabitEthernet0/0/6
port link-type trunk
port trunk pvid vlan 70
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/7
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
ip route-static 0.0.0.0 0.0.0.0 192.168.70.2
ip route-static 192.168.4.0 255.255.255.0 192.168.50.1
ip route-static 192.168.5.0 255.255.255.0 192.168.50.1
ip route-static 192.168.10.0 255.255.255.0 192.168.50.1
ip route-static 192.168.20.0 255.255.255.0 192.168.50.1
#
3.4 防火墙配置
!Software Version V500R005C10SPC300
!Last configuration was saved at 2022-05-26 15:55:45 UTC
#
sysname FW1
#
l2tp domain suffix-separator @
#
ipsec sha2 compatible enable
#
undo telnet server enable
undo telnet ipv6 server enable
#
clock timezone UTC add 00:00:00
#
update schedule location-sdb weekly Sun 23:55
#
firewall defend action discard
#
banner enable
#
user-manage web-authentication security port 8887
undo privacy-statement english
undo privacy-statement chinese
page-setting
user-manage security version tlsv1.1 tlsv1.2
password-policy
level high
user-manage single-sign-on ad
user-manage single-sign-on tsm
user-manage single-sign-on radius
user-manage auto-sync online-user
#
web-manager security version tlsv1.1 tlsv1.2
web-manager enable
web-manager security enable
#
firewall dataplane to manageplane application-apperceive default-action drop
#
undo ips log merge enable
#
decoding uri-cache disable
#
update schedule ips-sdb daily 06:18
update schedule av-sdb daily 06:18
update schedule sa-sdb daily 06:18
update schedule cnc daily 06:18
update schedule file-reputation daily 06:18
#
ip vpn-instance default
ipv4-family
#
time-range worktime
period-range 08:00:00 to 18:00:00 working-day
#
ike proposal default
encryption-algorithm aes-256 aes-192 aes-128
dh group14
authentication-algorithm sha2-512 sha2-384 sha2-256
authentication-method pre-share
integrity-algorithm hmac-sha2-256
prf hmac-sha2-256
#
aaa
authentication-scheme default
authentication-scheme admin_local
authentication-scheme admin_radius_local
authentication-scheme admin_hwtacacs_local
authentication-scheme admin_ad_local
authentication-scheme admin_ldap_local
authentication-scheme admin_radius
authentication-scheme admin_hwtacacs
authentication-scheme admin_ad
authorization-scheme default
accounting-scheme default
domain default
service-type internetaccess ssl-vpn l2tp ike
internet-access mode password
reference user current-domain
manager-user audit-admin
password cipher @%@%Ow!DI`"k1Gdu<:1aM(OKe-:"*~/X"^l>lR~|GX8OT)ZJ-:%e@%@%
service-type web terminal
level 15
manager-user api-admin
password cipher @%@%_Rbd1-w5N%|b{
*IJL:z-v{
,nKX/eDwh<;X=wr^!ty:k<{
,qv@%@%
level 15
manager-user admin
password cipher @%@%/]]t)jlgx4MS%:EOdw!@5=eE(J9D()1~sN\Li8OC^PCR=eH5@%@%
service-type web terminal
level 15
role system-admin
role device-admin
role device-admin(monitor)
role audit-admin
bind manager-user audit-admin role audit-admin
bind manager-user admin role system-admin
#
l2tp-group default-lns
#
interface GigabitEthernet0/0/0
undo shutdown
ip binding vpn-instance default
ip address 192.168.0.1 255.255.255.0
alias GE0/METH
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 192.168.70.2 255.255.255.0
service-manage http permit
service-manage https permit
service-manage ping permit
service-manage ssh permit
service-manage snmp permit
service-manage telnet permit
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 221.1.1.1 255.255.255.0
service-manage http permit
service-manage https permit
service-manage ping permit
service-manage ssh permit
service-manage snmp permit
service-manage telnet permit
#
interface GigabitEthernet1/0/2
undo shutdown
ip address 192.168.60.2 255.255.255.0
service-manage http permit
service-manage https permit
service-manage ping permit
service-manage ssh permit
service-manage snmp permit
service-manage telnet permit
#
interface Virtual-if0
#
interface NULL0
#
firewall zone local
set priority 100
#
firewall zone trust
set priority 85
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
add interface GigabitEthernet1/0/2
#
firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/1
#
firewall zone dmz
set priority 50
#
ip route-static 0.0.0.0 0.0.0.0 221.1.1.2
ip route-static 192.168.4.0 255.255.255.0 192.168.60.1
ip route-static 192.168.4.0 255.255.255.0 192.168.70.1 preference 70
ip route-static 192.168.5.0 255.255.255.0 192.168.60.1
ip route-static 192.168.5.0 255.255.255.0 192.168.70.1 preference 70
ip route-static 192.168.10.0 255.255.255.0 192.168.60.1
ip route-static 192.168.10.0 255.255.255.0 192.168.70.1 preference 70
ip route-static 192.168.30.0 255.255.255.0 192.168.70.1
ip route-static 192.168.40.0 255.255.255.0 192.168.70.1
#
undo ssh server compatible-ssh1x enable
ssh authentication-type default password
ssh server cipher aes256_ctr aes128_ctr
ssh server hmac sha2_256 sha1
ssh client cipher aes256_ctr aes128_ctr
ssh client hmac sha2_256 sha1
#
firewall detect ftp
#
user-interface con 0
authentication-mode aaa
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
user-interface vty 16 20
#
pki realm default
#
sa
#
location
#
multi-linkif
mode proportion-of-weight
#
right-manager server-group
#
device-classification
device-group pc
device-group mobile-terminal
device-group undefined-group
#
user-manage server-sync tsm
#
security-policy
rule name p1
source-zone trust
destination-zone untrust
source-address 192.168.10.0 mask 255.255.255.0
source-address 192.168.30.0 mask 255.255.255.0
source-address 192.168.40.0 mask 255.255.255.0
action permit
rule name p2
source-zone untrust
destination-zone trust
destination-address 192.168.5.0 mask 255.255.255.0
action permit
rule name p3
source-zone untrust
destination-zone trust
destination-address 192.168.4.0 mask 255.255.255.0
action permit
#
nat-policy
rule name policy_nat1
source-zone trust
destination-zone untrust
source-address 192.168.10.0 mask 255.255.255.0
source-address 192.168.30.0 mask 255.255.255.0
source-address 192.168.40.0 mask 255.255.255.0
action source-nat easy-ip
#
return
三、测试
编号 | 测试内容 | 预期结果 | 测试结果 |
---|---|---|---|
1 | VLAN间通信测试 | vlan10与各vlan之间可通信;其他各vlan不可与VLAN 20通信 | 通过 |
2 | 内外网通信测试 | vlan20不可访问外网;其余vlan可访问外网 | 通过 |
3 | 服务器测试 | 内部访问;外部访问 | 通过 |
4 | DNS测试 | DNS测试 | 通过 |
5 | dhcp测试 | 各vlan下主机dhcp有效测试 | 通过 |
6 | 故障测试 | 接口状态异常与宕机故障下通信测试 | 通过 |
1.VLAN间通信测试
1.1 VLAN 10与其他各VLAN间通信
1.2 其他各VLAN之间通信
2.内外网通信测试
2.1 VLAN 20与外网通信
2.2 VLAN 10/30/40与外网通信
3.服务器测试
3.1 FTP服务器测试
3.2 HTTP服务器测试
4.DNS测试
5.dhcp测试
6.故障测试
5.1 接口故障测试
5.2 设备宕机测试
四、总结
1. VLAN
VLAN(Virtual Local Area Network)即虚拟局域网,是将一个物理的LAN在逻辑上划分成多个广播域的通信技术。 每个VLAN是一个广播域,VLAN内的主机间可以直接通信,而VLAN间则不能直接互通。这样,广播报文就被限制在一个VLAN内。 通过应用VLAN技术,实现了: 限制广播域:广播域被限制在一个VLAN内,节省了带宽,提高了网络处理能力。 增强局域网的安全性:不同VLAN内的报文在传输时相互隔离,即一个VLAN内的用户不能和其它VLAN内的用户直接通信。 提高了网络健壮性:故障被限制在一个VLAN内,本VLAN内的故障不会影响其他VLAN的正常工作。 灵活构建虚拟工作组:用VLAN可以划分不同的用户到不同的工作组,同一工作组的用户也不必局限于某一固定的物理范围,网络构建和维护更方便灵活。
2. ACL
访问控制列表ACL(Access Control List)是由一条或多条规则组成的集合。所谓规则,是指描述报文匹配条件的判断语句,这些条件可以是报文的源地址、目的地址、端口号等。 ACL本质上是一种报文过滤器,规则是过滤器的滤芯。设备基于这些规则进行报文匹配,可以过滤出特定的报文,并根据应用ACL的业务模块的处理策略来允许或阻止该报文通过。如企业为保证研发数据安全,禁止除总经理室外主机访问研发部。
3. LACP
LACP(Link Aggregation Control Protocol,链路聚合控制协议)是一种基于IEEE802.3ad标准的实现链路动态聚合与解聚合的协议,它是链路聚合中常用的一种协议。链路聚合组中启用了LACP协议的成员端口通过发送LACPDU报文进行交互,双方对哪些端口能够发送和接收报文达成一致,确定承担业务流量的链路。此外,当聚合条件发生变化时,如某个链路发生故障,LACP模式会自动调整聚合组中的链路,组内其他可用成员链路接替故障链路维持负载平衡。这样在不进行硬件升级的情况下,可以增加设备之间的逻辑带宽,提高网络的可靠性。
4. DHCP
动态主机配置协议DHCP(Dynamic Host Configuration Protocol)是一种网络管理协议,用于集中对用户IP地址进行动态管理和配置。 DHCP使网络管理员能从中心结点监控和分配IP地址。当某台计算机移到网络中的其它位置时,能自动收到新的IP地址。DHCP实现的自动化分配IP地址不仅降低了配置和部署设备的时间,同时也降低了发生配置错误的可能性。另外DHCP服务器可以管理多个网段的配置信息,当某个网段的配置发生变化时,管理员只需要更新DHCP服务器上的相关配置即可,实现了集中化管理。
5. VRRP
虚拟路由冗余协议VRRP(Virtual Router Redundancy Protocol)是一种用于提高网络可靠性的容错协议。通过VRRP,可以在主机的下一跳设备出现故障时,及时将业务切换到备份设备,从而保障网络通信的连续性和可靠性。 VRRP将多台设备组成一个虚拟设备,通过配置虚拟设备的IP地址为缺省网关,实现缺省网关的备份。当网关设备发生故障时,VRRP机制能够选举新的网关设备承担数据流量,从而保障网络的可靠通信。 VRRP协议中定义了三种状态机:初始状态(Initialize)、活动状态(Master)、备份状态(Backup)。其中,只有处于Master状态的设备才可以转发那些发送到虚拟IP地址的报文。
6. MSTP
多生成树协议MSTP(Multiple Spanning Tree Protocol)是IEEE 802.1s中定义的生成树协议,通过生成多个生成树,来解决以太网环路问题。形成多棵无环路的树,解决广播风暴并实现冗余备份。多棵生成树在VLAN间实现负载均衡,不同VLAN的流量按照不同的路径转发。