【HCIA-综合实验】

实验拓扑

Clip_2024-07-22_11-59-59.png

实验要求

  1. 总经理VLAN2 财务部VLAN3 销售部VLAN4 DNS服务器VLAN5。
  2. SW3为VLAN2 3 4 5的网关, SW3启用接口地址池为VLAN2 3动态分配地址。
  3. 交换机连接终端开启边缘端口,并进行BPDU保护,在SW1和SW2、SW3进行STP优化。
  4. R1和SW3链路聚合(LACP)。
  5. R1和SW3之间配置OSPF。
  6. R1做Easy-ip(NAT)连接外网。
  7. DNS服务器对网址www.lyk.com转化为100.1.1.1(PC4的地址)。
  8. 实现全网互通。
  9. 只允许总经理(PC1)访问财务部(PC2)。

实验配置与分析

# SW1
sys
sys SW1
vlan batch 2 3 4
int Ethernet 0/0/2
 port link-type access
 port default vlan 2
int Ethernet 0/0/4
 port link-type access
 port default vlan 3
int Ethernet 0/0/3
 port link-type trunk
 # 防止链路故障的时候,切换链路导致不通,最好允许所有VLAN通过。
 # 如果没有配置Trunk,可能会导致链路不通,因为STP会阻塞一个链路。
 port trunk allow-pass vlan all
int Ethernet 0/0/1
 port link-type trunk
 port trunk allow-pass vlan all
# SW2
sys 
sys SW2
vlan batch 2 3 4
int Ethernet 0/0/1
 port link-type access
 port default vlan 4
int Ethernet 0/0/3
 port link-type trunk
 port trunk allow-pass vlan all
int Ethernet 0/0/2
 port link-type trunk
 port trunk allow-pass vlan all
# SW3
sys 
sys SW3
vlan batch 2 3 4 5 30
int G 0/0/3
 port link-type access
 port default vlan 5
int G 0/0/4
 port link-type trunk
 port trunk allow-pass vlan all
int G 0/0/5
 port link-type trunk
 port trunk allow-pass vlan all
# SW3
int VLANIF 2
 ip address 192.168.2.254 24
int VLANIF 3
 ip address 192.168.3.254 24
int VLANIF 4
 ip address 192.168.4.254 24
int VLANIF 5
 ip address 192.168.5.254 24
int VLANIF 30
 ip address 192.168.30.254 24
# SW3
# 选择SW3为根交换机,防止STP阻塞错误链路
stp root primary
# 进行BPDU保护,防止边缘接口有其他设备介入
stp bpdu-protection
int G 0/0/3
 stp edged-port enable
# SW1
stp bpdu-protection
int E 0/0/2
 stp edged-port enable
int E 0/0/4
 stp edged-port enable
# SW2
stp bpdu-protection
int E 0/0/1
 stp edged-port enable
# SW3
int Eth-trunk 1
 mode lacp-static
 trunkport G 0/0/1 to 0/0/2
 port link-type access
 port default vlan 30
# AR1
sys
sys AR1
int Eth-trunk 1
 undo portswitch
 mode lacp-static
 trunkport G 0/0/1 to 0/0/2
 ip address 192.168.30.1 24
# AR1
OSPF 1
 Area 0
int Eth-trunk 1
 ospf enable 1 area 0
# SW3
OSPF 1
 Area 0
int VLANIF 2 
 # 在接口下声明OSPF
 ospf enable 1 area 0
int VLANIF 3
 ospf enable 1 area 0
int VLANIF 4
 ospf enable 1 area 0
int VLANIF 5
 ospf enable 1 area 0
int VLANIF 30
 ospf enable 1 area 0
 quit
# 配置静态路由,指向AR1
ip route-static 0.0.0.0 0 192.168.30.1
# AR1
ACL 2000
 rule permit source any 
int G 0/0/0
 ip address 12.1.1.1 24
 nat outbound 2000
ip route-static 0.0.0.0 0 12.1.1.2
# AR2
sys
sys AR2
int G 0/0/0
 ip address 12.1.1.2 24
int G 0/0/1
 ip address 100.1.1.254 24
ip route-static 0.0.0.0 0 12.1.1.1
# SW1
acl 3000
 rule 5 permit ip source 192.168.2.0 0.0.0.255
 rule 10 deny ip
int E 0/0/4
 traffic-filter outbound acl 3000

参考资料

可爱的萌多多肉(2022).华为数通HCIA综合实验讲解.哔哩哔哩.检索于2024年7月22号

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值