{"id":525,"date":"2013-12-20T15:44:20","date_gmt":"2013-12-20T07:44:20","guid":{"rendered":"http:\/\/blog.marvelplanet.tk\/?p=525"},"modified":"2016-04-11T04:29:23","modified_gmt":"2016-04-11T04:29:23","slug":"neutron%e4%b8%ad%e4%b8%80%e7%a7%8d%e5%b8%b8%e8%a7%81%e7%bd%91%e7%bb%9c%e4%b8%8d%e9%80%9a%e7%9a%84%e7%8e%b0%e8%b1%a1%ef%bc%8c%e9%99%84%e4%bf%ae%e5%a4%8d%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/marvelliu.space\/?p=525","title":{"rendered":"neutron\u4e2d\u4e00\u79cd\u5e38\u89c1\u7f51\u7edc\u4e0d\u901a\u7684\u73b0\u8c61\uff0c\u9644\u4fee\u590d\u811a\u672c"},"content":{"rendered":"<p>neutron\u4e2d\u7ecf\u5e38\u53d1\u73b0vm ping\u4e0d\u901a\u7f51\u5173\uff0c\u6211\u53d1\u73b0\u5f88\u591a\u60c5\u51b5\u662f\u56e0\u4e3aovs-plugin\u6ca1\u6709\u5c06qvb\u8fde\u63a5\u5230qbr\u6865\u4e0a\uff0c\u6240\u4ee5\u89e3\u51b3\u529e\u6cd5\u4e5f\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u5c06\u5176\u8fde\u4e0a\uff0c\u5373\u5c06qbr\u8bbe\u4e3amaster\u3002<\/p>\n<p>\u5177\u4f53\u7684neutron\u3001ovs\u3001veth\u548ciptables\u7b49\u5c31\u4e0d\u5c55\u5f00\u8bb2\u4e86\uff0c\u5177\u4f53\u53ef\u4ee5\u770b\u4e0b\u56fe<\/p>\n<p><a href=\"https:\/\/marvelliu.space\/wp-content\/uploads\/2013\/12\/ovs-neutron.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-526\" alt=\"ovs-neutron\" src=\"https:\/\/marvelliu.space\/wp-content\/uploads\/2013\/12\/ovs-neutron-300x170.jpg\" width=\"300\" height=\"170\" srcset=\"https:\/\/marvelliu.space\/wp-content\/uploads\/2013\/12\/ovs-neutron-300x170.jpg 300w, https:\/\/marvelliu.space\/wp-content\/uploads\/2013\/12\/ovs-neutron-620x350.jpg 620w, https:\/\/marvelliu.space\/wp-content\/uploads\/2013\/12\/ovs-neutron.jpg 839w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/a><\/p>\n<p>\u5f53\u4e00\u4e2avm\u542f\u52a8\u6216\u88ab\u786c\u91cd\u542f\u4e4b\u540e\uff0ctap\u63a5\u53e3\uff08\u5f53\u4f7f\u7528gre\u6a21\u5f0f\u65f6\u4e3atap\uff09\u548cqbr\u6865\u4f1a\u88ab\u81ea\u52a8\u521b\u5efa\uff0c\u800c\u4e14tap\u7684master\u4e3aqbr\u3002\u7406\u8bba\u4e0aqvb\u7684master\u4e5f\u5e94\u8be5\u662fqbr\uff0c\u4f46\u6211\u7ecf\u5e38\u53d1\u73b0\u8fd9\u4e2alink\u7684master\u6ca1\u6709\u88ab\u8bbe\u7f6e\u3002\u90a3\u4e48\u8bbe\u7f6e\u811a\u672c\u5c31\u5f88\u7b80\u5355\u4e86\uff1a<\/p>\n<p><code lang=\"bash\">#!\/bin\/bash<\/p>\n<p>LINKS=`ip link|grep qvb |awk '{print $2}' |sed s'\/.$\/\/'|sed s'\/^...\/\/'`<br \/>\nfor LINK in $LINKS<br \/>\ndo<br \/>\n  # a qbr link should appear after hard reboot an instance<br \/>\n  ip link set \"qbr$LINK\" up<br \/>\n  echo ip link set \"qvb$LINK\" master \"qbr$LINK\"<br \/>\n  ip link set \"qvb$LINK\" master \"qbr$LINK\"<br \/>\n  echo ip link set \"tap$LINK\" master \"qbr$LINK\"<br \/>\n  ip link set \"tap$LINK\" master \"qbr$LINK\"<br \/>\ndone<br \/>\n<\/code><br \/>\n\u6b64\u5916\u5728SDN\u73af\u5883\u4e2d\u8fd8\u6709\u51e0\u79cdvm\u8fde\u4e0d\u4e0a\u53ef\u80fd\uff0c\u6bd4\u5982<\/p>\n<ol>\n<li>br-tun\u6bcf\u6b21\u5728ovs-agent\u91cd\u542f\u540econtroller\u5c31\u4f1a\u6d88\u5931\uff0c\u6b64\u65f6\u5e94\u8be5\u5728\u91cd\u542f\u811a\u672c\u4e2d\u6dfb\u52a0\uff1a &nbsp;ovs-vsctl set-controller br-tun tcp:30.0.0.1<\/li>\n<li>\u786e\u5b9abr-int\u548cbr-tun\u6ca1\u6709\u591a\u4f59\u7684\u6d41\uff0c\u7528ovs-ofctl dump-flows br-int\/br-tun\u53ef\u770b<\/li>\n<li>\u786e\u5b9a\u7f51\u7edc\u63a7\u5236\u5668\u6b63\u5e38\u8fd0\u884c\uff0c\u6709\u65f6\u5019\u76d1\u63a7of\u63a7\u5236\u6d41\u53d1\u73b0\u53ea\u6709packet_in\u6ca1\u6709packet_out\uff0c\u6b64\u65f6\u91cd\u542f\u4e00\u4e0b\u7f51\u7edc\u63a7\u5236\u5668\u53ef\u80fd\u4f1a\u89e3\u51b3\u95ee\u9898<\/li>\n<\/ol>\n<p>\u5982\u679c\u8fd8\u662f\u6709\u95ee\u9898\uff0c\u4e0d\u59a8\u5bf9\u7167\u4e0a\u9762\u7684\u8fde\u63a5\u56fe\uff0c\u7136\u540e\u5206\u522b\u7528tcpdump\u76d1\u542ccompute node\u7684tap\u3001qbr\u3001qvb\u3001qvo\u3001br-int\u3001br-tun\u3001br-tun\u6240\u5bf9\u5e94\u7684eth\uff08\u5982\u679c\u7528gre\u6a21\u5f0f\u76d1\u542c\u8981\u52a0\u53c2\u6570proto gre\u624d\u80fd\u89e3gre\u5305\uff09\uff0c\u518d\u5230network node\u7684eth\u3001br-tun\u3001br-int\u3001\u518d\u5230namespace\u7684\u7f51\u5173\u63a5\u53e3qr-xxx\u3002<\/p>\n<p>\u5982\u679c\u53d1\u73b0br-int\u6709\u6570\u636e\u5305\uff0c\u4f46br-tun\u6ca1\u6709\u6570\u636e\u5305\uff0c\u4e0d\u59a8\u76d1\u542c\u4e00\u4e0bopenflow\u7684\u63a7\u5236\u6d41\uff1aovs-ofctl snoop br-int\/br-tun\uff0c\u770b\u770b\u63a7\u5236\u5668\u7684\u54cd\u5e94\u5982<\/p>\n","protected":false},"excerpt":{"rendered":"<p>neutron\u4e2d\u7ecf\u5e38\u53d1\u73b0vm ping\u4e0d\u901a\u7f51\u5173\uff0c\u6211\u53d1\u73b0\u5f88\u591a\u60c5\u51b5\u662f\u56e0\u4e3aovs-plugin\u6ca1\u6709\u5c06qvb\u8fde\u63a5\u5230qbr\u6865\u4e0a\uff0c\u6240\u4ee5\u89e3\u51b3\u529e\u6cd5\u4e5f\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u5c06\u5176\u8fde\u4e0a\uff0c\u5373\u5c06qbr\u8bbe\u4e3amaster\u3002 \u5177\u4f53\u7684neutron\u3001ovs\u3001veth\u548ciptables\u7b49\u5c31\u4e0d\u5c55\u5f00\u8bb2\u4e86\uff0c\u5177\u4f53\u53ef\u4ee5\u770b\u4e0b\u56fe \u5f53\u4e00\u4e2avm\u542f\u52a8\u6216\u88ab\u786c\u91cd\u542f\u4e4b\u540e\uff0ctap\u63a5\u53e3\uff08\u5f53\u4f7f\u7528gre\u6a21\u5f0f\u65f6\u4e3atap\uff09\u548cqbr\u6865\u4f1a\u88ab\u81ea\u52a8\u521b\u5efa\uff0c\u800c\u4e14tap\u7684master\u4e3aqbr\u3002\u7406\u8bba\u4e0aqvb\u7684master\u4e5f\u5e94\u8be5\u662fqbr\uff0c\u4f46\u6211\u7ecf\u5e38\u53d1\u73b0\u8fd9\u4e2alink\u7684master\u6ca1\u6709\u88ab\u8bbe\u7f6e\u3002\u90a3\u4e48\u8bbe\u7f6e\u811a\u672c\u5c31\u5f88\u7b80\u5355\u4e86\uff1a #!\/bin\/bash LINKS=`ip link|grep qvb |awk &#8216;{print $2}&#8217; |sed s&#8217;\/.$\/\/&#8217;|sed s&#8217;\/^&#8230;\/\/&#8217;` for LINK in $LINKS do # a qbr link should appear after hard reboot an instance ip link set &#8220;qbr$LINK&#8221; up echo ip link set &#8220;qvb$LINK&#8221; master &#8220;qbr$LINK&#8221; ip link set &#8220;qvb$LINK&#8221; master &#8220;qbr$LINK&#8221; echo ip link set &#8220;tap$LINK&#8221; master &#8220;qbr$LINK&#8221; &hellip; <a href=\"https:\/\/marvelliu.space\/?p=525\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;neutron\u4e2d\u4e00\u79cd\u5e38\u89c1\u7f51\u7edc\u4e0d\u901a\u7684\u73b0\u8c61\uff0c\u9644\u4fee\u590d\u811a\u672c&#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":[26],"tags":[27,32,29],"class_list":["post-525","post","type-post","status-publish","format-standard","hentry","category-sdn","tag-floodlight","tag-neutron","tag-openstack"],"_links":{"self":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/525","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=525"}],"version-history":[{"count":8,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/525\/revisions"}],"predecessor-version":[{"id":540,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/525\/revisions\/540"}],"wp:attachment":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}