[SOLVED] using wifi instead of ethernet

Hello!

So you just run the command:
Bash:
ip a

It will show an output like this:
Bash:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:29:28:fd:4c brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.2/24 brd 192.168.50.255 scope global eth0
    inet6 fe80::20c:29ff:fe28:fd4c/64 scope link
       valid_lft forever preferred_lft forever

The string right after the colon (you may have multiples interfaces, listed like 1: 2: etc) will be your identifier. Usually wireless is wlpxxx or wlanxxx, but the numbers at the end may vary based on your config.

Note: I just want to let everybody knows that the config i posted before does work and makes Proxmox accessible on wifi, but breaks the VMs connections to the bridge / internet. I still have to find some time to look into this to fix it.

Thanks for your prompt reply.

The problem is my NUC has a wifi network card but it is not seen from Proxmox.

To lspci command I get: 01:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)

But no active wifi network card is listed when I run the command ip a :
3: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 74:d8:3e:74:69:04 brd ff:ff:ff:ff:ff:ff


The wlp1s0 is listed as down

I cannot understand if the built-in wifi card is the one labelled as wlp1s0 but it is not active or if there is another card not listed.

Understood you have not reached the end of the line accessing wifi from VMs, but I'll be a leech for your good results.
 
Thanks for your prompt reply.

The problem is my NUC has a wifi network card but it is not seen from Proxmox.

To lspci command I get: 01:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)

But no active wifi network card is listed when I run the command ip a :
3: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 74:d8:3e:74:69:04 brd ff:ff:ff:ff:ff:ff


The wlp1s0 is listed as down

I cannot understand if the built-in wifi card is the one labelled as wlp1s0 but it is not active or if there is another card not listed.

Understood you have not reached the end of the line accessing wifi from VMs, but I'll be a leech for your good results.
I had a few NUCs and that's definitely it. You just have to configure it! Keeping in mind that your id is wlp1s0, you can follow this Debian WiKi: https://wiki.debian.org/WiFi/HowToUse#iwd and use IWD to configure it (scanning for networks, etc etc). It will then go UP and from there you can do all the fiddling i did to get to where I am still stuck. I think with some clever iptables the bridging will work, but again no time for now to try. :)
 
Hi, after a few attempts I managed to get working Proxmos on an old laptop for testing which only contains a wifi network device, so I thought I'll post the details of my setup.

Here is the /etc/network/interfaces configured on my proxmox server, check that you have internet connectivity first on the proxmox server, it'll require to install some packages like wpasupplicant

Code:
auto lo
iface lo inet loopback

# Wireless interface
allow-hotplug wlp1s0
iface wlp1s0 inet static
    address 192.168.3.101/24
    gateway 192.168.3.1
    wpa-ssid ***
    wpa-psk ***

# Virtual Bridge interface
auto vmbr0
iface vmbr0 inet static
    address 192.168.200.1/24 # IP assigned to virtual bridge on Proxmox server, gateway for VMs / Containers
    bridge-ports none
    bridge-stp off
    bridge-fd 0
    # Enable ip forwarding
    post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    # Route all traffic from VMs / Container through the wireless interface hiding its internal IP
    post-up iptables -t nat -A POSTROUTING -s '192.168.200.0/24' -o wlp1s0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '192.168.200.0/24' -o wlp1s0 -j MASQUERADE
    # I needed this otherwise my packets wouldn't reach other computers/router on my network
    post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
    post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

The VMs or containers hosted by Proxmox use the 192.168.200.0/24 with a default gateway of 192.168.200.1 (IP assigned to Proxmox on vmbr0 interface) Here is how the routing table looks in a VM (ip route)

Code:
default via 192.168.200.1 dev eth0 proto static metric 100  #Virtual interface eth0 on VM uses vmbr0 as gateway
192.168.200.0/24 dev eth0 proto kernel scope link src 192.168.200.11 metric 100

The VMs can be exposed to the network by either creating a static route on your router or by using NAT and redirecting traffic from a port on the host to an internal VM / Container, if you don't have access to modify routes for the network

Creating a static route to expose your VMs/Containers:

Code:
sudo ip route add 192.168.200.0/24 via 192.168.3.101 dev wlo1 # Route added in other computer or router, to specify how to reach subnet 192.168.200.0

The other option with NAT can be used with iptables on the interfaces of the proxmox server, you could add these lines on the bridge config after the others:

Code:
post-up iptables -t nat -A PREROUTING -p tcp --dport 1234 -j DNAT --to-destination 192.168.200.11:1234 # Redirect port 1234 on proxmox server to guest VM 192.168.200.11 on the same prot

Hope you find it useful as searching for this issue always redirects me here and there was some confussion with the docs to get it working based on the history
 
The VMs can be exposed to the network by either creating a static route on your router or by using NAT and redirecting traffic from a port on the host to an internal VM / Container, if you don't have access to modify routes for the network
Thank you for this in depth explanation. I believe someone already mentioned something similar in passing earlier in this thread or another.
Was not the issue with this approach that it will not work when the laptop is connected to another network?, like in a hotel?
 
I think it will be unlikely to carry the laptop with proxmox anywhere plus your current laptop, if you install proxmox is to make a homelab or similar I'd imagine, in that case if I need from a VM/Container I will just use virt-manager.

But even if you want to do so, you can just change the wireless interface config to make it dhcp and the rest should stay the same. As it is using masquerade for the iptables rules so you only have to specify the interface, no need for static IPs as with SNAT.

Code:
# Wireless interface
allow-hotplug wlp1s0
iface wlp1s0 inet dhcp
    wpa-ssid ***
    wpa-psk ***
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!