{"id":10149,"date":"2025-04-18T17:53:19","date_gmt":"2025-04-18T09:53:19","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/10149.html"},"modified":"2025-04-18T17:53:19","modified_gmt":"2025-04-18T09:53:19","slug":"%e5%a6%82%e4%bd%95%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%aeubuntu%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84ip%e3%80%81%e5%ad%90%e7%bd%91%e6%8e%a9%e7%a0%81%e3%80%81%e7%bd%91%e5%85%b3%e3%80%81dns","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/10149.html","title":{"rendered":"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS"},"content":{"rendered":"<p>\u5728 Ubuntu \u670d\u52a1\u5668\u4e0a\u624b\u52a8\u8bbe\u7f6e IP \u5730\u5740\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u548c DNS&#xff0c;\u901a\u5e38\u6709\u4e24\u79cd\u65b9\u5f0f&#xff1a;\u4f7f\u7528\u4f20\u7edf\u7684 ifconfig \u547d\u4ee4\u548c\u914d\u7f6e\u6587\u4ef6&#xff0c;\u6216\u8005\u4f7f\u7528\u73b0\u4ee3\u7684 netplan \u914d\u7f6e\u65b9\u5f0f&#xff08;\u5bf9\u4e8e Ubuntu 17.10 \u53ca\u4ee5\u540e\u7248\u672c&#xff0c;netplan \u662f\u9ed8\u8ba4\u7684\u7f51\u7edc\u914d\u7f6e\u5de5\u5177&#xff09;\u3002\u4e0b\u9762\u5c06\u5206\u522b\u4ecb\u7ecd\u8fd9\u4e24\u79cd\u65b9\u6cd5\u3002<\/p>\n<h4>1. \u4f7f\u7528 netplan \u914d\u7f6e&#xff08;\u9002\u7528\u4e8e Ubuntu 17.10 \u53ca\u4ee5\u540e\u7248\u672c&#xff09;<\/h4>\n<p>\u5728 Ubuntu 17.10 \u548c\u66f4\u9ad8\u7248\u672c\u4e2d&#xff0c;\u9ed8\u8ba4\u4f7f\u7528 netplan \u6765\u7ba1\u7406\u7f51\u7edc\u8bbe\u7f6e\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91 netplan \u914d\u7f6e\u6587\u4ef6\u6765\u624b\u52a8\u8bbe\u7f6e IP \u5730\u5740\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u548c DNS\u3002<\/p>\n<h5>\u6b65\u9aa4 1&#xff1a;\u627e\u5230\u5e76\u7f16\u8f91 netplan \u914d\u7f6e\u6587\u4ef6<\/h5>\n<p>\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e \/etc\/netplan\/ \u76ee\u5f55\u4e0b\u3002\u8fdb\u5165\u8be5\u76ee\u5f55&#xff0c;\u627e\u5230\u4ee5 .yaml \u7ed3\u5c3e\u7684\u6587\u4ef6\u3002\u901a\u5e38\u8fd9\u4e2a\u6587\u4ef6\u540d\u662f 01-netcfg.yaml \u6216\u7c7b\u4f3c\u540d\u79f0\u3002<\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> \/etc\/netplan\/<br \/>\n<span class=\"token function\">ls<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> 00-installer-config.yaml  <span class=\"token comment\"># \u6216\u8005\u5176\u4ed6\u6587\u4ef6\u540d<\/span><\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p>\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u6309\u7167\u4ee5\u4e0b\u683c\u5f0f\u8bbe\u7f6e\u4f60\u7684\u7f51\u7edc\u914d\u7f6e&#xff1a;<\/p>\n<p><span class=\"token key atrule\">network<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">2<\/span><br \/>\n  <span class=\"token key atrule\">renderer<\/span><span class=\"token punctuation\">:<\/span> networkd  <span class=\"token comment\"># \u8fd9\u91cc\u4f7f\u7528 networkd \u6e32\u67d3\u5668&#xff0c;\u4e5f\u53ef\u4ee5\u4f7f\u7528 NetworkManager&#xff0c;\u89c6\u4f60\u7684\u73af\u5883\u800c\u5b9a<\/span><br \/>\n  <span class=\"token key atrule\">ethernets<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">eth0<\/span><span class=\"token punctuation\">:<\/span>  <span class=\"token comment\"># \u8fd9\u91cc\u662f\u4f60\u7f51\u5361\u7684\u540d\u79f0&#xff0c;\u53ef\u4ee5\u662f eth0\u3001enp0s3 \u7b49&#xff0c;\u67e5\u770b\u53ef\u4ee5\u7528 &#096;ip a&#096; \u6216 &#096;ifconfig&#096;<\/span><br \/>\n      <span class=\"token key atrule\">dhcp4<\/span><span class=\"token punctuation\">:<\/span> no  <span class=\"token comment\"># \u5173\u95ed DHCP&#xff08;\u5982\u679c\u4f60\u9700\u8981\u9759\u6001 IP&#xff09;<\/span><br \/>\n      <span class=\"token key atrule\">addresses<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token punctuation\">&#8211;<\/span> 192.168.1.100\/24  <span class=\"token comment\"># \u8bbe\u7f6e\u9759\u6001 IP \u548c\u5b50\u7f51\u63a9\u7801&#xff08;\/24 \u4ee3\u8868 255.255.255.0&#xff09;<\/span><br \/>\n      <span class=\"token key atrule\">gateway4<\/span><span class=\"token punctuation\">:<\/span> 192.168.1.1  <span class=\"token comment\"># \u8bbe\u7f6e\u7f51\u5173<\/span><br \/>\n      <span class=\"token key atrule\">nameservers<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">addresses<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token punctuation\">&#8211;<\/span> 8.8.8.8  <span class=\"token comment\"># \u8bbe\u7f6e DNS<\/span><br \/>\n          <span class=\"token punctuation\">&#8211;<\/span> 8.8.4.4  <span class=\"token comment\"># \u53ef\u4ee5\u8bbe\u7f6e\u591a\u4e2a DNS<\/span><\/p>\n<p>\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u4f1a\u5c06 eth0 \u7f51\u5361\u7684 IP \u8bbe\u7f6e\u4e3a 192.168.1.100&#xff0c;\u5b50\u7f51\u63a9\u7801\u4e3a 255.255.255.0&#xff0c;\u7f51\u5173\u4e3a 192.168.1.1&#xff0c;DNS \u670d\u52a1\u5668\u4e3a 8.8.8.8 \u548c 8.8.4.4\u3002<\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u5e94\u7528\u66f4\u6539<\/h5>\n<p>\u7f16\u8f91\u5b8c\u6210\u540e&#xff0c;\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6&#xff0c;\u7136\u540e\u5e94\u7528\u66f4\u6539&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> netplan apply<\/p>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u914d\u7f6e\u662f\u5426\u6b63\u786e&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> netplan try<\/p>\n<p>netplan try \u4f1a\u5728\u4e00\u5b9a\u65f6\u95f4\u5185\u5c1d\u8bd5\u5e94\u7528\u914d\u7f6e&#xff0c;\u5982\u679c\u51fa\u73b0\u95ee\u9898&#xff0c;\u5b83\u4f1a\u81ea\u52a8\u56de\u6eda&#xff0c;\u4ee5\u9632\u6b62\u914d\u7f6e\u9519\u8bef\u5bfc\u81f4\u7f51\u7edc\u4e2d\u65ad\u3002<\/p>\n<h5>\u6b65\u9aa4 4&#xff1a;\u9a8c\u8bc1\u7f51\u7edc\u914d\u7f6e<\/h5>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 ip a \u6216 ifconfig \u67e5\u770b\u5f53\u524d\u7f51\u7edc\u914d\u7f6e&#xff1a;<\/p>\n<p><span class=\"token function\">ip<\/span> a<\/p>\n<p>\u68c0\u67e5 IP \u5730\u5740\u3001\u5b50\u7f51\u63a9\u7801\u548c\u7f51\u5173\u662f\u5426\u5df2\u6b63\u786e\u914d\u7f6e\u3002<\/p>\n<h4>2. \u4f7f\u7528 ifconfig \u548c\u4f20\u7edf\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6&#xff08;\u9002\u7528\u4e8e\u8f83\u65e7\u7248\u672c\u7684 Ubuntu&#xff09;<\/h4>\n<p>\u5bf9\u4e8e Ubuntu 16.04 \u53ca\u66f4\u65e9\u7248\u672c&#xff0c;\u4f60\u9700\u8981\u624b\u52a8\u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\u6765\u8bbe\u7f6e\u9759\u6001 IP\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91 \/etc\/network\/interfaces \u6587\u4ef6\u6765\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<h5>\u6b65\u9aa4 1&#xff1a;\u7f16\u8f91 \/etc\/network\/interfaces \u6587\u4ef6<\/h5>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/network\/interfaces<\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u8bbe\u7f6e\u9759\u6001 IP \u914d\u7f6e<\/h5>\n<p>\u627e\u5230\u4f60\u8981\u914d\u7f6e\u7684\u7f51\u7edc\u63a5\u53e3&#xff08;\u901a\u5e38\u662f eth0 \u6216 ens33 \u7b49&#xff09;&#xff0c;\u7136\u540e\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p><span class=\"token comment\"># Example for eth0 interface<\/span><br \/>\nauto eth0<br \/>\niface eth0 inet static<br \/>\n    address <span class=\"token number\">192.168<\/span>.1.100      <span class=\"token comment\"># \u8bbe\u7f6e\u9759\u6001 IP \u5730\u5740<\/span><br \/>\n    netmask <span class=\"token number\">255.255<\/span>.255.0      <span class=\"token comment\"># \u8bbe\u7f6e\u5b50\u7f51\u63a9\u7801<\/span><br \/>\n    gateway <span class=\"token number\">192.168<\/span>.1.1        <span class=\"token comment\"># \u8bbe\u7f6e\u7f51\u5173<\/span><br \/>\n    dns-nameservers <span class=\"token number\">8.8<\/span>.8.8 <span class=\"token number\">8.8<\/span>.4.4  <span class=\"token comment\"># \u8bbe\u7f6e DNS \u670d\u52a1\u5668<\/span><\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u91cd\u542f\u7f51\u7edc\u670d\u52a1<\/h5>\n<p>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u540e&#xff0c;\u91cd\u542f\u7f51\u7edc\u670d\u52a1\u4ee5\u5e94\u7528\u914d\u7f6e&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl restart networking<\/p>\n<p>\u6216\u8005\u4f7f\u7528 ifdown \u548c ifup \u547d\u4ee4&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">ifdown<\/span> eth0 <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">ifup<\/span> eth0<\/p>\n<h5>\u6b65\u9aa4 4&#xff1a;\u9a8c\u8bc1\u7f51\u7edc\u914d\u7f6e<\/h5>\n<p>\u4f7f\u7528 ip a \u6216 ifconfig \u547d\u4ee4\u6765\u9a8c\u8bc1\u914d\u7f6e\u662f\u5426\u6b63\u786e\u5e94\u7528&#xff1a;<\/p>\n<p><span class=\"token function\">ip<\/span> a<\/p>\n<h4>3. \u4f7f\u7528 nmcli \u914d\u7f6e&#xff08;NetworkManager&#xff09;<\/h4>\n<p>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u684c\u9762\u7248 Ubuntu \u6216\u5b89\u88c5\u4e86 NetworkManager&#xff0c;\u4f60\u8fd8\u53ef\u4ee5\u901a\u8fc7 nmcli \u547d\u4ee4\u884c\u5de5\u5177\u6765\u914d\u7f6e\u7f51\u7edc\u3002<\/p>\n<h5>\u6b65\u9aa4 1&#xff1a;\u67e5\u770b\u73b0\u6709\u8fde\u63a5<\/h5>\n<p>\u9996\u5148&#xff0c;\u4f7f\u7528 nmcli \u67e5\u770b\u5f53\u524d\u7f51\u7edc\u8fde\u63a5\u540d\u79f0&#xff1a;<\/p>\n<p>nmcli con show<\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u4fee\u6539\u8fde\u63a5\u914d\u7f6e<\/h5>\n<p>\u5047\u8bbe\u4f60\u8981\u914d\u7f6e\u540d\u4e3a Wired connection 1 \u7684\u7f51\u7edc\u8fde\u63a5&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u8bbe\u7f6e\u9759\u6001 IP&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> nmcli con mod <span class=\"token string\">&#034;Wired connection 1&#034;<\/span> ipv4.addresses <span class=\"token number\">192.168<\/span>.1.100\/24<br \/>\n<span class=\"token function\">sudo<\/span> nmcli con mod <span class=\"token string\">&#034;Wired connection 1&#034;<\/span> ipv4.gateway <span class=\"token number\">192.168<\/span>.1.1<br \/>\n<span class=\"token function\">sudo<\/span> nmcli con mod <span class=\"token string\">&#034;Wired connection 1&#034;<\/span> ipv4.dns <span class=\"token string\">&#034;8.8.8.8 8.8.4.4&#034;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> nmcli con mod <span class=\"token string\">&#034;Wired connection 1&#034;<\/span> ipv4.method manual<\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u91cd\u65b0\u542f\u52a8\u8fde\u63a5<\/h5>\n<p><span class=\"token function\">sudo<\/span> nmcli con down <span class=\"token string\">&#034;Wired connection 1&#034;<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> nmcli con up <span class=\"token string\">&#034;Wired connection 1&#034;<\/span><\/p>\n<p>\u901a\u8fc7 nmcli \u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u7f51\u7edc\u914d\u7f6e&#xff0c;\u5c24\u5176\u662f\u5728\u4f7f\u7528 NetworkManager \u7ba1\u7406\u7f51\u7edc\u65f6\u3002<\/p>\n<h4>\u603b\u7ed3<\/h4>\n<ul>\n<li>\u5bf9\u4e8e\u73b0\u4ee3 Ubuntu \u7248\u672c&#xff08;17.10 \u53ca\u4ee5\u540e&#xff09;&#xff0c;\u63a8\u8350\u4f7f\u7528 netplan \u914d\u7f6e\u9759\u6001 IP\u3002<\/li>\n<li>\u5bf9\u4e8e\u8f83\u65e7\u7248\u672c\u7684 Ubuntu&#xff0c;\u4f7f\u7528 \/etc\/network\/interfaces \u914d\u7f6e\u3002<\/li>\n<li>\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 nmcli \u7ba1\u7406\u901a\u8fc7 NetworkManager \u7ba1\u7406\u7684\u8fde\u63a5\u3002<\/li>\n<\/ul>\n<p>\u8bbe\u7f6e\u5b8c\u6210\u540e&#xff0c;\u4f60\u53ef\u4ee5\u901a\u8fc7 ip a \u6216 ifconfig \u9a8c\u8bc1\u7f51\u7edc\u8bbe\u7f6e\u662f\u5426\u751f\u6548\u3002\u5982\u679c\u9047\u5230\u95ee\u9898&#xff0c;\u53ef\u4ee5\u67e5\u770b\u7f51\u7edc\u670d\u52a1\u7684\u65e5\u5fd7\u6216\u91cd\u542f\u670d\u52a1\u5668\u8fdb\u884c\u6392\u67e5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6.1k\u6b21\uff0c\u70b9\u8d5e34\u6b21\uff0c\u6536\u85cf35\u6b21\u3002\u5bf9\u4e8e\u73b0\u4ee3 Ubuntu \u7248\u672c\uff0817.10 \u53ca\u4ee5\u540e\uff09\uff0c\u63a8\u8350\u4f7f\u7528netplan\u914d\u7f6e\u9759\u6001 IP\u3002\u5bf9\u4e8e\u8f83\u65e7\u7248\u672c\u7684 Ubuntu\uff0c\u4f7f\u7528\u914d\u7f6e\u3002\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528nmcli\u7ba1\u7406\u901a\u8fc7 NetworkManager \u7ba1\u7406\u7684\u8fde\u63a5\u3002\u8bbe\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7ip a\u6216ifconfig\u9a8c\u8bc1\u7f51\u7edc\u8bbe\u7f6e\u662f\u5426\u751f\u6548\u3002\u5982\u679c\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u67e5\u770b\u7f51\u7edc\u670d\u52a1\u7684\u65e5\u5fd7\u6216\u91cd\u542f\u670d\u52a1\u5668\u8fdb\u884c\u6392\u67e5\u3002_ubuntu\u5b50\u7f51\u63a9\u7801\u586b\u5199<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[295,205,103,294,43,44],"topic":[],"class_list":["post-10149","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-tcp-ip","tag-ubuntu","tag-294","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/10149.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6.1k\u6b21\uff0c\u70b9\u8d5e34\u6b21\uff0c\u6536\u85cf35\u6b21\u3002\u5bf9\u4e8e\u73b0\u4ee3 Ubuntu \u7248\u672c\uff0817.10 \u53ca\u4ee5\u540e\uff09\uff0c\u63a8\u8350\u4f7f\u7528netplan\u914d\u7f6e\u9759\u6001 IP\u3002\u5bf9\u4e8e\u8f83\u65e7\u7248\u672c\u7684 Ubuntu\uff0c\u4f7f\u7528\u914d\u7f6e\u3002\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528nmcli\u7ba1\u7406\u901a\u8fc7 NetworkManager \u7ba1\u7406\u7684\u8fde\u63a5\u3002\u8bbe\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7ip a\u6216ifconfig\u9a8c\u8bc1\u7f51\u7edc\u8bbe\u7f6e\u662f\u5426\u751f\u6548\u3002\u5982\u679c\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u67e5\u770b\u7f51\u7edc\u670d\u52a1\u7684\u65e5\u5fd7\u6216\u91cd\u542f\u670d\u52a1\u5668\u8fdb\u884c\u6392\u67e5\u3002_ubuntu\u5b50\u7f51\u63a9\u7801\u586b\u5199\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/10149.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T09:53:19+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10149.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/10149.html\",\"name\":\"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T09:53:19+00:00\",\"dateModified\":\"2025-04-18T09:53:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/10149.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/10149.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10149.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/10149.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6.1k\u6b21\uff0c\u70b9\u8d5e34\u6b21\uff0c\u6536\u85cf35\u6b21\u3002\u5bf9\u4e8e\u73b0\u4ee3 Ubuntu \u7248\u672c\uff0817.10 \u53ca\u4ee5\u540e\uff09\uff0c\u63a8\u8350\u4f7f\u7528netplan\u914d\u7f6e\u9759\u6001 IP\u3002\u5bf9\u4e8e\u8f83\u65e7\u7248\u672c\u7684 Ubuntu\uff0c\u4f7f\u7528\u914d\u7f6e\u3002\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528nmcli\u7ba1\u7406\u901a\u8fc7 NetworkManager \u7ba1\u7406\u7684\u8fde\u63a5\u3002\u8bbe\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7ip a\u6216ifconfig\u9a8c\u8bc1\u7f51\u7edc\u8bbe\u7f6e\u662f\u5426\u751f\u6548\u3002\u5982\u679c\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u67e5\u770b\u7f51\u7edc\u670d\u52a1\u7684\u65e5\u5fd7\u6216\u91cd\u542f\u670d\u52a1\u5668\u8fdb\u884c\u6392\u67e5\u3002_ubuntu\u5b50\u7f51\u63a9\u7801\u586b\u5199","og_url":"https:\/\/www.wsisp.com\/helps\/10149.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T09:53:19+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/10149.html","url":"https:\/\/www.wsisp.com\/helps\/10149.html","name":"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T09:53:19+00:00","dateModified":"2025-04-18T09:53:19+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/10149.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/10149.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/10149.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u624b\u52a8\u8bbe\u7f6eubuntu\u670d\u52a1\u5668\u7684ip\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=10149"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10149\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=10149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=10149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=10149"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=10149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}