ACL实验-交换机实现三层隔离
创始人
2024-09-25 19:24:05
0

要求:

        192.168.20.0/24网段不能访问192.168.30.0/24网段。

        192.168.20.0/24网段可以访问192.168.40.1(web服务器) 不能访问192.168.40.2(ftp服务器)

        192.168.30.0/24网段可以访问192.168.40.1(web服务器) 不能访问192.168.40.2(ftp服务器)

1、实验拓扑图

2、交换机配置 

1)vlan配置

交换机与交换机之间使用trunk,交换机与PC、服务器之间使用Access。

LSW4:

vlan batch 20 # interface GigabitEthernet0/0/1  port link-type trunk  port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/2  port link-type access  port default vlan 20 #

LSW5:

vlan batch 30 # interface GigabitEthernet0/0/1  port link-type trunk  port trunk allow-pass vlan 30 # interface GigabitEthernet0/0/2  port link-type access  port default vlan 30 #

LSW3:

# vlan batch 20 30 40 # interface GigabitEthernet0/0/1  port link-type trunk  port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/2  port link-type trunk  port trunk allow-pass vlan 30 # interface GigabitEthernet0/0/3  port link-type access  port default vlan 40 # interface GigabitEthernet0/0/4  port link-type access  port default vlan 40 # interface Vlanif20  ip address 192.168.20.254 255.255.255.0 # interface Vlanif30  ip address 192.168.30.254 255.255.255.0 # interface Vlanif40  ip address 192.168.40.254 255.255.255.0 #

2)ACL配置

要求:

192.168.20.0/24网段不能访问192.168.30.0/24网段。

192.168.20.0/24网段可以访问192.168.40.1(web服务器) 不能访问192.168.40.2(ftp服务器)

192.168.30.0/24网段可以访问192.168.40.1(web服务器) 不能访问192.168.40.2(ftp服务器)

第一步:创建两个acl,acl 3001 和acl 3002,acl 3001里面写允许策略,acl 3002里面写拒绝策略。均在LSW3上配置。

acl number 3001  rule 5 permit ip source 192.168.20.0 0.0.0.255 destination 192.168.40.1 0  rule 10 permit ip source 192.168.30.0 0.0.0.255 destination 192.168.40.1 0
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.30.0 0.0.0.255 destination 192.168.20.0 0.0.0.25 5  rule 15 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.40.2 0  rule 20 deny ip source 192.168.30.0 0.0.0.255 destination 192.168.40.2 0 # 

第二步:配置分流策略。tc1匹配ACL 3001,tc2匹配acl 3002。分流操作都是and操作,与的操作。

# traffic classifier tc1 operator and  if-match acl 3001 traffic classifier tc2 operator and  if-match acl 3002 #

第三步:配置分流行为。配置tb1的行为为permit。tb2的行为为deny。

# traffic behavior tb1  permit traffic behavior tb2  deny #

第四步:配置流量分配策略。设置策略名为tp。类tc1与tb1对应,类tc2与tb2对应。

# traffic policy tp  classifier tc1 behavior tb1  classifier tc2 behavior tb2 #

第五步:在交换机的入接口(vlan所属的一段)配置流策略。也就是LSW3的G0/0/1(vlan 20)\G0/0/2(vlan 30)配置。

 

# vlan 20  traffic-policy tp inbound vlan 30  traffic-policy tp inbound #

 3、测试

PC3:PC3ping192.168.30.1(不通)、192.168.40.1(通)、192.168.40.2(不通)。

PC4:PC4ping192.168.20.1(不通)、192.168.40.1(通)、192.168.40.2(不通)。

通过上述操作,已完成要求的ACL策略。

相关内容

热门资讯

终于找到“哪里购买斗牛牛链接房... 长虹大厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来...
玩家揭秘!微信里面炸金花链接房... 微信游戏中心:新乐游在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微...
终于找到“牛牛链接房卡在哪里弄... 新永和是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来享...
玩家揭秘!炸金花从哪里买房卡,... 微信游戏中心:新乐游在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微...
ia实测“哪里有卖微信扎金花房... 狂飙大厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来...
玩家揭秘!微信炸金花房卡自建房... 微信游戏中心:熊猫在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微信...
正版授权“金花房卡购买正规渠道... 长虹大厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来...
玩家揭秘!微信牛牛房卡自建房间... 微信游戏中心:新世界在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微...
房卡必备教程“扎金花房卡链接怎... 牛魔王正厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡...
房卡必备教程“金花大厅房卡链接... 新众乐是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来享...
玩家揭秘!拼三张的房卡找谁买,... 微信游戏中心:新九游在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微...
终于找到“金花游戏房卡怎么获得... 牛魔王正厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡...
玩家揭秘!微信的炸金花房卡怎么... 微信游戏中心:新九五在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微...
一分钟推荐“如何在微信上购买金... 新西部是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来享...
ia实测“微信群牛牛房卡去哪买... 人皇大厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来...
玩家揭秘!微信里面拼三张链接房... 微信游戏中心:新人皇在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微...
正版授权“金花房卡微信链接怎么... 金牛座是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来享...
玩家揭秘!拼三张房卡怎么弄,茄... 微信游戏中心:在哪里买打开微信,添加客【33699510】,进入游戏中心或相关小程序,搜索“微信炸金...
一分钟了解“斗牛房间如何开启房... 新毛豆互娱是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡...
给大家讲解“微信金花群怎么买房... 随意玩是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来享...