分享

pve 命令行连接wifi

 shaopy 2022-01-12

以下操作基于Debian系统

换源

vi /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian buster main contrib non-free
deb http://mirrors.aliyun.com/debian buster-proposed-updates main contrib non-free
deb http://mirrors.aliyun.com/debian buster-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib

安装ifupdown2

rm /etc/apt/sources.list.d/pve-enterprise.list
echo 'deb http://download./debian/pve buster pve-no-subscription' >> /etc/apt/sources.list.d/pve-no-subscription.list
apt-get update
apt-get install -y ifupdown2

下载vim

apt-get update
apt-get install -y vim
echo "alias vi='vim'" >> ~/.bashrc
source ~/.bashrc

下载wpasupplicant连接Wi-Fi

apt-get install -y wpasupplicant

编辑/etc/network/interfaces

echo '#allow-hotplug wlp2s0
auto wlp2s0
iface wlp2s0 inet dhcp
        wpa-conf /etc/wpa.conf' >> /etc/network/interfaces

搜索Wi-Fi

wpa_cli -i wlp2s0 scan               #搜索附件Wi-Fi热点
wpa_cli -i wlp2s0 scan_result        #显示搜索Wi-Fi热点
wpa_cli -i wlp2s0 status              #当前WPA/EAPOL/EAP通讯状态

配置Wi-Fi

wpa_passphrase WiFi名称 WiFi密码 >> /etc/wpa.conf

cat /etc/wpa.conf

network={
        ssid="WiFi名称"
        scan_ssid=1 #表示可以扫描隐藏WiFi
        #psk="WiFi密码"
        priority=1 #优先级
        psk=XXXXXX
}

重启服务

/etc/init.d/networking restart

开启Wi-Fi

ifup wlp2s0

关闭Wi-Fi

ifdown wlp2s0

cat /etc/network/interfaces

#示例
auto lo
iface lo inet loopback

iface enp3s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.100.2/24
        bridge-ports enp3s0 wlp2s0
        bridge-stp off
        bridge-fd 0

auto wlp2s0
iface wlp2s0 inet dhcp
        wpa-conf /etc/wpa.conf

引用列表:

Proxmox 连接 WIFI
关于debian命令行怎么连接wifi
隐藏SSID和STA搜索隐藏SSID原理
Linux 使用wpa_supplicant手动配置连接wifi
wpa_supplicant及wpa_cli使用方法
wpa_supplicant 常用操作

学习列表:

pve 安装ifupdown2
Proxmox VE 6.1从零带你了解之-- 初始配置与管理
Proxmox VE 6.1从零带你了解系列
linux 中几种bond模式详解 bonging
Proxmox VE(PVE) 进行网卡直通
ProxmoxVE 开启硬件直通
openwrt如何添加板载无线网卡
软路由带7260AC驱动固件

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多