{"id":193945,"date":"2020-10-29T02:24:08","date_gmt":"2020-10-28T18:24:08","guid":{"rendered":"http:\/\/4563.org\/?p=193945"},"modified":"2020-10-29T02:24:08","modified_gmt":"2020-10-28T18:24:08","slug":"%e5%85%b3%e4%ba%8e-pve-%e5%8d%95%e7%bd%91%e5%8d%a1-%e5%a4%9a-ip-%e8%af%a5%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=193945","title":{"rendered":"\u5173\u4e8e PVE \u5355\u7f51\u5361 \u591a IP \u8be5\u5982\u4f55\u914d\u7f6e\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e PVE \u5355\u7f51\u5361 \u591a IP \u8be5\u5982\u4f55\u914d\u7f6e\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : intlinfo <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u95ee\u4e0b\u5927\u4f6c\u4eec\uff0c\u76ee\u524d\u6211\u7684 pve \u662f\u5355 IP\uff0c\u4f46\u662f\u6211\u662f\u6865\u63a5\u7684\u7f51\u5361\u3002<\/p>\n<p>\u6211\u60f3\u628a\u6bcd\u9e21\u591a\u589e\u52a0\u4e00\u4e2a\u516c\u7f51 IP\uff0c\u5e94\u8be5\u600e\u4e48\u4fee\u6539\u8fd9\u4e2a\u7f51\u5361\u914d\u7f6e\u3002<\/p>\n<p>\u5148\u611f\u8c22\u5927\u4f6c\u4eec\u5e2e\u6211\u3002<\/p>\n<p>\u6211\u5c1d\u8bd5\u8fc7<\/p>\n<p>vmbr0:1 \u8fd9\u79cd\u5f62\u5f0f\u591a\u589e\u52a0\u4e00\u4e2a\uff0c\u4f46\u662f\u4e0d\u884c\u3002<\/p>\n<p>\u6211\u5c1d\u8bd5\u8fc7 enp34s0:1 \u8fd9\u6837\u76f4\u63a5\u6bcd\u9e21\u8fde\u4e0d\u4e0a\u4e86\uff0c\u91cd\u88c5\u7684\u7cfb\u7edf\u3002<\/p>\n<p>\u6865\u63a5\u7684\u65f6\u5019\u4e3b\u7f51\u5361 enp34s0 \u4e0d\u5141\u8bb8\u51fa\u73b0 IP \u3002<\/p>\n<pre><code>source \/etc\/network\/interfaces.d\/*  auto lo iface lo inet loopback  iface lo inet6 loopback  iface enp34s0 inet manual  auto vmbr0 iface vmbr0 inet static         address xxx.xxx.xxx.xxx\/27         gateway xxx.xxx.xxx.xxx         bridge-ports enp34s0         bridge-stp off         bridge-fd 0         bridge-maxwait 0  iface vmbr0 inet6 static         address xxx.xxx.xxx.xxx::1\/64         gateway xxx.xxx.xxx.xxx::1  auto vmbr1 iface vmbr1 inet static         address 10.10.10.0\/32         bridge-ports none         bridge-stp off         bridge-fd 0         bridge-maxwait 0  <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4195542\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : thtznet <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6362\u4e2a\u601d\u8def\uff1a\u518d\u4e70\u5757\u7269\u7406\u7f51\u5361\u3002\u597d\u5904\uff1a\u7b80\u5316\u903b\u8f91\u914d\u7f6e\uff0c\u6784\u5efa\u7269\u7406\u94fe\u8def\u7684\u9ad8\u53ef\u7528\uff0c\u7269\u7406\u5e26\u5bbd\u4e0a\u9650\u7ffb\u500d\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4195543\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 24owls <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8fd9\u79cd\u60c5\u51b5\u7528 ipvtap \u5c31\u633a\u5408\u9002<\/p>\n<p>$ ip link add link vmbr0 name ipvtap0 type ipvtap<br \/>$ ip address add vvv.vvv.vvv.vvv\/27 dev ipvtap0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4195544\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 24owls <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u60f3\u8981\u591a\u4e2a IP \u76f4\u63a5\u52a0\u5230 interface \u4e0a\u5c31\u53ef\u4ee5\u4e86\uff0c\u6bcf\u4e2a interface \u90fd\u53ef\u4ee5\u652f\u6301\u591a\u4e2a IP<\/p>\n<p>$ ip address add ttt.ttt.ttt.ttt\/27 dev vmbr0<\/p>\n<p>IP-Alliasing \u5982\u679c\u4e0d\u662f\u9700\u8981\u517c\u5bb9\u8001\u65e7\u670d\u52a1\u5c31\u6ca1\u5fc5\u8981\u518d\u7ee7\u7eed\u7528\u4e86\uff0c\u65e9\u5c31 obselete \u4e86 \u00a7 source: www.kernel.org\/doc\/html\/latest\/networking\/alias.html<\/p>\n<p>\u4e0d\u8fc7\u770b\u4f60\u7684\u9700\u6c42\u5e94\u8be5\u662f\u60f3\u8981\u589e\u52a0 interface \u6765\u5206\u914d\u7ed9\u4e0d\u540c\u7684\u865a\u62df\u7cfb\u7edf\u7528\u5427\uff0clinux \u652f\u6301\u7684\u5f88\u591a virtual interface \u90fd\u53ef\u4ee5\u7528\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6bd4\u5982 container \u4e00\u822c\u5c31\u662f\u7528 veth + netns \u6765\u63d0\u4f9b\u7f51\u7edc\u7684<\/p>\n<p>linux virtual network interface \u8fd9\u91cc\u6709\u4e00\u4e2a\u5199\u5f97\u5f88\u597d\u7684\u603b\u7ed3\uff0c\u53ef\u4ee5\u8bfb\u4e00\u8bfb \u00a7 developers.redhat.com\/blog\/2018\/10\/22\/introduction-to-linux-interfaces-for-virtual-networking\/<\/p>\n<p>\u4f60\u8fd9\u79cd\u60c5\u51b5\u7528 ipvtap \u5c31\u633a\u5408\u9002<\/p>\n<p>$ ip link add link vmbr0 name ipvtap0 type ipvtap<br \/>$ ip address add vvv.vvv.vvv.vvv\/27 dev ipvtap0<\/p>\n<p>\u4f60\u53ef\u4ee5\u8fd9\u6837\u68c0\u67e5\u7f51\u7edc\u662f\u901a\u7684<\/p>\n<p>$ ping -I vvv.vvv.vvv.vvv xxx.xxx.xxx.xxx<br \/>$ nc -vlk xxx.xxx.xxx.xxx 9999 &amp;<br \/>$ nc -v -s vvv.vvv.vvv.vvv xxx.xxx.xxx.xxx 9999                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4195545\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 24owls <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             obselete -&gt; obsolete                                                             <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4195546\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : intlinfo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @24owls \u6211\u662f\u60f3\u8ba9\u6bcd\u9e21\u6709 2 \u4e2a\u516c\u7f51 IP\uff0c\u76ee\u524d\u662f\u4e00\u4e2a\u516c\u7f51 IP \u3002\u4e0d\u6562\u80e1\u4e71\u64cd\u4f5c!!!                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e PVE \u5355\u7f51\u5361 \u591a IP \u8be5&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/193945"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193945"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/193945\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193945"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}