{"id":1110,"date":"2022-07-29T01:24:00","date_gmt":"2022-07-29T01:24:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=1110"},"modified":"2022-07-29T01:24:00","modified_gmt":"2022-07-29T01:24:00","slug":"1110","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2022\/07\/29\/1110\/","title":{"rendered":"Debian11\u9759\u6001IP\u8bbe\u7f6e\u53c2\u8003-\u89e3\u51b3Vir\u7f51\u7edcIP\u8bbe\u7f6e\u7b14\u8bb0"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/07\/1817712316.png\" alt=\"ip_ens3.png\" title=\"ip_ens3.png\"><\/p>\n<p>\u7f51\u5361\u7684\u7f16\u53f7\u5b58\u5728\u4e00\u5b9a\u7684\u89c4\u5219\uff0c\u7f51\u5361\u7684\u4ee3\u53f7\u4e0e\u7f51\u5361\u7684\u6765\u6e90\u6709\u5173\u3002Linux\u7ee7\u627f\u4e86Unix\u4ee5\u7f51\u7edc\u4e3a\u6838\u5fc3\u7684\u8bbe\u8ba1\u601d\u60f3\uff0c\u4e3a\u4e00\u4e2a\u6027\u80fd\u7a33\u5b9a\u7684\u591a\u7528\u6237\u7f51\u7edc\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n<p>1\u3001eno1\uff1a\u4ee3\u8868\u7531\u4e3b\u677fbios\u5185\u7f6e\u7684\u7f51\u5361\u3002<\/p>\n<p>2\u3001ens3:\u4ee3\u8868\u6709\u4e3b\u677fbios\u5185\u7f6e\u7684PCI-E\u7f51\u5361\u3002<\/p>\n<p>3\u3001enp2s0: PCI-E\u72ec\u7acb\u7f51\u5361\u3002<\/p>\n<p>4\u3001eth0\uff1a\u5982\u679c\u4ee5\u4e0a\u90fd\u4e0d\u4f7f\u7528\uff0c\u5219\u56de\u5230\u9ed8\u8ba4\u7684\u7f51\u5361\u540d\u3002<\/p>\n<p>\u65e9\u4e0a \u7f51\u53cb Virmach \u673a\u5668 \u91cd\u65b0\u5b89\u88c5\u4e86 Debian 11, \u7ed3\u679c\u540d\u79f0\u8fd8\u662f\u8001\u7684\u6807\u51c6 eth0<br \/>\u611f\u89c9vir\u80d6\u5bb6\u7684debian11 \u662f\u4ece debian 9 \u5347\u7ea7\u7684\uff0c\u4e0d\u662f\u5168\u65b0\u5b89\u88c5\u7684<\/p>\n<p>\u7ed3\u5408\u4f7f\u7528 KVM\u9762\u677f\u91cd\u7f6e\u7f51\u7edc\u914d\u7f6e\uff0cvir\u5bb6\u4f1a\u628a\u7f51\u5361\u540d\u79f0\u91cd\u7f6e\u6210 eth0\uff0c\u4e5f\u7b97\u662f\u5347\u7ea7\u5305\u88b1\u4e86\u3002<br \/>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u81ea\u5df1\u7528\u811a\u672c\u91cd\u65b0\u5b89\u88c5\u8fc7Debian 11\uff0c\u5c31\u8981\u81ea\u5df1\u6bd4\u5bf9\u7f51\u5361\u662f\u5426\u6b63\u786e\u4e86<\/p>\n<p>dd \u5b89\u88c5 debian 11\uff0c\u5f97\u5230\u65b0\u6807\u51c6\u7684\u7f51\u5361\u540d\u79f0<\/p>\n<pre><code>2: ens3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt;\n    altname enp0s3<\/code><\/pre>\n<h3>bash shell \u547d\u4ee4\u884c\u8f93\u5165\u547d\u4ee4\u67e5\u770b\u7f51\u7edc\uff0c\u4e0b\u9762\u8fd9\u4e2a\u662fDHCP\u81ea\u52a8\u83b7\u53d6IP<\/h3>\n<h3>cat \/etc\/network\/interfaces<\/h3>\n<pre><code>source \/etc\/network\/interfaces.d\/*\n\n# The loopback network interface\nauto lo\niface lo inet loopback\n\n# The primary network interface\nallow-hotplug ens3\niface ens3 inet dhcp<\/code><\/pre>\n<p>\u5982\u679c\u4f60vps \u6ca1bug\uff0c\u4e00\u822c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\uff0c\u5982\u679cRP\u4e0d\u597d\uff0c\u5c31\u6309\u4e0a\u9762\u56fe\u4e2d\u4fee\u6539<br \/>\u4e0b\u9762\u4ee5 \u4f7f\u7528 nano \u4fee\u6539\u8bbe\u7f6e\u4e3e\u4f8b,nano \u4fdd\u5b58 ctrl+o \u4fdd\u5b58\uff0cctrl+x\u9000\u51fa<\/p>\n<h3>nano \/etc\/network\/interfaces<\/h3>\n<pre><code>source \/etc\/network\/interfaces.d\/*\nauto lo\niface lo inet loopback\n\nallow-hotplug ens3\niface ens3 inet static\n  address 188.188.1.222\/24\n  gateway 188.188.1.1\n  dns-nameservers 8.8.8.8.8\n<\/code><\/pre>\n<p>\u4e0a\u9762 \/24 \u8868\u793a\u524d\u97623\u4e2a\u662f\u7f51\u5740\u6bb5\uff0c\u548c mask 255.255.255.0 \u8868\u793a\u7ed3\u679c\u76f8\u540c<br \/>\/16 \/24 \u6309\u5b9e\u9645\u6765\u8bbe\u7f6e<\/p>\n<p>\u68c0\u67e5\u914d\u7f6e\u65e0\u95ee\u9898\uff0c\u4fdd\u5b58\u540e\uff0c\u8bd5\u7528 ifup \u91cd\u65b0\u52a0\u8f7d\u7f51\u5361<\/p>\n<h3>ifdown ens3 && ifup ens3<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u5361\u7684\u7f16\u53f7\u5b58\u5728\u4e00\u5b9a\u7684\u89c4\u5219\uff0c\u7f51\u5361\u7684\u4ee3\u53f7\u4e0e\u7f51\u5361\u7684\u6765\u6e90\u6709\u5173\u3002Linux\u7ee7\u627f\u4e86Unix\u4ee5\u7f51\u7edc\u4e3a\u6838\u5fc3\u7684\u8bbe\u8ba1\u601d\u60f3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[17],"class_list":["post-1110","post","type-post","status-publish","format-standard","hentry","category-vps","tag-vps"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1110"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1110\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}