{"id":63481,"date":"2025-04-29T12:03:20","date_gmt":"2025-04-29T04:03:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63481\/"},"modified":"2025-04-29T12:03:20","modified_gmt":"2025-04-29T04:03:20","slug":"centos7%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%aeip-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63481\/","title":{"rendered":"centos7\u600e\u4e48\u8bbe\u7f6eip"},"content":{"rendered":"<blockquote><p>\n  centos 7 \u4e2d\u914d\u7f6e ip \u5730\u5740\u7684\u65b9\u6cd5\uff1a1. \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\uff1b2. \u8bbe\u7f6e ip \u5730\u5740\u548c\u7f51\u7edc\u63a9\u7801\uff1b3. \u8bbe\u7f6e\u7f51\u5173\uff08\u53ef\u9009\uff09\uff1b4. \u542f\u7528\u7f51\u7edc\u670d\u52a1\uff1b5. \u9a8c\u8bc1 ip \u5730\u5740\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/07\/2024040721062433061.jpg\" class=\"aligncenter\" title=\"centos7\u600e\u4e48\u8bbe\u7f6eip\u63d2\u56fe\" alt=\"centos7\u600e\u4e48\u8bbe\u7f6eip\u63d2\u56fe\" \/><\/p>\n<h2>CentOS 7 \u4e2d\u5982\u4f55\u914d\u7f6e IP \u5730\u5740<\/h2>\n<p>\u8981\u914d\u7f6e CentOS 7 \u4e2d\u7684 IP \u5730\u5740\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<h3>1. \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6<\/h3>\n<pre>vi \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>2. \u8bbe\u7f6e IP \u5730\u5740\u548c\u7f51\u7edc\u63a9\u7801<\/h3>\n<pre>IPADDR=192.168.0.20\nNETMASK=255.255.255.0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>3. \u8bbe\u7f6e\u7f51\u5173 (\u53ef\u9009)<\/h3>\n<p>\u5982\u679c\u60a8\u9700\u8981\u901a\u8fc7\u7f51\u5173\u8bbf\u95ee\u5176\u4ed6\u7f51\u7edc\uff0c\u8bf7\u8bbe\u7f6e\u7f51\u5173\uff1a<\/p>\n<pre>GATEWAY=192.168.0.1<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>4. \u542f\u7528\u7f51\u7edc\u670d\u52a1<\/h3>\n<pre>systemctl start network<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>5. \u9a8c\u8bc1 IP \u5730\u5740<\/h3>\n<p>\u8981\u9a8c\u8bc1 IP \u5730\u5740\u662f\u5426\u5df2\u6b63\u786e\u914d\u7f6e\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>ifconfig eth0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u60a8\u5e94\u8be5\u4f1a\u770b\u5230\u5982\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre>eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500\n        inet 192.168.0.20  netmask 255.255.255.0  broadcast 192.168.0.255\n        inet6 fe80::20c:29ff:fe4f:f2b2  prefixlen 64  scopeid 0x20&lt;link&gt;\n        ether 00:0c:29:4f:f2:b2  txqueuelen 1000  (Ethernet)\n        RX packets 321  bytes 31134 (30.2 KiB)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 292  bytes 31329 (30.5 KiB)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d inet 192.168.0.20 \u8868\u793a\u5df2\u5206\u914d\u7684 IP \u5730\u5740\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f7\u600e\u4e48\u8bbe\u7f6eip\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>centos 7 \u4e2d\u914d\u7f6e ip \u5730\u5740\u7684\u65b9\u6cd5\uff1a1. \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\uff1b2. \u8bbe\u7f6e ip \u5730\u5740\u548c\u7f51\u7edc\u63a9\u7801\uff1b3. \u8bbe\u7f6e\u7f51\u5173\uff08\u53ef\u9009\uff09\uff1b4. \u542f\u7528\u7f51\u7edc\u670d\u52a1\uff1b5. \u9a8c\u8bc1 ip \u5730\u5740\u3002 CentOS 7 \u4e2d\u5982\u4f55\u914d\u7f6e IP \u5730\u5740 \u8981\u914d\u7f6e CentOS 7 \u4e2d\u7684 IP \u5730\u5740\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6 vi \/etc\/sysconfig\/network-scripts\/ifcfg-eth0 \u767b\u5f55\u540e\u590d\u5236 2. \u8bbe\u7f6e IP \u5730\u5740\u548c\u7f51\u7edc\u63a9\u7801 IPADDR=192.168.0.20 NETMASK=255.255.255.0 \u767b\u5f55\u540e\u590d\u5236 3. \u8bbe\u7f6e\u7f51\u5173 (\u53ef\u9009) \u5982\u679c\u60a8\u9700\u8981\u901a\u8fc7\u7f51\u5173\u8bbf\u95ee\u5176\u4ed6\u7f51\u7edc\uff0c\u8bf7\u8bbe\u7f6e\u7f51\u5173\uff1a GATEWAY=192.168.0.1 \u767b\u5f55\u540e\u590d\u5236 4. \u542f\u7528\u7f51\u7edc\u670d\u52a1 systemctl start network \u767b\u5f55\u540e\u590d\u5236 5. \u9a8c\u8bc1 IP \u5730\u5740 \u8981\u9a8c\u8bc1 IP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-63481","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=63481"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63481\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}