{"id":214284,"date":"2021-03-31T08:18:34","date_gmt":"2021-03-31T00:18:34","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=214284"},"modified":"2021-03-22T10:19:00","modified_gmt":"2021-03-22T02:19:00","slug":"network-configuration-dns","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/network-configuration-dns.html","title":{"rendered":"RHEL8&CentOS8\u914d\u7f6eIP\u5730\u5740\u548cDNS"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u672c\u6587\u4e3b\u8981\u8bb2\u89e3\u5982\u4f55\u91cd\u542fRHEL 8\u6216\u8005CentOS 8\u7f51\u7edc\u4ee5\u53ca\u5982\u4f55\u89e3\u51b3RHEL8\u548cCentOS8\u7cfb\u7edf\u7684\u7f51\u7edc\u7ba1\u7406\u670d\u52a1\u62a5\u9519<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

1\u3001redhat8\u7cfb\u5217\u5b98\u65b9\u4f7f\u7528nmclit\u8fdb\u884cIP\u5730\u5740\u4fee\u6539\u548c\u914d\u7f6e\uff1a<\/strong><\/div>\n

\u5c06network\u505c\u6b62\u5e76\u7981\u6b62\uff1a<\/p>\n

systemctl stop network\r\nsystemctl mask network<\/pre>\n

\u5e76\u542f\u7528NetworkManager:<\/p>\n

systemctl start NetworkManager\r\nsystemctl enable NetworkManager<\/pre>\n
mcli connection modify ens33\uff08\u7f51\u5361\u540d\uff09 ipv4.addresses 172.16.30.100\/24 ipv4.gateway 172.16.30.1 ipv4.dns 172.16.30.243 connection.autoconnect yes(\u81ea\u52a8\u8fde\u63a5) ipv4.method manual\uff08\u624b\u52a8\u914d\u7f6e\uff09\r\n\r\nmcli connection modify ens33\uff08\u7f51\u5361\u540d\uff09 connection.autoconnect no(\u4e0d\u81ea\u52a8\u8fde\u63a5) ipv4.method auto\uff08\u81ea\u52a8\u83b7\u53d6\uff09\r\n\r\nnmclit connection down ens33\uff08\u7f51\u5361\u540d\u79f0\uff09\r\nnmclit connection up ens33\uff08\u7f51\u5361\u540d\u79f0\uff09\r\nsystemctl restart NetworkManager ###\u91cd\u542f\u670d\u52a1<\/pre>\n
2\u3001\u67e5\u770b\u7f51\u5361\u786c\u4ef6\u8bbe\u5907<\/strong><\/div>\n
nmclit device show ###\u67e5\u770b\u786c\u4ef6\u8bbe\u5907\r\n\r\nnmcli connection delete ens33 ###\u5220\u9664\u7f51\u5361\u914d\u7f6e\r\n\r\nnmcli connection add type ethernet con-name enss33 ifname ens33 connection.autoconnect yes\r\n\u521b\u5efa\u7f51\u5361\u7c7b\u578b\u4e3a\u4ee5\u592a\u7f51\uff0c\u540d\u5b57\u53ebenss33\uff0c\u5339\u914d\u786c\u4ef6\u7f51\u5361ens33\uff0c\u5e76\u81ea\u52a8\u8fde\u63a5\r\n\r\n\u914d\u7f6eDNS\uff1avi \/etc\/resolv.conf\r\n\u5047\u5982nameserver 202.96.104.17\r\n\r\n\u4fee\u6539\u4e3b\u673a\u540d\uff1ahostnamectl set-hostname JT-XX-040\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u5c06network\u505c\u6b62\u5e76\u7981\u6b62\uff1a systemctl stop network systemctl mask ne […]<\/p>\n","protected":false},"author":1469,"featured_media":135935,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-214284","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\/214284","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\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=214284"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/214284\/revisions"}],"predecessor-version":[{"id":214287,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/214284\/revisions\/214287"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/135935"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=214284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=214284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=214284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}