我是服务器新手,刚刚在我的联想笔记本电脑上安装了 Ubuntu 20.04 Sever。在初始设置过程中,我没有连接到互联网。我读到我可以稍后在终端内做到这一点。虽然我无法ifconfig
执行任何其他命令,因为我没有安装必要的工具。但是,我无法安装它们,因为我没有连接到互联网。所以我不知道如何通过无线方式连接到互联网并摆脱这个无限循环?
有什么建议么?
編輯
输入:sudo lshw -C network
输出:
*-network DISABLED
description: Wireless interface
production: Wireless 3160
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:08:00.0
logical name: wlp8s0
version: 93
serial: a0:88:69:77:f6:32
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration; broadcast=yes driver=iwlwifi driverversion=5.4.0-42-generic firemware=17.3216344376.0 latency=0 link=no multicast=yes wireless=IEEE 802.11
resources: irq:38 memory:d1600000-d1601fff
*-network DISABLED
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:09:00.0
logical name: enp9s0
version: 10
serial: f8:a9:63:2a:94:b9
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical
configuration: broadcast=yes driver=r8169 latency=0 link=no multicast=yes
resources: irq:18 ioport:3000(size=256) memory:d1504000-d1504fff memory:d1500000-d1503fff
输入:cat /etc/netplan/*.yaml
输出:
# This is the network config written by 'subiquity'
network:
ethernets: {}
version: 2
答案1
用这个替换 /etc/netplan 中现有的 .yaml...保持精确的间距、缩进,没有制表符...填写 SSID 和密码...
network:
version: 2
renderer: networkd
ethernets:
enp9s0:
dhcp4: true
optional: true
wifis:
wlp8s0:
dhcp4: true
access-points:
"network_ssid_name":
password: "**********"
sudo netplan generate
sudo netplan apply
reboot
通过以太网电缆连接到互联网。
sudo apt-get update
sudo apt-get install wpasupplicant
reboot
断开以太网电缆。
通过无线连接。