﻿{"id":215,"date":"2009-08-22T20:05:22","date_gmt":"2009-08-22T20:05:22","guid":{"rendered":""},"modified":"2011-11-18T17:02:04","modified_gmt":"2011-11-18T09:02:04","slug":"215","status":"publish","type":"post","link":"http:\/\/zerobox.org\/notes\/215.html","title":{"rendered":"\u8bbe\u7f6eCisco\u8def\u7531\u5668\u9632\u8303DDoS\u653b\u51fb"},"content":{"rendered":"<p><span style=\"font-size: x-small;\">\u6765\u6e90\uff1a<a href=\"http:\/\/laoxiege.blog.sohu.com\">http:\/\/laoxiege.blog.sohu.com<\/a><\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u4f7f\u7528 ip verfy unicast reverse-path \u7f51\u7edc\u63a5\u53e3\u547d\u4ee4<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u8fd9\u4e2a\u529f\u80fd\u68c0\u67e5\u6bcf\u4e00\u4e2a\u7ecf\u8fc7\u8def\u7531\u5668\u7684\u6570\u636e\u5305\u3002\u5728\u8def\u7531\u5668\u7684CEF\uff08Cisco Express Forwarding\uff09\u8868\u8be5\u6570\u636e\u5305\u6240\u5230\u8fbe\u7f51\u7edc\u63a5\u53e3\u7684\u6240\u6709\u8def\u7531\u9879\u4e2d\uff0c\u5982\u679c\u6ca1\u6709\u8be5\u6570\u636e\u5305\u6e90IP\u5730\u5740\u7684\u8def\u7531\uff0c\u8def\u7531\u5668\u5c06\u4e22\u5f03\u8be5\u6570\u636e\u5305\u3002\u4f8b\u5982\uff0c\u8def\u7531\u5668\u63a5\u6536\u5230\u4e00\u4e2a\u6e90 IP\u5730\u5740\u4e3a1.2.3.4\u7684\u6570\u636e\u5305\uff0c\u5982\u679cCEF\u8def\u7531\u8868\u4e2d\u6ca1\u6709\u4e3aIP\u5730\u57401.2.3.4\u63d0\u4f9b\u4efb\u4f55\u8def\u7531\uff08\u5373\u53cd\u5411\u6570\u636e\u5305\u4f20\u8f93\u65f6\u6240\u9700\u7684\u8def\u7531\uff09\uff0c\u5219\u8def\u7531\u5668\u4f1a\u4e22\u5f03\u5b83\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5355\u4e00\u5730\u5740\u53cd\u5411\u4f20\u8f93\u8def\u5f84\u8f6c\u53d1\uff08Unicast Reverse Path Forwarding\uff09\u5728ISP\uff08\u5c40\u7aef\uff09\u5b9e\u73b0\u963b\u6b62SMURF\u653b\u51fb\u548c\u5176\u5b83\u57fa\u4e8eIP\u5730\u5740\u4f2a\u88c5\u7684\u653b\u51fb\u3002\u8fd9\u80fd\u591f\u4fdd\u62a4\u7f51\u7edc\u548c\u5ba2\u6237\u514d\u53d7\u6765\u81ea\u4e92\u8054\u7f51\u5176\u5b83\u5730\u65b9\u7684\u4fb5\u6270\u3002\u4f7f\u7528 Unicast RPF\u9700\u8981\u6253\u5f00\u8def\u7531\u5668\u7684&#8221;CEF swithing&#8221;\u6216&#8221;CEF distributed switching&#8221;\u9009\u9879\u3002\u4e0d\u9700\u8981\u5c06\u8f93\u5165\u63a5\u53e3\u914d\u7f6e\u4e3aCEF\u4ea4\u6362\uff08switching\uff09\u3002\u53ea\u8981\u8be5\u8def\u7531\u5668\u6253\u5f00\u4e86CEF\u529f\u80fd\uff0c\u6240\u6709\u72ec\u7acb\u7684\u7f51\u7edc\u63a5\u53e3\u90fd\u53ef\u4ee5\u914d\u7f6e\u4e3a\u5176\u5b83\u4ea4\u6362\uff08switching\uff09\u6a21\u5f0f\u3002RPF\uff08\u53cd\u5411\u4f20\u8f93\u8def\u5f84\u8f6c\u53d1\uff09\u5c5e\u4e8e\u5728\u4e00\u4e2a\u7f51\u7edc\u63a5\u53e3\u6216\u5b50\u63a5\u53e3\u4e0a\u6fc0\u6d3b\u7684\u8f93\u5165\u7aef\u529f\u80fd\uff0c\u5904\u7406\u8def\u7531\u5668\u63a5\u6536\u7684\u6570\u636e\u5305\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u5728\u8def\u7531\u5668\u4e0a\u6253\u5f00CEF\u529f\u80fd\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u56e0\u4e3aRPF\u5fc5\u987b\u4f9d\u9760CEF\u3002Unicast RPF\u5305\u542b\u5728\u652f\u6301CEF\u7684Cisco IOS 12.0\u53ca\u4ee5\u4e0a\u7248\u672c\u4e2d\uff0c\u4f46\u4e0d\u652f\u6301Cisco IOS 11.2\u621611.3\u7248\u672c\u3002<\/span><\/p>\n<p><strong><span style=\"font-size: x-small;\">2\u3001\u4f7f\u7528\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff08ACL\uff09\u8fc7\u6ee4RFC 1918\u4e2d\u5217\u51fa\u7684\u6240\u6709\u5730\u5740<\/span><\/strong><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u53c2\u8003\u4ee5\u4e0b\u4f8b\u5b50\uff1a<\/span><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"font-size: 9pt;\" bgcolor=\"#e6e6e6\"><span style=\"font-size: x-small;\">interface xy<br \/>\nip access-group 101 in<br \/>\naccess-list 101 deny ip 10.0.0.0 0.255.255.255 any<br \/>\naccess-list 101 deny ip 192.168.0.0 0.0.255.255 any<br \/>\naccess-list 101 deny ip 172.16.0.0 0.15.255.255 any<br \/>\naccess-list 101 permit ip any any<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><span style=\"font-size: x-small;\">3\u3001\u53c2\u7167RFC 2267\uff0c\u4f7f\u7528\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff08ACL\uff09\u8fc7\u6ee4\u8fdb\u51fa\u62a5\u6587<\/span><\/strong><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u53c2\u8003\u4ee5\u4e0b\u4f8b\u5b50\uff1a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000{ISP\u4e2d\u5fc3} &#8212; ISP\u7aef\u8fb9\u754c\u8def\u7531\u5668 &#8212; \u5ba2\u6237\u7aef\u8fb9\u754c\u8def\u7531\u5668 &#8212; {\u5ba2\u6237\u7aef\u7f51\u7edc}<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000ISP\u7aef\u8fb9\u754c\u8def\u7531\u5668\u5e94\u8be5\u53ea\u63a5\u53d7\u6e90\u5730\u5740\u5c5e\u4e8e\u5ba2\u6237\u7aef\u7f51\u7edc\u7684\u901a\u4fe1\uff0c\u800c\u5ba2\u6237\u7aef\u7f51\u7edc\u5219\u5e94\u8be5\u53ea\u63a5\u53d7\u6e90\u5730\u5740\u672a\u88ab\u5ba2\u6237\u7aef\u7f51\u7edc\u8fc7\u6ee4\u7684\u901a\u4fe1\u3002\u4ee5\u4e0b\u662fISP\u7aef\u8fb9\u754c\u8def\u7531\u5668\u7684\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff08ACL\uff09\u4f8b\u5b50\uff1a<\/span><\/p>\n<p>\u4ee5\u4e0b\u662f\u5ba2\u6237\u7aef\u8fb9\u754c\u8def\u7531\u5668\u7684ACL\u4f8b\u5b50\uff1a<\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"font-size: 9pt;\" bgcolor=\"#e6e6e6\"><span style=\"font-size: x-small;\">access-list 190 permit ip {\u5ba2\u6237\u7aef\u7f51\u7edc} {\u5ba2\u6237\u7aef\u7f51\u7edc\u63a9\u7801} any<br \/>\naccess-list 190 deny ip any any [log]<\/span><\/p>\n<p><span style=\"font-size: x-small;\">interface {\u5185\u90e8\u7f51\u7edc\u63a5\u53e3} {\u7f51\u7edc\u63a5\u53e3\u53f7}<br \/>\nip access-group 190 in<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-size: x-small;\">\u4ee5\u4e0b\u662f\u5ba2\u6237\u7aef\u8fb9\u754c\u8def\u7531\u5668\u7684ACL\u4f8b\u5b50\uff1a<\/span><\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"font-size: 9pt;\" bgcolor=\"#e6e6e6\"><span style=\"font-size: x-small;\">access-list 187 deny ip {\u5ba2\u6237\u7aef\u7f51\u7edc} {\u5ba2\u6237\u7aef\u7f51\u7edc\u63a9\u7801} any<br \/>\naccess-list 187 permit ip any any<br \/>\naccess-list 188 permit ip {\u5ba2\u6237\u7aef\u7f51\u7edc} {\u5ba2\u6237\u7aef\u7f51\u7edc\u63a9\u7801} any<br \/>\naccess-list 188 deny ip any any<br \/>\ninterface {\u5916\u90e8\u7f51\u7edc\u63a5\u53e3} {\u7f51\u7edc\u63a5\u53e3\u53f7}<br \/>\nip access-group 187 in<br \/>\nip access-group 188 out<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u5982\u679c\u6253\u5f00\u4e86CEF\u529f\u80fd\uff0c\u901a\u8fc7\u4f7f\u7528\u5355\u4e00\u5730\u5740\u53cd\u5411\u8def\u5f84\u8f6c\u53d1\uff08Unicast RPF\uff09\uff0c\u80fd\u591f\u5145\u5206\u5730\u7f29\u77ed\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff08ACL\uff09\u7684\u957f\u5ea6\u4ee5\u63d0\u9ad8\u8def\u7531\u5668\u6027\u80fd\u3002\u4e3a\u4e86\u652f\u6301Unicast RPF\uff0c\u53ea\u9700\u5728\u8def\u7531\u5668\u5b8c\u5168\u6253\u5f00CEF\uff1b\u6253\u5f00\u8fd9\u4e2a\u529f\u80fd\u7684\u7f51\u7edc\u63a5\u53e3\u5e76\u4e0d\u9700\u8981\u662fCEF\u4ea4\u6362\u63a5\u53e3\u3002<\/span><\/p>\n<p><strong><span style=\"font-size: x-small;\">4\u3001\u4f7f\u7528CAR\uff08Control Access Rate\uff09\u9650\u5236ICMP\u6570\u636e\u5305\u6d41\u91cf\u901f\u7387<\/span><\/strong><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u53c2\u8003\u4ee5\u4e0b\u4f8b\u5b50\uff1a<\/span><\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"font-size: 9pt;\" bgcolor=\"#e6e6e6\"><span style=\"font-size: x-small;\">interface xy<br \/>\nrate-limit output access-group 2020 3000000 512000 786000 conform-action<br \/>\ntransmit exceed-action drop<br \/>\naccess-list 2020 permit icmp any any echo-reply<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-size: x-small;\">\u8bf7\u53c2\u9605IOS Essential Features \u83b7\u53d6\u66f4\u8be6\u7ec6\u8d44\u6599\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\"><strong>5\u3001\u8bbe\u7f6eSYN\u6570\u636e\u5305\u6d41\u91cf\u901f\u7387<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"font-size: 9pt;\" bgcolor=\"#e6e6e6\"><span style=\"font-size: x-small;\">interface {int}<br \/>\nrate-limit output access-group 153 45000000 100000 100000 conform-action<br \/>\ntransmit exceed-action drop<br \/>\nrate-limit output access-group 152 1000000 100000 100000 conform-action<br \/>\ntransmit exceed-action drop<\/span><\/p>\n<p><span style=\"font-size: x-small;\">access-list 152 permit tcp any host eq www<br \/>\naccess-list 153 permit tcp any host eq www established<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-size: x-small;\">\u5728\u5b9e\u73b0\u5e94\u7528\u4e2d\u9700\u8981\u8fdb\u884c\u5fc5\u8981\u7684\u4fee\u6539\uff0c\u66ff\u6362\uff1a<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u300045000000\u4e3a\u6700\u5927\u8fde\u63a5\u5e26\u5bbd<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u30001000000\u4e3aSYN flood\u6d41\u91cf\u901f\u7387\u768430%\u523050%\u4e4b\u95f4\u7684\u6570\u503c\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000burst normal\uff08\u6b63\u5e38\u7a81\u53d8\uff09\u548c burst max\uff08\u6700\u5927\u7a81\u53d8\uff09\u4e24\u4e2a\u901f\u7387\u4e3a\u6b63\u786e\u7684\u6570\u503c\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u6ce8\u610f\uff0c\u5982\u679c\u7a81\u53d8\u901f\u7387\u8bbe\u7f6e\u8d85\u8fc730%\uff0c\u53ef\u80fd\u4f1a\u4e22\u5931\u8bb8\u591a\u5408\u6cd5\u7684SYN\u6570\u636e\u5305\u3002\u4f7f\u7528&#8221;show interfaces rate-limit&#8221;\u547d\u4ee4\u67e5\u770b\u8be5\u7f51\u7edc\u63a5\u53e3\u7684\u6b63\u5e38\u548c\u8fc7\u5ea6\u901f\u7387\uff0c\u80fd\u591f\u5e2e\u52a9\u786e\u5b9a\u5408\u9002\u7684\u7a81\u53d8\u901f\u7387\u3002\u8fd9\u4e2aSYN\u901f\u7387\u9650\u5236\u6570\u503c\u8bbe\u7f6e\u6807\u51c6\u662f\u4fdd\u8bc1\u6b63\u5e38\u901a\u4fe1\u7684\u57fa\u7840\u4e0a\u5c3d\u53ef\u80fd\u5730\u5c0f\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u8b66\u544a\uff1a\u4e00\u822c\u63a8\u8350\u5728\u7f51\u7edc\u6b63\u5e38\u5de5\u4f5c\u65f6\u6d4b\u91cfSYN\u6570\u636e\u5305\u6d41\u91cf\u901f\u7387\uff0c\u4ee5\u6b64\u57fa\u51c6\u6570\u503c\u52a0\u4ee5\u8c03\u6574\u3002\u5fc5\u987b\u5728\u8fdb\u884c\u6d4b\u91cf\u65f6\u786e\u4fdd\u7f51\u7edc\u7684\u6b63\u5e38\u5de5\u4f5c\u4ee5\u907f\u514d\u51fa\u73b0\u8f83\u5927\u8bef\u5dee\u3002<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u53e6\u5916\uff0c\u5efa\u8bae\u8003\u8651\u5728\u53ef\u80fd\u6210\u4e3aSYN\u653b\u51fb\u7684\u4e3b\u673a\u4e0a\u5b89\u88c5IP Filter\u7b49IP\u8fc7\u6ee4\u5de5\u5177\u5305\u3002<\/span><\/p>\n<p><strong><span style=\"font-size: x-small;\">6\u3001\u641c\u96c6\u8bc1\u636e\u5e76\u8054\u7cfb\u7f51\u7edc\u5b89\u5168\u90e8\u95e8\u6216\u673a\u6784<\/span><\/strong><\/p>\n<p><span style=\"font-size: x-small;\">\u3000\u3000\u5982\u679c\u53ef\u80fd\uff0c\u6355\u83b7\u653b\u51fb\u6570\u636e\u5305\u7528\u4e8e\u5206\u6790\u3002\u5efa\u8bae\u4f7f\u7528SUN\u5de5\u4f5c\u7ad9\u6216Linux\u7b49\u9ad8\u901f\u8ba1\u7b97\u673a\u6355\u83b7\u6570\u636e\u5305\u3002\u5e38\u7528\u7684\u6570\u636e\u5305\u6355\u83b7\u5de5\u5177\u5305\u62ecTCPDump\u548csnoop\u7b49\u3002\u57fa\u672c\u8bed\u6cd5\u4e3a\uff1a<\/span><\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"font-size: 9pt;\" bgcolor=\"#e6e6e6\"><span style=\"font-size: x-small;\">tcpdump -i interface -s 1500 -w capture_file<br \/>\nsnoop -d interface -o capture_file -s 1500<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-size: x-small;\">\u672c\u4f8b\u4e2d\u5047\u5b9aMTU\u5927\u5c0f\u4e3a1500\u3002\u5982\u679cMTU\u5927\u4e8e1500\uff0c\u5219\u9700\u8981\u4fee\u6539\u76f8\u5e94\u53c2\u6570\u3002\u5c06\u8fd9\u4e9b\u6355\u83b7\u7684\u6570\u636e\u5305\u548c\u65e5\u5fd7\u4f5c\u4e3a\u8bc1\u636e\u63d0\u4f9b\u7ed9\u6709\u5173\u7f51\u7edc\u5b89\u5168\u90e8\u95e8\u6216\u673a\u6784\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6765\u6e90\uff1ahttp:\/\/laoxiege.blog.sohu.com \u4f7f\u7528 ip v &hellip;<\/p>\n<p class=\"read-more\"><a href=\"http:\/\/zerobox.org\/notes\/215.html\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[124,125,32],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","tag-cisco","tag-ddos","tag-32"],"views":880,"_links":{"self":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/comments?post=215"}],"version-history":[{"count":0,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/215\/revisions"}],"wp:attachment":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/media?parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/categories?post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/tags?post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}