电脑只有无线网卡,pve如何联网
电脑只有无线网卡,pve如何联网
背景:闲置的笔记本电脑,只有无线网卡,装了pve系统,想安装pve之后再弄个黑群辉,结果卡在了联网的问题上。
pve默认是使用有线网卡进行网络连接的,如果使用无线网卡进行联网,需要单独的一些设置。见下文
1、pve安装过程注意实现
和正常有线网卡安装一样,pve在指定管理ip的时候,默认会选择电脑仅有的网卡。
在只有无线网卡的电脑上安装完成后,pve默认是连不上网络的,局域网也连接不上。
2、pve使用无线网卡联局域网
2.1、查看无线网卡的名称
# 查看网络ip和网卡 ip a
2.2、缺失的工具安装,方便下面进行搜索和连接wifi
wpasupplicant:WiFi认证工具,注意用于生成wifi密码加密后的密文
wireless-tools:wifi扫描工具,主要用于扫描到哪些wifi可以进行连接
上面的工具可以到https://pkgs.org/网站可以下载安装包,也可以直接在线安装【前提有网络】
# 1、方式1:在线安装 apt install wpasupplicantxxx.deb apt install wireless-toolsxxx.deb # 2、方式2:离线安装,如果提示缺少依赖,到https://pkgs.org/网站可以下载 dpkg -i wpasupplicantxxx.deb dpkg -i wireless-toolsxxx.deb
2.3、使用网卡和iwlist命令搜索有哪些wifi可以链接
# wlp2s0是网卡的名称,也就是上面第一步得到的网卡的名称 iwlist wlp2s0 scanning
2.4、使用wpa_passphrase命令获取wifi连接的密码的密文
# xxx_wifi_5G是wifi的名称,12345678是wifi的密码 wpa_passphrase xxx_wifi_5G 12345678
2.5、网络配置,配置文件/etc/network/interfaces,保存,保存,保存
# 编辑文件,下面使用的nano命令编辑文件,也可以使用其他方式 nano /etc/network/interfaces
2中方式进行联网:任选其一
第一种:指定静态ip的方式进行联网
第二种:使用dhcp自动分配ip的方式进行联网
在文件中添加如下配置,如果里面已经有相关的配置,先删除**
auto wlp2s0 # wlp2s0是无线网卡的名字,改成自己的无线网卡 # **第一种:指定静态ip的方式进行联网** iface wlp2s0 inet static # 这里设置的是指定静态ip address 192.168.1.3/24 gateway 192.168.1.1 wpa-ssid wifi_xxx_5G # wifi的名称 wpa-psk a347d52cbfwe8912bfe40c51255ab98f0ee # wifi的密文,上面等到的密文 auto wlp2s0 # wlp2s0是无线网卡的名字,改成自己的无线网卡 # **第二种:使用dhcp自动分配ip的方式进行联网** iface wlp2s0 inet dhcp # 这里使用dhcp获取ip wpa-ssid wifi_xxx_5G # wifi的名称 wpa-psk a347d52cbfwe8912bfe40c51255ab98f0ee # wifi的密文,上面等到的密文
需要注意:需要注意:需要注意:
关闭虚拟网卡的桥接无线网卡的配置,因为pve不支持无线网卡的网络桥接,默认生成的配置文件,如果只有无线网卡的话,就会使用无线网卡作为网络桥接的网卡,这样会导致联网失败
# 还是在/etc/network/interfaces文件中配置 auto vmbr0 iface vmbr0 inet static address 10.10.10.1/24 # bridge-ports wlp2s0 # 默认生成的配置,改掉,改成none bridge-ports none bridge-stp off bridge-fd 0 post-up echo 1 > /proc/sys/net/ipv4/ip_forward # post-up bash /root/iptablesNat.sh post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o wlp2s0 -j MASQUERADE post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o wlp2s0 -j MASQUERADE
2.6、重启网卡查看wifi的连接是否成功
# 关闭网卡 ifdown wlp2s0 # 打开网卡,会自动加载**/etc/network/interfaces配置中auto部分,进行自动连接** ifup wlp2s0 # 查看网卡是否获得了ip ip a
最终的配置:/etc/network/interfaces
# network interface settings; autogenerated # Please do NOT modify this file directly, unless you know what # you're doing. # # If you want to manage parts of the network configuration manually, # please utilize the 'source' or 'source-directory' directives to do # so. # PVE will preserve these directives, but will NOT read its network # configuration from sourced files, so do not attempt to move any of # the PVE managed interfaces into external files! auto lo iface lo inet loopback auto wlp2s0 # 指定ip方式联网 iface wlp2s0 inet static address 192.168.1.3/24 gateway 192.168.1.1 wpa-ssid wifi_xxx_5G wpa-psk a347d52cbfddceac007f8817912bfe40c51255ab98f0ee auto vmbr0 iface vmbr0 inet static address 10.10.10.1/24 bridge-ports none bridge-stp off bridge-fd 0 post-up echo 1 > /proc/sys/net/ipv4/ip_forward # post-up bash /root/iptablesNat.sh post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o wlp2s0 -j MASQUERADE post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o wlp2s0 -j MASQUERADE
版权声明:
作者: freeclashnode
链接: https://www.freeclashnode.com/news/article-4404.htm
来源: FreeClashNode
文章版权归作者所有,未经允许请勿转载。
免费节点实时更新
热门文章
- 6月6日|20.3M/S,Shadowrocket(小火箭)/V2ray/Clash(小猫咪)免费节点订阅链接每天更新
- 6月10日|23M/S,Shadowrocket(小火箭)/Clash(小猫咪)/V2ray免费节点订阅链接每天更新
- 6月7日|18.5M/S,V2ray/Clash(小猫咪)/SSR免费节点订阅链接每天更新
- 6月11日|19.2M/S,SSR/Clash(小猫咪)/V2ray免费节点订阅链接每天更新
- 6月8日|21.5M/S,V2ray/SSR/Clash(小猫咪)免费节点订阅链接每天更新
- 5月26日|19.1M/S,Clash(小猫咪)/SSR/V2ray免费节点订阅链接每天更新
- 6月12日|21.7M/S,Shadowrocket(小火箭)/V2ray/Clash(小猫咪)免费节点订阅链接每天更新
- 6月9日|22.3M/S,SSR/V2ray/Clash(小猫咪)免费节点订阅链接每天更新
- 5月18日|20.3M/S,Clash(小猫咪)/Shadowrocket(小火箭)/V2ray免费节点订阅链接每天更新
- 5月17日|21.9M/S,Clash(小猫咪)/V2ray/SSR免费节点订阅链接每天更新
最新文章
- 6月14日|18.7M/S,V2ray/Clash(小猫咪)/SSR免费节点订阅链接每天更新
- 6月13日|20.6M/S,Clash(小猫咪)/V2ray/Shadowrocket(小火箭)免费节点订阅链接每天更新
- 6月12日|21.7M/S,Shadowrocket(小火箭)/V2ray/Clash(小猫咪)免费节点订阅链接每天更新
- 6月11日|19.2M/S,SSR/Clash(小猫咪)/V2ray免费节点订阅链接每天更新
- 6月10日|23M/S,Shadowrocket(小火箭)/Clash(小猫咪)/V2ray免费节点订阅链接每天更新
- 6月9日|22.3M/S,SSR/V2ray/Clash(小猫咪)免费节点订阅链接每天更新
- 6月8日|21.5M/S,V2ray/SSR/Clash(小猫咪)免费节点订阅链接每天更新
- 6月7日|18.5M/S,V2ray/Clash(小猫咪)/SSR免费节点订阅链接每天更新
- 6月6日|20.3M/S,Shadowrocket(小火箭)/V2ray/Clash(小猫咪)免费节点订阅链接每天更新
- 6月5日|21.9M/S,V2ray/Clash(小猫咪)/Shadowrocket(小火箭)免费节点订阅链接每天更新