华为acl+nat+链路聚合实验

华为acl+nat+链路聚合实验

拓扑图:

实验要求:

1.四间教室不同网段,教室1的PC和教室4的PC不能相互通信,其他教室PC实现可以全部互访。 2.楼层汇聚交换机和核心交换机之间级联使用链路聚合,保证楼层教室的上行带宽。 3.配置所有内网设备的远程连接,可以实现用管理终端远程连接内网所有的设备进行管理维护。 管理VLAN 不可以和教室业务VLAN相同。 4.实现4间教室都可以访问教育专网。 5.只允许教室3可以访问互联网,其余教室不允许。 6.Internet和教育专网路由器不允许配置操作,配置内网所有设备,实现上述要求。

配置详情:

1楼汇聚交换机:

<Huawei>sys 进入配置模式

[Huawei]un in en 关闭信息中心

[Huawei]sys 1lhj 修改设备名称

[1lhj]vlan batch 10 20 创建vlan

[1lhj]int Vlanif 10 进入vlan10 [1lhj-Vlanif10]ip add 192.168.10.254 24 配置ip [1lhj-Vlanif10]int Vlanif 20 [1lhj-Vlanif20]ip add 192.168.20.254 24

[1lhj]interface Eth-Trunk 1 进入聚合组1

[1lhj-Eth-Trunk1]mode lacp-static 设置聚合组模式

[1lhj-Eth-Trunk1]trunkport Ethernet 0/0/3 to 0/0/4 把3-4口加入聚合组

[1lhj-Eth-Trunk1]port link-type trunk 设置聚合组端口模式

[1lhj-Eth-Trunk1]port trunk allow-pass vlan all 允许所有vlan通过

[1lhj]int e0/0/5 进入端口5

[1lhj-Ethernet0/0/5]port link-type access 设置端口模式为access

[1lhj-Ethernet0/0/5]port default vlan 10 端口绑定vlan10

[1lhj-Ethernet0/0/5]int e0/0/2 进入端口2 [1lhj-Ethernet0/0/2]port link-type access 设置端口模式为access [1lhj-Ethernet0/0/2]port default vlan 20 端口绑定vlan20

2楼汇聚:

<Huawei>sys 进入配置模式

[Huawei]un in en 关闭信息中心提示

[Huawei]sys 2lhj 修改设备名称

[2lhj]vlan batch 30 40 创建vlan

[2lhj]int Vlanif 30 进入vlan

[2lhj-Vlanif30]ip address 192.168.30.254 24 配置ip [2lhj-Vlanif30]int Vlanif 40 进入vlan [2lhj-Vlanif40]ip address 192.168.40.254 24 配置ip

[2lhj]int e0/0/1 进入接口1

[2lhj-Ethernet0/0/1]port link-type access 设置端口模式为access

[2lhj-Ethernet0/0/1]port default vlan 30 绑定vlan30

[2lhj-Ethernet0/0/1]int e0/0/2 进入端口 2 [2lhj-Ethernet0/0/2]port link-type access 设置端口模式

[2lhj-Ethernet0/0/2]port default vlan 40 绑定vlan40

[2lhj]int Eth-Trunk 2 进入聚合组2

[2lhj-Eth-Trunk2]mo lacp-static 设置聚合组模式

[2lhj-Eth-Trunk2]port link-type trunk 设置聚合组模式

[2lhj-Eth-Trunk2]port trunk allow-pass vlan all 允许所有vlan通过

[2lhj-Eth-Trunk2]trunkport Ethernet 0/0/3 to 0/0/4 把3-4口绑定到聚合组

核心交换机:

<Huawei>sys 进入配置模式

[Huawei]un in en 关闭信息管理中心

[Huawei]sys hx 修改设备名称

[hx]vlan batch 10 20 30 40 创建vlan

[hx]int Vlanif 10 进入vlan [hx-Vlanif10]ip add 192.168.10.254 24 配置ip [hx-Vlanif10]int Vlanif 20 [hx-Vlanif20]ip add 192.168.20.254 24 [hx-Vlanif20]int Vlanif 30 [hx-Vlanif30]ip add 192.168.30.254 24 [hx-Vlanif30]int Vlanif 40 [hx-Vlanif40]ip add 192.168.40.254 24

[hx]int Eth-Trunk 1 进入聚合组1 [hx-Eth-Trunk1]mo la 设置聚合组模式 (注意:核心交换机的聚合组号以及模式要和汇聚交换机的一样)

[hx-Eth-Trunk1]port link-type trunk 设置端口模式

[hx-Eth-Trunk1]port trunk allow-pass vlan all 允许所有vlan通过

