计算机网络-ACL实验

一、NAT实验配置

NAT实验配置

通过基本ACL匹配VLAN 10网段,然后在出口设备NAT转换只要匹配到VLAN10地址则进行转换。

核心交换机

复制代码
# 配置VLAN和默认路由,配置Trunk和Access接口
interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
 ip address 192.168.20.254 255.255.255.0
#
interface Vlanif30
 ip address 10.0.0.2 255.255.255.252

interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 30
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 20

# 路由
ip route-static 0.0.0.0 0.0.0.0 10.0.0.1

出口路由器

复制代码
# 配送路由和ACL以及NAT
acl number 2000  
 rule 10 permit source 192.168.10.0 0.0.0.255 

# 配置路由
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
ip route-static 192.168.10.0 255.255.255.0 10.0.0.2
ip route-static 192.168.20.0 255.255.255.0 10.0.0.2

# 配置接口地址,配置NAT与ACL匹配
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.252 
 nat outbound 2000
#
interface GigabitEthernet0/0/1
 ip address 10.0.0.1 255.255.255.252 

中间路由器:

复制代码
interface GigabitEthernet0/0/0
 ip address 12.1.1.2 255.255.255.252 
#
interface GigabitEthernet0/0/1
 ip address 23.1.1.2 255.255.255.252 
#
ip route-static 8.8.8.8 255.255.255.255 23.1.1.1

AR3:

复制代码
interface GigabitEthernet0/0/1
 ip address 23.1.1.1 255.255.255.252 
#
interface LoopBack0
 ip address 8.8.8.8 255.255.255.255 
#
ip route-static 0.0.0.0 0.0.0.0 23.1.1.2

PC1:正常访问8.8.8.8

PC2:没有进行NAT转换,访问超时

二、ACL流量过滤实验

流量过滤

正常配置access接口,划分VLAN,创建高级ACL匹配流量,然后调用过滤策略。

复制代码
# 创建高级ACL,先匹配拒绝,然后再允许其它的访问流量
acl number 3000
 rule 5 deny ip source 192.168.10.1 0 destination 192.168.20.2 0
 rule 10 permit ip source 192.168.10.1 0

# 接口配置
#
interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
 ip address 192.168.20.254 255.255.255.0
#
interface Vlanif30
 ip address 10.0.0.2 255.255.255.252
 
# 应用过滤策略
# 可以在全局应用流量过滤
traffic-filter inbound acl 3000

# 或者在入接口和出接口应用,在G0/0/2,入方向过滤或者在G0/0/4出方向过滤
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
 traffic-filter inbound acl 3000

#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 20
 traffic-filter outbound acl 3000

结果:

本文由mdnice多平台发布

相关推荐
CHENWENFEIc1 天前
SpringBoot论坛系统安全测试实战报告
spring boot·后端·程序人生·spring·系统安全·安全测试
Yo_Becky1 天前
【PyTorch】PyTorch预训练模型缓存位置迁移,也可拓展应用于其他文件的迁移
人工智能·pytorch·经验分享·笔记·python·程序人生·其他
旧曲重听12 天前
最快实现的前端灰度方案
前端·程序人生·状态模式
自由鬼13 天前
企业架构与IT架构关系的探讨
程序人生·安全·架构·安全架构·企业架构·it架构
ProcessOn官方账号14 天前
数据分析对比图表-雷达图全面指南
大数据·人工智能·程序人生·职场和发展·数据分析·学习方法·processon
南国_之恋15 天前
程序人生,人生如戏
程序人生·职场和发展
TGC达成共识16 天前
解锁身心密码:从“心”拥抱健康生活
科技·物联网·程序人生·百度·生活·新浪微博·高考
宇钶宇夕17 天前
博图SCL中CONTINUE语句详解:高效循环控制案例
运维·程序人生·算法·自动化
zhangxiaolong01019 天前
我关于汽车的一些看法
程序人生
测试界萧萧19 天前
10:00开始面试,10:06就出来了,问的问题有点变态。。。
自动化测试·软件测试·功能测试·程序人生·面试·职场和发展