免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10781 | 回复: 8
打印 上一主题 下一主题

关于禁止网内非法DHCP服务的ACL设置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-10 15:38 |只看该作者 |倒序浏览
Hi, 大家好.
为了防止局域网内非法DHCP的服务,我在我的cisco 2960交换机上设置了如下的ACL:
access-list 108 deny udp any eq 67 any
access-list 108 permit any any
int range fa0/1-48
ip access-group 108 in

现在的情况是:我在网内开启了一个非法的DHCP服务, 并且拿了一台PC去自动获得IP, PC 能收到合法的DHCP服务器给的IP(我用了几次ipconfig/relese, ipconfig/renew).这说明我的ACL是起了作用的. 但是我telnet 到Cisco 2960, 输入:sh access-lists,显示的结果是:
     Extended IP access list 108
    10 deny udp any eq bootps any
    20 permit ip any any (28 matches)

10 deny udp any eq bootps any 这条规则后面没有显示匹配.  我有点搞不懂了,应该是阻止到了包才对呀.
Any suggestion, I will appreciate!

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
2 [报告]
发表于 2008-06-10 16:01 |只看该作者
2960是二层的吧,ACL能过滤端口和IP吗?

论坛徽章:
0
3 [报告]
发表于 2008-06-10 21:04 |只看该作者
谢谢你的回复.我知道它是二层的. 可2960的spec 里面有这样的描述呢.
精确的速率限制:

思科CIR功能能够以低达1Mbps的精确度保障带宽。
速率限制基于源和目的地IP地址、源和目的地MAC地址、第四层TCP/UDP信息或者这些字段的任意组合,并利用QoS ACL(IP ACL或者MAC ACL)、级别图和策略图提供。
利用输入策略控制和输出整形,可以方便地管理来自于基站或者上行链路的异步上行和下行数据流。
每个快速以太网或者千兆以太网端口最多可以支持64个汇总或者单独策略控制器。

难道只能设置ACL来限制速率吗?

论坛徽章:
0
4 [报告]
发表于 2008-06-10 21:06 |只看该作者
不好意思,刚才没有看完
在安全这一栏是这样说的:
用于第二层接口的、基于端口的ACL(PRAC)让用户可以将安全策略用于各个交换机端口。

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
5 [报告]
发表于 2008-06-10 21:52 |只看该作者
Port-based ACLs for Layer 2 interfaces allow application of security policies on individual switch ports.


Port ACLs
You can also apply ACLs to Layer 2 interfaces on a switch. Port ACLs are supported on physical interfaces and EtherChannel interfaces.

The following access lists are supported on Layer 2 interfaces:

•Standard IP access lists using source addresses

•Extended IP access lists using source and destination addresses and optional protocol type information

•MAC extended access lists using source and destination MAC addresses and optional protocol type information

As with router ACLs, the switch examines ACLs associated with features configured on a given interface and permits or denies packet forwarding based on how the packet matches the entries in the ACL. In the example in Figure 37-1, if all workstations were in the same VLAN, ACLs applied at the Layer 2 input would allow Host A to access the Human Resources network, but prevent Host B from accessing the same network.

When you apply a port ACL to a trunk port, the ACL filters traffic on all VLANs present on the trunk port. When you apply a port ACL to a port with voice VLAN, the ACL filters traffic on both data and voice VLANs.

With port ACLs, you can filter IP traffic by using IP access lists and non-IP traffic by using MAC addresses. You can filter both IP and non-IP traffic on the same Layer 2 interface by applying both an IP access list and a MAC access list to the interface.



--------------------------------------------------------------------------------

Note You cannot apply more than one IP access list and one MAC access list to a Layer 2 interface. If an IP access list or MAC access list is already configured on a Layer 2 interface and you apply a new IP access list or MAC access list to the interface, the new ACL replaces the previously configured one.

论坛徽章:
0
6 [报告]
发表于 2008-06-10 22:21 |只看该作者
yes!
many thanks

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
7 [报告]
发表于 2008-06-10 22:21 |只看该作者
防止非法的dhcp还不如用dhcp snooping
发个参考给你
http://www.cisco.com/en/US/docs/ ... cp82.html#wp1180910

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
8 [报告]
发表于 2008-06-10 22:28 |只看该作者
Handling Fragmented and Unfragmented Traffic
IP packets can be fragmented as they cross the network. When this happens, only the fragment containing the beginning of the packet contains the Layer 4 information, such as TCP or UDP port numbers, ICMP type and code, and so on. All other fragments are missing this information.

Some ACEs do not check Layer 4 information and therefore can be applied to all packet fragments. ACEs that do test Layer 4 information cannot be applied in the standard manner to most of the fragments in a fragmented IP packet. When the fragment contains no Layer 4 information and the ACE tests some Layer 4 information, the matching rules are modified:

ermit ACEs that check the Layer 3 information in the fragment (including protocol type, such as TCP, UDP, and so on) are considered to match the fragment regardless of what the missing Layer 4 information might have been.

•Deny ACEs that check Layer 4 information never match a fragment unless the fragment contains Layer 4 information.

Consider access list 102, configured with these commands, applied to three fragmented packets:

Switch(config)# access-list 102 permit tcp any host 10.1.1.1 eq smtp
Switch(config)# access-list 102 deny tcp any host 10.1.1.2 eq telnet
Switch(config)# access-list 102 permit tcp any host 10.1.1.2
Switch(config)# access-list 102 deny tcp any any


--------------------------------------------------------------------------------

Note In the first and second ACEs in the examples, the eq keyword after the destination address means to test for the TCP-destination-port well-known numbers equaling Simple Mail Transfer Protocol (SMTP) and Telnet, respectively.


--------------------------------------------------------------------------------

acket A is a TCP packet from host 10.2.2.2., port 65000, going to host 10.1.1.1 on the SMTP port. If this packet is fragmented, the first fragment matches the first ACE (a permit) as if it were a complete packet because all Layer 4 information is present. The remaining fragments also match the first ACE, even though they do not contain the SMTP port information, because the first ACE only checks Layer 3 information when applied to fragments. The information in this example is that the packet is TCP and that the destination is 10.1.1.1.

acket B is from host 10.2.2.2, port 65001, going to host 10.1.1.2 on the Telnet port. If this packet is fragmented, the first fragment matches the second ACE (a deny) because all Layer 3 and Layer 4 information is present. The remaining fragments in the packet do not match the second ACE because they are missing Layer 4 information. Instead, they match the third ACE (a permit).

Because the first fragment was denied, host 10.1.1.2 cannot reassemble a complete packet, so packet B is effectively denied. However, the later fragments that are permitted will consume bandwidth on the network and resources of host 10.1.1.2 as it tries to reassemble the packet.

•Fragmented packet C is from host 10.2.2.2, port 65001, going to host 10.1.1.3, port ftp. If this packet is fragmented, the first fragment matches the fourth ACE (a deny). All other fragments also match the fourth ACE because that ACE does not check any Layer 4 information and because Layer 3 information in all fragments shows that they are being sent to host 10.1.1.3, and the earlier permit ACEs were checking different hosts.


http://www.cisco.com/en/US/docs/ ... wacl.html#wp1632554

论坛徽章:
0
9 [报告]
发表于 2008-06-11 09:47 |只看该作者
谢谢大家的帮助
我先看下哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP