{"id":135011,"date":"2019-01-29T10:21:13","date_gmt":"2019-01-29T02:21:13","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=135011"},"modified":"2019-01-28T09:22:51","modified_gmt":"2019-01-28T01:22:51","slug":"centos7-net-set","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos7-net-set.html","title":{"rendered":"\u5982\u4f55\u5728Centos7\u8fdb\u884c\u7f51\u7edc\u914d\u7f6e"},"content":{"rendered":"

\u73a9centos7\u6709\u4e00\u6bb5\u65f6\u95f4\u4e86\uff0c\u57fa\u672c\u4e0a\u9002\u5e94\u4e86\u3002\u4e0d\u8fc7\u6211\u8fd8\u662f\u8981\u5410\u69fd\u4e00\u4e0b\uff0c\u542f\u52a8\u7ba1\u7406\u53d8\u4e86\uff0cinit.d\u6ca1\u4e1c\u897f\u4e86\uff0cifconfig\u6ca1\u6709\u4e86\uff0c\u9632\u706b\u5899\u4e5f\u6539\u53d8\u4e86\u7b49\u7b49\u3002<\/p>\n

1\u3001\u672c\u4eba\u4e0d\u592a\u559c\u6b22\u7528NetworkManager\u8fd9\u4e2a\u4e1c\u897f<\/strong><\/div>\n
#\u00a0systemctl\u00a0stop\u00a0NetworkManager.service\r\n#\u00a0systemctl\u00a0disable\u00a0NetworkManager.service<\/pre>\n
2\u3001\u4fee\u6539\u7f51\u7edc\u914d\u7f6e<\/strong><\/div>\n
#\u00a0vi\u00a0\/etc\/sysconfig\/network-scripts\/ifcfg-ens3\r\nNM_CONTROLLED=no\u00a0\/\/\u539f\u6765\u6ca1\u6709\u52a0\u4e0a\u7684\r\nTYPE=Ethernet\r\nBOOTPROTO=static\u00a0\/\/dhcp\u6539\u6210static\r\nDEFROUTE=yes\r\nPEERDNS=yes\r\nPEERROUTES=yes\r\nIPV4_FAILURE_FATAL=yes\u00a0\/\/no\u6539\u6210yes\r\nIPV6INIT=yes\r\nIPV6_AUTOCONF=yes\r\nIPV6_DEFROUTE=yes\r\nIPV6_PEERDNS=yes\r\nIPV6_PEERROUTES=yes\r\nIPV6_FAILURE_FATAL=no\r\nIPV6_ADDR_GEN_MODE=stable-privacy\r\nNAME=ens3\r\nUUID=851ae637-14d4-4435-9c38-d3a3e4c2f0c3\r\nDEVICE=ens3\r\nIPADDR=192.168.5.214\u00a0\/\/\u65b0\u52a0\u4e0a\u7684\r\nNETMASK=255.255.255.0\u00a0\/\/\u65b0\u52a0\u4e0a\u7684\r\nGATEWAY=192.168.5.2\u00a0\/\/\u65b0\u52a0\u4e0a\u7684\r\nONBOOT=yes\u00a0\/\/no\u6539\u6210yes<\/pre>\n
3\u3001\u91cd\u542f\u7f51\u7edc<\/strong><\/div>\n
#\u00a0service\u00a0network\u00a0restart<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u73a9centos7\u6709\u4e00\u6bb5\u65f6\u95f4\u4e86\uff0c\u57fa\u672c\u4e0a\u9002\u5e94\u4e86\u3002\u4e0d\u8fc7\u6211\u8fd8\u662f\u8981\u5410\u69fd\u4e00\u4e0b\uff0c\u542f\u52a8\u7ba1\u7406\u53d8\u4e86\uff0cinit.d\u6ca1\u4e1c\u897f\u4e86\uff0cifco […]<\/p>\n","protected":false},"author":63,"featured_media":135194,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-135011","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/135011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=135011"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/135011\/revisions"}],"predecessor-version":[{"id":135301,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/135011\/revisions\/135301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/135194"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=135011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=135011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=135011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}