{"id":566953,"date":"2023-09-09T01:39:16","date_gmt":"2023-09-08T17:39:16","guid":{"rendered":"http:\/\/4563.org\/?p=566953"},"modified":"2023-09-09T01:39:16","modified_gmt":"2023-09-08T17:39:16","slug":"scaleway%e6%98%9f%e8%be%b0%e5%bc%80%e6%9c%ba%e8%87%aa%e5%8a%a8%e8%8e%b7%e5%8f%96ip","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=566953","title":{"rendered":"Scaleway\u661f\u8fb0\u5f00\u673a\u81ea\u52a8\u83b7\u53d6ip"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u6d41\u661f<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>Scaleway\u661f\u8fb0\u5f00\u673a\u81ea\u52a8\u83b7\u53d6ip<\/h3>\n<p>  \t\t\u56e0\u4e3a\u6211\u53ea\u6709alpine linux\uff0c\u6240\u4ee5\u6211\u7684\u811a\u672c\u90fd\u662f\u57fa\u4e8ealpine linux\u7684\uff1a<\/p>\n<p>  \u9996\u5148\uff0c\u5728\/root\u4e0b\u5efa\u7acbnetwork.sh\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>  #!\/bin\/sh<br \/>  ip route add 169.254.42.42 dev eth0 2&gt;\/dev\/null<br \/>  serverinfo=$(curl -s -X GET &quot;http:\/\/169.254.42.42\/conf?format=json&quot;)<br \/>  ipv6info=$(echo $serverinfo | grep -Eo &#8216;&quot;ipv6&quot;: {[^}]+}&#8217;)<br \/>  address=$(echo $ipv6info | sed -r &#8216;s\/^.*&quot;address&quot;: &quot;([^&quot;]+)&quot;.*$\/1\/g&#8217;)<br \/>  gateway=$(echo $ipv6info | sed -r &#8216;s\/^.*&quot;gateway&quot;: &quot;([^&quot;]+)&quot;.*$\/1\/g&#8217;)<br \/>  netmask=$(echo $ipv6info | sed -r &#8216;s\/^.*&quot;netmask&quot;: &quot;([^&quot;]+)&quot;.*$\/1\/g&#8217;)<br \/>  if [ -n &quot;$address&quot; ] &amp;&amp; [ -n &quot;$gateway&quot; ] &amp;&amp; [ -n &quot;$netmask&quot; ]; then<br \/>  ip addr flush dev eth0<br \/>  ip addr add $address\/$netmask dev eth0<br \/>  ip -6 route add $gateway dev eth0<br \/>  ip -6 route add default via $gateway<br \/>  fi<\/p>\n<p>  \u7136\u540e\u4fee\u6539\/etc\/network\/interfaces\u7684\u5185\u5bb9\u4e3a\u5982\u4e0b\uff1a<br \/>  auto lo<br \/>  iface lo inet loopback<\/p>\n<p>  auto eth0<br \/>  iface eth0 inet dhcp<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;up sh \/root\/network.sh<\/p>\n<p>  \u662f\u7814\u7a76\u4e86cloud-init\u7684\u6e90\u7801\uff0c\u624d\u627e\u5230\u4e86\u83b7\u53d6\u661f\u8fb0ip\u7684\u65b9\u6cd5\u3002<\/p>\n<p>  \u5176\u4ed6\u5e73\u53f0\u7684\u53ef\u4ee5\u81ea\u5df1\u4fee\u6539\u4e0b\u5b9e\u73b0\u65b9\u6cd5\u3002  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>ratneo<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5927\u4f6c\u600e\u4e48dd alpine linux\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6d41\u661f<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tratneo \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-9-8 23:23<br \/>  \u5927\u4f6c\u600e\u4e48dd alpine linux<\/p>\n<p> \u6211\u4e4b\u524d\u662f\u624b\u52a8\u5b89\u88c5\u7684\uff0c\u4e0d\u8fc7\u542c\u8bf4\u4e0d\u597d\u7528\u7684\uff0c\u4e0d\u8fc7\u4f60\u53ef\u4ee5\u8bd5\u8bd5netboot\u6765\u5b89\u88c5\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u9ea6\u7530<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tscaleway\u7f51\u7ad9\u8981\u505a\u4ec0\u4e48\u8bbe\u7f6e\u7684\u5417\uff1f\u6bd4\u5982cloud-init\u5f00\u5173\u4ec0\u4e48\u7684\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hacn<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u624b\u52a8\u8fdbvnc\u91cc\u9762\u6539\u4e00\u4e0b\u5c31\u884c \u4e0d\u7ecf\u5e38\u91cd\u542f \u65e0\u6240\u8c13yc006t\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6d41\u661f<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u9ea6\u7530 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2023-9-8 23:53<br \/>  scaleway\u7f51\u7ad9\u8981\u505a\u4ec0\u4e48\u8bbe\u7f6e\u7684\u5417\uff1f\u6bd4\u5982cloud-init\u5f00\u5173\u4ec0\u4e48\u7684<\/p>\n<p> \u4e0d\u7528\uff0c\u90a3\u4e2a\u5f00\u5173\u5e94\u8be5\u662f\u522b\u7684\u7528\u5904\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d41\u661f \u5927\u4f6c\u6709\u8bdd\u8bf4 : Scalew&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/566953"}],"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=566953"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/566953\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=566953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=566953"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=566953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}