interface xy ip access-group 101 in access-list 101 deny ip 10.0.0.0 0.255.255.255 any access-list 101 deny ip 192.168.0.0 0.0.255.255 any access-list 101 deny ip 172.16.0.0 0.15.255.255 any access-list 101 permit ip any any 3、参照RFC 2267,使用访问控制列表(ACL)过滤进出报文
access-list 190 permit ip {客户端网络} {客户端网络掩码} any access-list 190 deny ip any any [log] interface {内部网络接口} {网络接口号} ip access-group 190 in 以下是客户端边界路由器的ACL例子:
access-list 187 deny ip {客户端网络} {客户端网络掩码} any access-list 187 permit ip any any access-list 188 permit ip {客户端网络} {客户端网络掩码} any access-list 188 deny ip any any interface {外部网络接口} {网络接口号} ip access-group 187 in ip access-group 188 out 如果打开了CEF功能,通过使用单一地址反向路径转发(Unicast RPF),能够充分地缩短访问控制列表(ACL)的长度以提高路由器性能。为了支持Unicast RPF,只需在路由器完全打开CEF;打开这个功能的网络接口并不需要是CEF交换接口。
4、使用CAR(Control Access Rate)限制ICMP数据包流量速率
参考以下例子:
interface xy rate-limit output access-group 2020 3000000 512000 786000 conform-action transmit exceed-action drop access-list 2020 permit icmp any any echo-reply 请参阅IOS Essential Features 获取更详细资料。
5、设置SYN数据包流量速率
interface {int} rate-limit output access-group 153 45000000 100000 100000 conform-action transmit exceed-action drop rate-limit output access-group 152 1000000 100000 100000 conform-action transmit exceed-action drop access-list 152 permit tcp any host eq www access-list 153 permit tcp any host eq www established 在实现应用中需要进行必要的修改,替换: