{"id":543,"date":"2014-02-10T11:53:33","date_gmt":"2014-02-10T03:53:33","guid":{"rendered":"http:\/\/blog.marvelplanet.tk\/?p=543"},"modified":"2014-02-26T18:53:43","modified_gmt":"2014-02-26T10:53:43","slug":"openstack%e4%b8%ad%e6%9e%84%e9%80%a0%e4%bc%aa%e9%80%a0%e6%ba%90%e5%9c%b0%e5%9d%80%e6%94%bb%e5%87%bb","status":"publish","type":"post","link":"https:\/\/marvelliu.space\/?p=543","title":{"rendered":"Openstack\u4e2d\u6784\u9020\u4f2a\u9020\u6e90\u5730\u5740\u653b\u51fb"},"content":{"rendered":"<p>\u524d\u4e00\u7bc7\u662f\u5c06\u9632\u5fa1\uff0c\u8fd9\u4e00\u7bc7\u7b80\u5355\u8bf4\u4e00\u4e0bopenstack\u4e0b\u5982\u4f55\u53d1\u52a8\u4f2a\u9020\u6e90ip\u7684DoS\u653b\u51fb<br \/>\n1 \u4fee\u6539iptables\u548cebtables\u7684\u8bbe\u5b9a\uff0c\u4f8b\u5982\u653b\u51fbvm\u4e3a100.0.0.17\uff0c\u90a3\u4e48\u67e5\u8be2\u76f8\u5e94\u7684iptables\u89c4\u5219\uff1a<\/p>\n<pre>\r\nneutron port-list |grep 17\r\n| 091f121f-8cd7-4a02-b1d8-53866ab25d3d |      | fa:16:3e:f7:9d:70 | {\"subnet_id\": \"57b30eb5-e9ee-489f-85ea-77bcaa6249e5\", \"ip_address\": \"100.0.0.17\"}     |\r\n<\/pre>\n<p>\u627e\u5230iptables\u4e2d\u542b\u6709091f121f-8\u7684\u94fe\uff1aneutron-openvswi-s091f121f-8\uff0cneutron-openvswi-i091f121f-8\uff0cneutron-openvswi-o091f121f-8\uff0c\u548cnova-instance-xxx\uff08\u4e0e\u8be5vm\u5bf9\u5e94\u7684\uff09\u63d2\u5165\u4e00\u6761\u4f18\u5148\u7ea7\u6700\u9ad8\u7684ACCEPT\u94fe<\/p>\n<p>\u627e\u5230ebtables\u4e2dnat\u8868\u4e2d091f121f-8\u7684\u94fe\uff1aI-tap091f121f-8c-arp-ip\uff0cI-tap091f121f-8c-ipv4-ip\uff0c\u63d2\u5165\u4e00\u6761\u4f18\u5148\u7ea7\u6700\u9ad8\u7684ACCEPT\u94fe<\/p>\n<p>2 \u5b89\u88c5ruby\uff0c\u4e0b\u8f7dpentibox<\/p>\n<p>3 \u542f\u52a8pentibox\uff0c\u9009\u62e9Network tools->Net DoS Tester -> \u4efb\u610f\u4e00\u79cd\u5373\u53ef\u53d1\u52a8\u653b\u51fb<\/p>\n<p>\u5982\u679c\u7b2c1\u6b65\u4e2d\u52a0\u4e86\u89c4\u5219\u8fd8\u662f\u4e0d\u901a\uff0c\u8bf7\u68c0\u67e5\u6e90\u4e3b\u673a\u548c\u76ee\u7684\u4e3b\u673a\u7684\u5b89\u5168\u7ec4\u662f\u5426\u5141\u8bb8<\/p>\n<p>\u4e0b\u9762\u7684\u6211\u5199\u7684\u811a\u672c\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9<br \/>\n<code lang=\"bash\"><br \/>\n#!\/bin\/bash<\/p>\n<p>ip=$1<br \/>\necho $ip<br \/>\nid=`neutron port-list |grep \"$ip\"|awk '{print $2}'`<br \/>\necho $id<br \/>\nif [ -z $id ]<br \/>\nthen<br \/>\n    echo \"id null\"<br \/>\n    exit 1<br \/>\nfi<br \/>\nitid=`expr substr $id 1 10`<br \/>\necho $itid<br \/>\netid=`expr substr $id 1 11`<br \/>\necho $etid<\/p>\n<p>novarule=`iptables -L -nvx|grep $ip|grep nova |awk '{print $3}'`<br \/>\necho $novarule<br \/>\n#clear previous rules<br \/>\niptables -D neutron-openvswi-s$itid -j ACCEPT<br \/>\niptables -D neutron-openvswi-i$itid -j ACCEPT<br \/>\niptables -D neutron-openvswi-o$itid -j ACCEPT<br \/>\niptables -D $novarule -j ACCEPT<\/p>\n<p>ebtables -t nat -I I-tap$etid-arp-ip -j ACCEPT<br \/>\nebtables -t nat -I I-tap$etid-ipv4-ip -j ACCEPT<\/p>\n<p>#create rules<br \/>\niptables -I neutron-openvswi-s$itid -j ACCEPT<br \/>\niptables -I neutron-openvswi-i$itid -j ACCEPT<br \/>\niptables -I neutron-openvswi-o$itid -j ACCEPT<br \/>\niptables -I $novarule -j ACCEPT<\/p>\n<p>ebtables -t nat -I I-tap$etid-arp-ip -j ACCEPT<br \/>\nebtables -t nat -I I-tap$etid-ipv4-ip -j ACCEPT<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u4e00\u7bc7\u662f\u5c06\u9632\u5fa1\uff0c\u8fd9\u4e00\u7bc7\u7b80\u5355\u8bf4\u4e00\u4e0bopenstack\u4e0b\u5982\u4f55\u53d1\u52a8\u4f2a\u9020\u6e90ip\u7684DoS\u653b\u51fb 1 \u4fee\u6539iptables\u548cebtables\u7684\u8bbe\u5b9a\uff0c\u4f8b\u5982\u653b\u51fbvm\u4e3a100.0.0.17\uff0c\u90a3\u4e48\u67e5\u8be2\u76f8\u5e94\u7684iptables\u89c4\u5219\uff1a neutron port-list |grep 17 | 091f121f-8cd7-4a02-b1d8-53866ab25d3d | | fa:16:3e:f7:9d:70 | {&#8220;subnet_id&#8221;: &#8220;57b30eb5-e9ee-489f-85ea-77bcaa6249e5&#8221;, &#8220;ip_address&#8221;: &#8220;100.0.0.17&#8221;} | \u627e\u5230iptables\u4e2d\u542b\u6709091f121f-8\u7684\u94fe\uff1aneutron-openvswi-s091f121f-8\uff0cneutron-openvswi-i091f121f-8\uff0cneutron-openvswi-o091f121f-8\uff0c\u548cnova-instance-xxx\uff08\u4e0e\u8be5vm\u5bf9\u5e94\u7684\uff09\u63d2\u5165\u4e00\u6761\u4f18\u5148\u7ea7\u6700\u9ad8\u7684ACCEPT\u94fe \u627e\u5230ebtables\u4e2dnat\u8868\u4e2d091f121f-8\u7684\u94fe\uff1aI-tap091f121f-8c-arp-ip\uff0cI-tap091f121f-8c-ipv4-ip\uff0c\u63d2\u5165\u4e00\u6761\u4f18\u5148\u7ea7\u6700\u9ad8\u7684ACCEPT\u94fe 2 \u5b89\u88c5ruby\uff0c\u4e0b\u8f7dpentibox 3 \u542f\u52a8pentibox\uff0c\u9009\u62e9Network tools->Net DoS Tester -> \u4efb\u610f\u4e00\u79cd\u5373\u53ef\u53d1\u52a8\u653b\u51fb \u5982\u679c\u7b2c1\u6b65\u4e2d\u52a0\u4e86\u89c4\u5219\u8fd8\u662f\u4e0d\u901a\uff0c\u8bf7\u68c0\u67e5\u6e90\u4e3b\u673a\u548c\u76ee\u7684\u4e3b\u673a\u7684\u5b89\u5168\u7ec4\u662f\u5426\u5141\u8bb8 \u4e0b\u9762\u7684\u6211\u5199\u7684\u811a\u672c\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9 #!\/bin\/bash ip=$1 echo $ip id=`neutron port-list |grep &#8220;$ip&#8221;|awk &#8216;{print $2}&#8217;` echo $id if [ -z $id ] then echo &#8220;id null&#8221; exit 1 fi &hellip; <a href=\"https:\/\/marvelliu.space\/?p=543\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Openstack\u4e2d\u6784\u9020\u4f2a\u9020\u6e90\u5730\u5740\u653b\u51fb&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-543","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=543"}],"version-history":[{"count":4,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions"}],"predecessor-version":[{"id":548,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions\/548"}],"wp:attachment":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}