{"id":63463,"date":"2025-04-29T15:52:27","date_gmt":"2025-04-29T07:52:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63463\/"},"modified":"2025-04-29T15:52:27","modified_gmt":"2025-04-29T07:52:27","slug":"centos7%e9%85%8d%e7%bd%aeip%e5%9c%b0%e5%9d%80%e6%80%8e%e4%b9%88%e4%bf%9d%e5%ad%98-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63463\/","title":{"rendered":"centos7\u914d\u7f6eip\u5730\u5740\u600e\u4e48\u4fdd\u5b58"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u4fdd\u5b58 centos 7 \u4e2d\u7684 ip \u5730\u5740\u914d\u7f6e\uff1a\u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6 \/etc\/sysconfig\/network-scripts\/ifcfg-eth0\uff0c\u5176\u4e2d eth0 \u662f\u7f51\u7edc\u63a5\u53e3\u7684\u540d\u79f0\u3002\u4fee\u6539 ip \u5730\u5740\u3001\u5b50\u7f51\u63a9\u7801\u548c\u9ed8\u8ba4\u7f51\u5173\u7b49\u914d\u7f6e\u3002\u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6\u3002\u8fd0\u884c\u547d\u4ee4 systemctl restart network \u91cd\u542f\u7f51\u7edc\u670d\u52a1\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/07\/2024040719452047608.jpg\" class=\"aligncenter\" title=\"centos7\u914d\u7f6eip\u5730\u5740\u600e\u4e48\u4fdd\u5b58\u63d2\u56fe\" alt=\"centos7\u914d\u7f6eip\u5730\u5740\u600e\u4e48\u4fdd\u5b58\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4fdd\u5b58 CentOS 7 \u4e2d\u7684 IP \u5730\u5740\u914d\u7f6e\uff1f<\/strong><\/p>\n<p>\u5728 CentOS 7 \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\u5e76\u91cd\u542f\u7f51\u7edc\u670d\u52a1\u6765\u4fdd\u5b58 IP \u5730\u5740\u914d\u7f6e\u3002<\/p>\n<p><strong>\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982 nano \u6216 vim\uff09\u6253\u5f00\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6 \/etc\/sysconfig\/network-scripts\/ifcfg-eth0\u3002\u5176\u4e2d eth0 \u662f\u7f51\u7edc\u63a5\u53e3\u7684\u540d\u79f0\uff0c\u8bf7\u6839\u636e\u9700\u8981\u8fdb\u884c\u8c03\u6574\u3002<\/li>\n<li>\n<p>\u5b9a\u4f4d\u5230\u4ee5\u4e0b\u884c\u5e76\u8fdb\u884c\u4fee\u6539\uff1a<\/p>\n<ul>\n<li>IPADDR=192.168.1.10\uff08\u5c06\u6b64\u66ff\u6362\u4e3a\u6240\u9700\u7684 IP \u5730\u5740\uff09<\/li>\n<li>NETMASK=255.255.255.0\uff08\u5c06\u6b64\u66ff\u6362\u4e3a\u6240\u9700\u7684\u63a9\u7801\uff09<\/li>\n<li>GATEWAY=192.168.1.1\uff08\u5c06\u6b64\u66ff\u6362\u4e3a\u9ed8\u8ba4\u7f51\u5173\u7684 IP \u5730\u5740\uff0c\u5982\u679c\u9700\u8981\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u6309 Ctrl + O \u4fdd\u5b58\u66f4\u6539\u5e76\u6309 Enter \u9000\u51fa\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u91cd\u542f\u7f51\u7edc\u670d\u52a1\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u91cd\u542f\u7f51\u7edc\u670d\u52a1\uff1a<\/p>\n<ul>\n<li>systemctl restart network<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u73b0\u5728\uff0cIP \u5730\u5740\u914d\u7f6e\u5df2\u6c38\u4e45\u4fdd\u5b58\u3002\u4e0b\u6b21\u542f\u52a8\u8ba1\u7b97\u673a\u65f6\uff0c\u5b83\u5c06\u4f7f\u7528\u66f4\u65b0\u540e\u7684\u914d\u7f6e\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f7\u914d\u7f6eip\u5730\u5740\u600e\u4e48\u4fdd\u5b58\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>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u4fdd\u5b58 centos 7 \u4e2d\u7684 ip \u5730\u5740\u914d\u7f6e\uff1a\u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6 \/etc\/sysconfig\/network-scripts\/ifcfg-eth0\uff0c\u5176\u4e2d eth0 \u662f\u7f51\u7edc\u63a5\u53e3\u7684\u540d\u79f0\u3002\u4fee\u6539 ip \u5730\u5740\u3001\u5b50\u7f51\u63a9\u7801\u548c\u9ed8\u8ba4\u7f51\u5173\u7b49\u914d\u7f6e\u3002\u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6\u3002\u8fd0\u884c\u547d\u4ee4 systemctl restart network \u91cd\u542f\u7f51\u7edc\u670d\u52a1\u3002 \u5982\u4f55\u4fdd\u5b58 CentOS 7 \u4e2d\u7684 IP \u5730\u5740\u914d\u7f6e\uff1f \u5728 CentOS 7 \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\u5e76\u91cd\u542f\u7f51\u7edc\u670d\u52a1\u6765\u4fdd\u5b58 IP \u5730\u5740\u914d\u7f6e\u3002 \u8be6\u7ec6\u6b65\u9aa4\uff1a \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\uff1a \u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982 nano \u6216 vim\uff09\u6253\u5f00\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6 \/etc\/sysconfig\/network-scripts\/ifcfg-eth0\u3002\u5176\u4e2d eth0 \u662f\u7f51\u7edc\u63a5\u53e3\u7684\u540d\u79f0\uff0c\u8bf7\u6839\u636e\u9700\u8981\u8fdb\u884c\u8c03\u6574\u3002 \u5b9a\u4f4d\u5230\u4ee5\u4e0b\u884c\u5e76\u8fdb\u884c\u4fee\u6539\uff1a IPADDR=192.168.1.10\uff08\u5c06\u6b64\u66ff\u6362\u4e3a\u6240\u9700\u7684 IP \u5730\u5740\uff09 NETMASK=255.255.255.0\uff08\u5c06\u6b64\u66ff\u6362\u4e3a\u6240\u9700\u7684\u63a9\u7801\uff09 GATEWAY=192.168.1.1\uff08\u5c06\u6b64\u66ff\u6362\u4e3a\u9ed8\u8ba4\u7f51\u5173\u7684 IP \u5730\u5740\uff0c\u5982\u679c\u9700\u8981\uff09 \u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6\uff1a \u6309 Ctrl + O \u4fdd\u5b58\u66f4\u6539\u5e76\u6309 Enter \u9000\u51fa\u3002 \u91cd\u542f\u7f51\u7edc\u670d\u52a1\uff1a \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u91cd\u542f\u7f51\u7edc\u670d\u52a1\uff1a systemctl [&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-63463","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63463","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=63463"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63463\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}