ITPub博客

首页 > IT基础架构 > 网络安全 > 思科路由上配置访问控制列表 ACL

思科路由上配置访问控制列表 ACL

原创 网络安全 作者:liuzhen_basis 时间:2015-04-26 20:35:49 0 删除 编辑

    搭建网路环境如下

    实现ACL效果 1.1.1.10和2.2.2.10不能相互ping通

    实现ACL效果 1.1.1.20和2.2.2.20不能相互ping通

    实现ACL效果 1.1.1.30和2.2.2.30不能相互ping通

    clip_image001



    配置PC ip

    双击PC,在如下位置配置,逐一配置

    clip_image002



    交换机无需配置,连线即可

    给路由配置IP,两个端口分别为 0/0 0/1


    Router>enable

    Router#configure terminal

    Router(config)#interface fastEthernet 0/0

    Router(config-if)#ip address 1.1.1.1 255.0.0.0

    Router(config-if)#no shutdown

    Router(config)#interface fastEthernet 0/1

    Router(config-if)#ip address 2.2.2.2 255.0.0.0

    Router(config-if)#no shutdown



    配置ACL,使用扩展的访问控制列表

    标准的控制列表是处在1~99和1300~1999范围内的.

    扩展访问控制列表的范围是100~199和2000~2699

    执行以下命令 ping命令使用IP协议 ,Ping 命令是icmp协议

    host代表所有端口


    Router(config)#access-list 100 deny ip host 1.1.1.10 host 2.2.2.10

    Router(config)#access-list 100 deny ip host 1.1.1.20 host 2.2.2.20

    Router(config)#access-list 100 deny ip host 1.1.1.30 host 2.2.2.30

    Router(config)#access-list 100 deny ip host 2.2.2.10 host 1.1.1.10

    Router(config)#access-list 100 deny ip host 2.2.2.20 host 1.1.1.20

    Router(config)#access-list 100 deny ip host 2.2.2.30 host 1.1.1.30

    Router(config)#access-list 100 permit ip any any



    启用ACL,如果只配置ACL不配置到接口上不会启作用,

    一个网络接口只能挂接一个访问列表


    int f0/0

    ip access-group 100 in

    配置完成show running-config 看一下当前配置


    Router#show running-config

    Building configuration...

    Current configuration : 854 bytes

    !

    version 12.4

    no service timestamps log datetime msec

    no service timestamps debug datetime msec

    no service password-encryption

    !

    hostname Router

    interface FastEthernet0/0

    ip address 1.1.1.1 255.0.0.0

    ip access-group 100 in

    duplex auto

    speed auto

    !

    interface FastEthernet0/1

    ip address 2.2.2.2 255.0.0.0

    ip access-group 100 in

    duplex auto

    speed auto

    !

    interface Vlan1

    no ip address

    shutdown

    !

    ip classless

    !

    !

    access-list 100 deny ip host 1.1.1.10 host 2.2.2.10

    access-list 100 deny ip host 1.1.1.20 host 2.2.2.20

    access-list 100 deny ip host 1.1.1.30 host 2.2.2.30

    access-list 100 deny ip host 2.2.2.10 host 1.1.1.10

    access-list 100 deny ip host 2.2.2.20 host 1.1.1.20

    access-list 100 deny ip host 2.2.2.30 host 1.1.1.30

    access-list 100 permit ip any any

    !

    line con 0

    line vty 0 4

    login

    !

    !

    !

    end



    测试效果

    clip_image003

    clip_image004

    1.1.1.10 ping 2.2.2.10 不通

    ping 2.2.2.20通

    ping 2.2.2.30通

    clip_image005

    clip_image006


    配置完成

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27771627/viewspace-1604105/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-07-01

  • 博文量
    83
  • 访问量
    1040675