[hx-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 把端口绑定进聚合组

[hx-Eth-Trunk1]trunkport GigabitEthernet 0/0/4 把端口绑定进聚合组

[hx]int Eth-Trunk 2 进入聚合组2 [hx-Eth-Trunk2]mo la 设置聚合组模式

[hx-Eth-Trunk2]port link-type trunk 设置聚合组的接口模式

[hx-Eth-Trunk2]port trunk allow-pass vlan all 允许所有vlan通过

[hx-Eth-Trunk2]trunkport g 0/0/2 把端口绑定进聚合组

[hx-Eth-Trunk2]trunkport g 0/0/5 把端口绑定进聚合组 (至此都是在做端口聚合)

[hx]vlan batch 4 3 创建vlan

[hx]int Vlanif 4

[hx-Vlanif4]ip address 4.1.1.1 24 [hx-Vlanif4]int Vlanif 3 [hx-Vlanif3]ip address 3.1.1.1 24

[hx]int g0/0/6

[hx-GigabitEthernet0/0/6]port link-type trunk

[hx-GigabitEthernet0/0/6]port trunk allow-pass vlan all

[hx-GigabitEthernet0/0/6]port trunk pvid vlan 4

[hx]int g0/0/3 [hx-GigabitEthernet0/0/3]port link-type trunk [hx-GigabitEthernet0/0/3]port trunk pvid vlan 3

[hx-GigabitEthernet0/0/3]port trunk allow-pass vlan all

[hx]telnet server en

[hx]telnet client-source -a 4.1.1.1

[hx]user-interface vty 0 4

[hx-ui-vty0-4]authentication-mode password

[hx-ui-vty0-4]authentication-mode aaa

[hx]aaa

[hx-aaa]local-user admin password cipher admin

[hx-aaa]local-user admin privilege level 15

[hx-aaa]local-user admin service-type telnet

[hx]ip route-static 0.0.0.0 0 3.1.1.2

[hx]acl 3001

[hx-acl-adv-3001]rule 5 deny ip source 192.168.10.1 0.0.0.255 destination 192.16 8.40.1 0.0.0.255

[hx]int Eth-Trunk 1

[hx-Eth-Trunk1]traffic-filter outbound acl 3001 [hx-Eth-Trunk1]traffic-filter inbound acl 3001

模拟管理终端:

<Huawei>sys

[Huawei]un in en

[Huawei]sys mnglzd [mnglzd]int g0/0/1

[mnglzd]vlan batch 4

[mnglzd]int Vlanif 4

[mnglzd-Vlanif4]ip address 4.1.1.2 24

[mnglzd]int g0/0/1

[mnglzd-GigabitEthernet0/0/1]port link-type access

[mnglzd-GigabitEthernet0/0/1]port default vlan 4

[mnglzd]ip route-static 0.0.0.0 0 4.1.1.1

[mnglzd]telnet server enable

[mnglzd]telnet client-source -a 4.1.1.2

[mnglzd]user-interface vty 0 4

[mnglzd-ui-vty0-4]authentication-mode password

[mnglzd-ui-vty0-4]authentication-mode aaa

[mnglzd]aaa

[mnglzd-aaa]local-user admin password cipher admin

[mnglzd-aaa]local-user admin service-type telnet

[mnglzd-aaa]local-user admin privilege level 15

出口路由器:

<Huawei>sys

[Huawei]un in en

[Huawei]sys cklyq

[cklyq]int g0/0/1 [cklyq-GigabitEthernet0/0/1]ip add 1.1.1.2 30 [cklyq-GigabitEthernet0/0/1]int g0/0/2 [cklyq-GigabitEthernet0/0/2]ip add 2.1.1.2 30 [cklyq-GigabitEthernet0/0/2]int g0/0/0 [cklyq-GigabitEthernet0/0/0]ip add 3.1.1.2 24

[cklyq]ip route-static 0.0.0.0 0 3.1.1.1

[cklyq]acl 2000

[cklyq-acl-basic-2000]rule 5 permit source 192.168.30.1 0.0.0.255

[cklyq-GigabitEthernet0/0/1]nat outbound 2000

[cklyq]acl 2001

[cklyq-acl-basic-2001]rule 5 permit source any

[cklyq-GigabitEthernet0/0/2]nat outbound 2001

测试效果:

1.四间教室不同网段,教室1的PC和教室4的PC不能相互通信,其他教室PC实现可以全部互访。

2.楼层汇聚交换机和核心交换机之间级联使用链路聚合,保证楼层教室的上行带宽。

3.配置所有内网设备的远程连接,可以实现用管理终端远程连接内网所有的设备进行管理维护。 管理VLAN 不可以和教室业务VLAN相同。

4.实现4间教室都可以访问教育专网。(注意有时候ping不通是因为ensp有路由延迟,多试一下)

5.只允许教室3可以访问互联网,其余教室不允许。

常用命令补充:

恢复出厂设置:

<test>reset saved-configuration 出现提示后输入”y“

执行重启就恢复了:

<test>reboot (注意第一个提示输入”n“,第二个提示输入”y“)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小小小丶年少

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值