# This file contains a netplan-compatible configuration which cloud-init will # apply on first-boot (note: it will *not* update the config after the first # boot). Please refer to the cloud-init documentation and the netplan reference # for full details: # # https://netplan.io/reference # https://cloudinit.readthedocs.io/en/latest/topics/network-config.html # https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html # ...
# Some additional examples are commented out below
# This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: ens2: dhcp4: yes
netplan: netplan version 2.2 starting at Tue Oct 13 22:54:14 2020 netplan: database directory is /var/lib/plan/netplan.dir netplan: user "netplan" is uid 63434 gid 63434 netplan: switching from user <root> to <uid 63434 gid 63434> netplan: running with uid=63434 gid=63434 euid=63434 egid=63434 netplan: reading access list file /var/lib/plan/netplan.dir/.netplan-acl netplan: netplan/tcp not found in /etc/services, using ports 2983 and 5444
仔细检查了 systemctl status netplan ,发现原因了:没有激活netplan daemon:
1 2 3 4 5 6 7 8 9
● netplan.service - LSB: Netplan calendar service. Loaded: loaded (/etc/init.d/netplan; generated) Active: active (exited) since Tue 2020-10-13 21:12:52 CST; 1h 47min ago Docs: man:systemd-sysv-generator(8) Process: 4631 ExecStart=/etc/init.d/netplan start (code=exited, status=0/SUCCESS)
netplan: netplan version 2.2 starting at Tue Oct 13 23:25:29 2020 netplan: database directory is /var/lib/plan/netplan.dir netplan: user "netplan" is uid 63434 gid 63434 netplan: switching from user <root> to <uid 63434 gid 63434> netplan: running with uid=63434 gid=63434 euid=63434 egid=63434 netplan: reading access list file /var/lib/plan/netplan.dir/.netplan-acl netplan: netplan/tcp not found in /etc/services, using ports 2983 and 5444
netplan: netplan version 2.2 starting at Wed Oct 14 09:49:16 2020 netplan: database directory is /var/lib/plan/netplan.dir netplan: user "netplan" is uid 63434 gid 63434 netplan: switching from user <root> to <uid 63434 gid 63434> netplan: running with uid=63434 gid=63434 euid=63434 egid=63434 netplan: no read/write access to /var/lib/plan/netplan.dir/.: No such file or directory
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
使用 iwconfig 检查:
1 2 3 4 5
wlan0 IEEE 802.11 ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=31 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on
使用 networkctl list 检查发现:
1 2 3 4 5 6
IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 eth0 ether routable configured 3 wlan0 wlan no-carrier configuring