{"id":317135,"date":"2021-02-04T22:38:08","date_gmt":"2021-02-04T14:38:08","guid":{"rendered":"http:\/\/4563.org\/?p=317135"},"modified":"2021-02-04T22:38:08","modified_gmt":"2021-02-04T14:38:08","slug":"%e4%b8%80%e4%b8%aa%e5%a3%b0%e6%98%8e%e5%bc%8f%e7%ae%a1%e7%90%86-linux-%e7%bd%91%e7%bb%9c%e7%9a%84%e5%b7%a5%e5%85%b7%ef%bc%8c%e6%8f%90%e4%be%9b-python-%e5%92%8c-cli-%e6%8e%a5%e5%8f%a3%ef%bc%8c%e6%ac%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=317135","title":{"rendered":"\u4e00\u4e2a\u58f0\u660e\u5f0f\u7ba1\u7406 Linux \u7f51\u7edc\u7684\u5de5\u5177\uff0c\u63d0\u4f9b Python \u548c cli \u63a5\u53e3\uff0c\u6b22\u8fce\u62cd\u7816\u3001\u53c2\u4e0e"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e00\u4e2a\u58f0\u660e\u5f0f\u7ba1\u7406 Linux \u7f51\u7edc\u7684\u5de5\u5177\uff0c\u63d0\u4f9b Python \u548c cli \u63a5\u53e3\uff0c\u6b22\u8fce\u62cd\u7816\u3001\u53c2\u4e0e               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : smyle <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        Red Hat \u65b0\u5f00\u53d1\u7684\u7f51\u7edc\u7ba1\u7406\u5de5\u5177(\u76ee\u524d\u8fd8\u5904\u4e8e\u6280\u672f\u9884\u89c8\u9636\u6bb5\uff0c\u8fd8\u6709\u5f88\u591a\u529f\u80fd\u6b63\u5728\u6dfb\u52a0\u4e2d\uff09\uff0c\u65e8\u5728\u7ed9\u865a\u62df\u5316\u96c6\u7fa4\u3001\u5bb9\u5668\u7b49\u63d0\u4f9b\u4e00\u81f4\u7684\u3001\u58f0\u660e\u5f0f\u7684\u7f51\u7edc\u7ba1\u7406\u63a5\u53e3\uff1a\u53ea\u9700\u8981\u544a\u8bc9 host \u4f60\u9700\u8981\u4ec0\u4e48\u6837\u7684 network state\uff0c\u4e0d\u7528\u64cd\u5fc3\u600e\u4e48\u53bb\u5b9e\u73b0\u3002\u5f53\u7136\u4e86\uff0c\u5728\u5355\u673a\u4e0a\u4e5f\u662f\u80fd\u5de5\u4f5c\u7684\u3002<\/p>\n<p>\u9879\u76ee\u5730\u5740\uff1a<br \/>http:\/\/github.com\/nmstate\/nmstate<\/p>\n<p>\u76ee\u524d\u4e3b\u8981\u652f\u6301\uff1a<br \/>* \u7f51\u7edc\u63a5\u53e3\uff08\u7f51\u5361\uff09\u7684\u5927\u90e8\u5206\u914d\u7f6e\uff0c\u652f\u6301\u5927\u90e8\u5206\u63a5\u53e3\u7c7b\u578b(bond,team,bridge,veth,infiniband,vlan,vxlan \u7b49\u7b49)<br \/>* DNS<br \/>* \u8def\u7531\u8868<br \/>* \u7b56\u7565\u8def\u7531<br \/>* openvswitch \u57fa\u7840\u529f\u80fd<br \/>* \u5141\u8bb8\u8bd5\u63a2\u6027\u914d\u7f6e\uff0c\u8d85\u65f6\u540e\u56de\u6eda(\u6bd4\u5982\uff0c\u9632\u6b62\u8fdc\u7a0b\u64cd\u4f5c\u65f6\uff0c\u914d\u9519\u4e86\u5bfc\u81f4\u65e0\u6cd5\u8fdc\u7a0b\u8bbf\u95ee\u7b49\u60c5\u51b5)<\/p>\n<p>\u9700\u8981\u8fd0\u884c NetworkManager<br \/>\u53ef\u4ee5\u7528 python \u4e5f\u53ef\u4ee5\u7528\u547d\u4ee4\u884c\u5de5\u5177 nmstatectl<\/p>\n<p>\u867d\u7136\u7f51\u7edc\u8fd9\u79cd\u57fa\u7840\u8bbe\u65bd\uff0c\u5927\u90e8\u5206\u4eba\u5e94\u8be5\u662f\u80fd\u901a\u5c31\u5b8c\u4e8b\u4e86\uff0c\u914d\u7f6e\u4e00\u6b21\u4e4b\u540e\u5c31\u4e0d\u4f1a\u518d\u53bb\u6298\u817e\u5b83\u3002\u4e0d\u8fc7\uff0c\u81f3\u5c11\u5bf9\u9700\u8981\u7ba1\u7406 N \u53f0\u8bbe\u5907\u7684\u8fd0\u7ef4\u5e94\u8be5\u6bd4\u8f83\u6709\u7528\u3002\u4e5f\u6709 ansible\/k8s \u7684\u9879\u76ee\uff0c\u53ef\u4ee5\u770b\u8be5\u8d26\u53f7\u4e0b\u7684\u5176\u4ed6 repo \u3002<\/p>\n<p>\u53e6\u5916\uff0c\u4e25\u91cd\u6b22\u8fce\u5410\u69fd\u3001\u63d0\u5efa\u8bae\u3001\u63d0 issue \u3001\u8d21\u732e PR \u54c8\uff01\u6bd5\u7adf\u662f\u4e2a\u51c6\u65b0\u9879\u76ee\uff0c\u8c03\u6574\u8d77\u6765\u76f8\u5bf9\u5bb9\u6613\uff0c\u5e0c\u671b\u4e00\u6b21\u6027\u628a\u5b83\u505a\u5f97\u8db3\u591f\u597d\u7528\u3001user friendly \u3002<\/p>\n<p>\u4e5f\u53ef\u4ee5\u53d1 E: mshi # redhat.com      <\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>10<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5193408\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zouri <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u76ee\u524d\u90fd\u7528\u516c\u6709\u4e91\u7684\u8bdd\uff0c\u7f51\u7edc\u8c8c\u4f3c\u4e0d\u7528\u5f88\u64cd\u5fc3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193409\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wengych <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u652f\u6301 openvswitch \u6bd4\u8f83\u8d5e\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193410\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tkl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9700\u8981\u8fd0\u884c NetworkManager <\/p>\n<p>\u8fd9\u73a9\u610f\u5728 Server \u4e0a\u90fd\u662f\u5173\u6389\u7684\u5427                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193411\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : smyle <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tkl <br \/>\u786e\u5b9e\uff0c\u5370\u8c61\u91cc\uff0c\u4e00\u822c\u5404\u79cd\u6587\u7ae0\u7b2c\u4e00\u6b65\u4e5f\u662f\u5148\u5173\u6389 networkmanager\u2026\u2026 \u4e0d\u8fc7\u5c31\u6211\u63a5\u89e6\u4e4b\u540e\uff0c\u611f\u89c9 networkmanager \u547d\u4ee4\u884c\u5de5\u5177 nmcli \u5df2\u7ecf\u5f88\u597d\u7528\u4e86\uff0c\u88c5\u4e0a bash-completion \u4e4b\u540e\u5168\u90e8\u53c2\u6570\u90fd\u8f7b\u677e\u8865\u5168\u3002\u4e3b\u8981\u8fd8\u662f\u4f20\u7edf\u65b9\u6cd5\u591f\u7528\u3001\u6ca1\u6709\u52a8\u529b\u53bb\u5b66\u4e00\u4e2a\u65b0\u73a9\u610f\u513f\u5427<br \/>\u53e6\u5916\uff0c\u4ece RHEL8 \u5f00\u59cb\uff0c\u9ed8\u8ba4\u7684\u7f51\u7edc\u5de5\u5177\u5c31\u662f networkmanager\uff0cnetwork-script \u53ea\u5728 repo \u91cc\u63d0\u4f9b\uff0c\u800c RHEL9 \u751a\u81f3\u6709\u53ef\u80fd\u4e0d\u518d\u63d0\u4f9b network-script \u5de5\u5177<br \/>\u5f53\u7136 systemd \u91cc\u597d\u50cf\u4e5f\u6709\u4e00\u5957\u7f51\u7edc\u7ec4\u4ef6\uff0c\u6ca1\u592a\u5173\u6ce8\u8fc7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193412\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : smyle <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zouri \u5bf9\u4e8e\u5e94\u7528\u5c42\u9762\u7684\u7528\u6237\u800c\u8a00\uff0c\u786e\u5b9e\u6ca1\u592a\u5927\u5b58\u5728\u611f\uff0c\u751a\u81f3\u7f51\u7edc\u90fd\u662f\u4e91\u63d0\u4f9b\u5546\u7ed9\u4f60\u7ef4\u62a4\u597d\u7684\u3002\u4e0d\u8fc7\u7ea2\u5e3d\u672c\u8eab\u4e5f\u505a RHV \u865a\u62df\u5316\u3001openshift \u5bb9\u5668\u8fd9\u7c7b\u4ea7\u54c1\uff0c\u4e3b\u8981\u9762\u5411\u7684\u5c06\u4f1a\u662f\u642d\u5efa\u3001\u7ef4\u62a4\u5e73\u53f0\u7684\u8fd9\u90e8\u5206\u5ba2\u6237\uff08\u4ee5\u53ca\u8fd0\u7ef4\uff0c\u54c8\u54c8\uff09\uff1a\u4e00\u79cd\u662f\u6709\u94b1\u52bf\u529b\u7684 100%\u81ea\u5efa\u5e73\u53f0\uff0c\u4e00\u79cd\u662f\u6df7\u5408\u4e91\uff08\u4e1a\u52a1\u6570\u636e\u4e0a\u516c\u4e91\uff0c\u79c1\u5bc6\u6570\u636e\u81ea\u5efa\u5e73\u53f0\uff0c\u901a\u8fc7\u7ea2\u5e3d\u7684\u7edf\u4e00 API \u6765\u5c4f\u853d\u516c\u79c1\u4e4b\u95f4\u3001\u4e0d\u540c\u516c\u5171\u4e91\u4e4b\u95f4\u7684\u5dee\u5f02\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193413\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : smyle <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wengych \u73b0\u5728\u652f\u6301 ovs \u51e0\u79cd port \u7684\u7b80\u5355\u914d\u7f6e\u4ee5\u53ca ovsdb \u7684\u90e8\u5206\u8868<br \/>\u6839\u636e\u4e1a\u52a1\u9700\u8981\u548c\u5ba2\u6237\u53cd\u9988\u6301\u7eed\u589e\u52a0\u65b0\u529f\u80fd\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193414\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ayasakinagi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u662f\u61d2\u5f97\u5b66\u4e60 nmcli, iproute2 \u633a\u597d\u7528\u7684, \u6bcf\u4e00\u6b65\u5e72\u4e86\u5565\u6bd4\u8f83\u6e05\u695a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193415\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : huangmingyou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ubuntu 20.04 \u597d\u50cf\u5df2\u7ecf\u662f\u58f0\u660e\u5f0f\u7684\u4e86, https:\/\/netplan.io\/<br \/>Netplan is a utility for easily configuring networking on a linux system. You simply create a YAML description of the required network interfaces and what each should be configured to do. From this description Netplan will generate all the necessary configuration for your chosen renderer tool.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193416\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : smyle <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ayasakinagi \u5176\u5b9e man nmcli-examples \u5c31\u6709\u5f88\u5e38\u7528\u7684\u793a\u4f8b<br \/>iproute2 \u786e\u5b9e\u8fd0\u884c\u4e2d\u914d\u7f6e\u5f88\u597d\u7528\uff0c\u53ea\u4e0d\u8fc7\u91cd\u542f\u540e\u4e0d\u4fdd\u7559\u72b6\u6001\uff0c\u5f53\u7136\u53ef\u4ee5\u901a\u8fc7\u542f\u52a8\u811a\u672c\u89e3\u51b3\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5193417\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : smyle <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @huangmingyou \u5b64\u964b\u5be1\u95fb\u4e86\u2026\u2026 \u6211\u53bb\u7785\u7785                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a\u58f0\u660e\u5f0f\u7ba1\u7406 Linux \u7f51\u7edc\u7684&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/317135"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=317135"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/317135\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317135"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}