ACL原理应用

ACL原理应用

利用acl实现

主机1可以访问web但不能访问ftp

主机2可以访问ftp但不能访问web

拓扑图ENSP

 

  1. 配置主机和服务器IP地址

主机1

Ip:192.168.1.1

子网掩码:255.255.255.0

网关:192.168.1.254

主机2

IP:192.168.2.1

子网掩码:255.255.255.0

网关:192.168.2.254

ftp服务器:

IP:192.168.3.1

子网掩码:255.255.255.0

网关:192.168.3.254

http服务器

Ip:192.168.4.1

子网掩码:255.255.255.0

网关:192.168.4.254

  1. SW1,SW2划分vlan 配置网关及IP ,AR1配置IP

SW1

vlan bacth 10 20 30

int e0/0/1

port link-type access

port default vlan 10

int e0/0/2

port link-type access

port default vlan 20

int e0/0/3

port link-type access

port default vlan 30

int vlanif 10

ip address 192.168.1.254 24

int vlanif 20

ip address 192.168.2.254 24

int vlanif 30

ip address 172.16.1.1 30

SW2

vlan bacth 40  50

int e0/0/1

port link-type access

port default vlan 40

int e0/0/2

port link-type access

port default vlan 50

int vlanif 40

ip address 172.16.1.2 30

int vlanif 50

ip address 172.16.2.1 30

AR1

int g0/0/0

ip address 172.16.2.2 30

ip g0/0/1

ip address 192.168.3.254 24

ip g0/0/2

ip address 192.168.4.254 24

  1. 配置缺省路由 回执路由

SW1

ip route-static 0.0.0.0 0.0.0.0 172.16.1.2

SW2

ip route-static 0.0.0.0 0.0.0.0 172.16.2.2

ip route-static 192.168.1.0 255.255.255.0 172.16.1.1

ip route-static 192.168.2.0 255.255.255.0 172.16.1.1

AR1

ip route-static 192.168.1.0 255.255.255.0 172.16.2.1

ip route-static 192.168.2.0 255.255.255.0 172.16.2.1

  1. 在AR1上配置ACL,在g0/0/0端口使用

acl number 3000  

 rule 5 permit tcp source 192.168.1.0 0.0.0.255 destination 192.168.4.1 0 destin

ation-port eq www

 rule 10 deny tcp source 192.168.1.0 0.0.0.255 destination 192.168.3.1 0 destina

tion-port eq ftp

 rule 15 permit tcp source 192.168.2.0 0.0.0.255 destination 192.168.3.1 0 desti

nation-port eq ftp

 rule 20 deny tcp source 192.168.2.0 0.0.0.255 destination 192.168.4.1 0 destina

tion-port eq www

int g0/0/0

 traffic-filter inbound acl 3000

  1. 测试网络连通性

 

 

 

 

  1. 测试ACL配置是否成功

主机1:

 

 

主机2:

 

 

很明显的可以看出主机1不能访问ftp能访问http

主机2不能访问http 能访问ftp

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值