{"id":282,"date":"2021-01-11T18:32:40","date_gmt":"2021-01-11T10:32:40","guid":{"rendered":"https:\/\/830519.xyz\/?p=282"},"modified":"2021-01-11T18:32:40","modified_gmt":"2021-01-11T10:32:40","slug":"ubuntu","status":"publish","type":"post","link":"https:\/\/830519.xyz\/?p=282","title":{"rendered":"Ubuntu"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>tzselect   #\u8bbe\u7f6e\u65f6\u95f4\nsudo ln -sf \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime   #\u521b\u5efa\u65f6\u533a\u8f6f\u94fe\ntimedatectl status   #\u67e5\u770b\u65f6\u95f4<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>#Ubuntu 18.04\u4f7f\u7528netplan\u914d\u7f6e\u7f51\u7edc<\/strong>\nsudo vim \/etc\/netplan\/00-installer-config.yaml\n\n# This is the network config written by 'subiquity'\nnetwork:\n  ethernets:\n    eth0:\n      addresses:\n      - 192.168.0.20\/24\n      gateway4: 192.168.0.10\n      nameservers:\n        addresses:\n        - 192.168.0.8\n  version: 2\n\nsudo netplan apply\n   #\u91cd\u542f\nip addr list  #\u67e5\u770b <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>#\u4f7f\u7528ifupdown\u914d\u7f6e\u7f51\u7edc<\/strong>\nsudo apt install ifupdown #\u5b89\u88c5ifupdown\n\nifconfig   #\u67e5\u770bIP\nnetstat -rn \u6216 route -n   #\u67e5\u770b\u7f51\u5173\ncat \/etc\/resolv.conf   #\u67e5\u770bDNS\n\n<strong>#\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/strong>\nsudo vim \/etc\/network\/interfaces\n\niface ens160 inet static\naddress 192.168.0.20\ngateway 192.168.0.10\nnetmask 255.255.255.0\ndns-nameservers 192.168.0.8\n\nsudo services network restrart   #\u91cd\u542f\u7f51\u7edc\u670d\u52a1\u4f7f\u914d\u7f6e\u751f\u6548\n\n<strong>#\u4fee\u6539DNS<\/strong>\nsudo vim \/etc\/resolv.conf\n\nsudo \/etc\/init.d\/resolvconf restart #\u91cd\u542f\u670d\u52a1\u4f7fDNS\u751f\u6548<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/830519.xyz\/index.php?rest_route=\/wp\/v2\/posts\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/830519.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/830519.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/830519.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/830519.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282"}],"version-history":[{"count":0,"href":"https:\/\/830519.xyz\/index.php?rest_route=\/wp\/v2\/posts\/282\/revisions"}],"wp:attachment":[{"href":"https:\/\/830519.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/830519.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/830519.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}