Solution: How to use USB Wifi or PCI Wifi instead of Ethernet for Proxmox and VM/Containers

tahseenjamal

New Member
Oct 1, 2020
2
0
1
49
Ok so this is my setting and this works as in using wifi for Proxmox

Also note when you create the VM or LXC VM, you have to give the VM a static IP. You would see the Network setting in Network Box when creating VM
VM IP: 10.10.10.50/24 # as an e.g. I am giving
gateway IP: 10.10.10.1

#################/etc/network/interfaces
Rich (BB code):
auto lo
iface lo inet loopback

# Initially I had placed a block here for initializing the wifi (I have a USB wifi) but realized that
# somehow it had issue, so I completely removed it as you can see
# leaving it the system to give the IP. My Router DHCP gives same IP for a MAC for a very long time
# so it would is virtually like static IP


auto vmbr0

#private sub network

iface vmbr0 inet static
    address  10.10.10.1
    netmask  255.255.255.0
    bridge-ports none
    bridge-stp off
    bridge-fd 0

    # WIFI is the wifi network interface name that you can get using 'ip a' or 'ifconfig'
    #Replace the below word WIFI with your wifi name
    # NOTE THE TAB SUCH THAT BELOW IS ALIGNED UNDER IF
    post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
    post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o WIFI -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o WIFI -j MASQUERADE

################END OF FILE#######################################


Please feel free to ask me any question you have. I thought I should share this as I had a lot of trouble and some mixed posts helped to understand how to do it
 
Last edited:
I edited for clarity. I mean the wifi network interface name like wls0 or wxl0

whatever you see when you do ip a or ifconfig
 
Last edited:
Just curious with the Wi-Fi USB where do you enter the SSID and password, probably not gonna get a response but I figured I'd just post it out there , thanks.

auto wlx7cdd90c8190b
iface wlx7cdd90c8190b inet dhcp
wpa-ssid Your_Netgear_SSID
wpa-psk Your_Netgear_Password

# WIFI is the wifi network interface name that you can get using 'ip a' or 'ifconfig'
#Replace the below word WIFI with your wifi name
# NOTE THE TAB SUCH THAT BELOW IS ALIGNED UNDER IF
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o wlx7cdd90c8190b -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o wlx7cdd90c8190b -j MASQUERADE