[SOLVED] using wifi instead of ethernet

lilu

New Member
Jul 31, 2019
5
0
1
49
Hello, is it possible to use wifi instead of wired ethernet or it is not supported?
Wifi works I can access web gui over it, but starting LXC containers fail


this is my /etc/network/interfaces
my wifi receives same ip config like vmbr0
Code:
auto lo
iface lo inet loopback

auto wlo1
iface wlo1 inet dhcp
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface vmbr0 inet static
        address 172.16.0.11
        netmask 255.240.0.0
        gateway 172.16.0.1
        bridge_ports wlo1
        bridge_stp off
        bridge_fd 0


lxc-start -n 102 -F

Code:
lxc-start: 102: conf.c: run_buffer: 335 Script exited with status 2
lxc-start: 102: network.c: lxc_create_network_priv: 2462 Failed to create network device
lxc-start: 102: start.c: lxc_spawn: 1646 Failed to create the network
lxc-start: 102: start.c: __lxc_start: 1989 Failed to spawn container "102"
lxc-start: 102: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 102: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options


my wifi network card is
Code:
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)
 
looks like vmbr0 was not active so I added

brctl addbr vmbr0
ifup vmbr0
Code:
can't add wlo1 to bridge vmbr0: Operation not supported

Waiting for vmbr0 to get ready (MAXWAIT is 2 seconds).
RTNETLINK answers: File exists

LXC container now starts but network inside LXC does not work
i guess I am out of luck
 
AFAIR wifi-interfaces usually do not support being part of a bridge in station (client) mode (i.e. you can only add them in access-point mode).

What should work is using a NAT/routed config - see https://pve.proxmox.com/pve-docs/ch..._nat_with_span_class_monospaced_iptables_span

just take the wlo1 as interface holding the default route, add a vmbr0 without any physical ports, configure ip-forwarding and optionally add NAT rules.

hope this helps!
 
  • Like
Reactions: Clarge67 and lilu
I configured it based on link you posted and it works. Thank you.
 
Glad you resolved your issue!
Please mark the thread as 'SOLVED' so that others know what to expect
Thanks
 
I configured it based on link you posted and it works. Thank you.
Hi Lilu,

Could you share the interface file to get an idea about wireless and NAT configuration.

Best Regards,

Sujan
 
I am new to this forum.
It would be nice if people share their resolved configurations.
My two cents.

wifi setup

Code:
iface enp4s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.10.5.80/24
        gateway 10.10.5.1
        bridge-ports enp4s0
        bridge-stp off
        bridge-fd 0


auto wlp5s0
iface wlp5s0 inet dhcp

auto vmbr1
iface vmbr1 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   iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o wlp5s0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s 10.10.10.0/24 -o wlp5s0 -j MASQUERADE     
#       post-up iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o wlp5s0 -j SNAT --to-source 192.168.20.180

Add a static route on your router to the private network behind the bridge. In my case:
Destination network: 10.10.10.0/24
Next hop address: 192.168.20.180 (a static IP address of my wifi card, dhcp-requested-address, check the link above).
Distance: 10
 
Last edited:
  • Like
Reactions: chrone
AFAIR wifi-interfaces usually do not support being part of a bridge in station (client) mode (i.e. you can only add them in access-point mode).

What should work is using a NAT/routed config - see https://pve.proxmox.com/pve-docs/ch..._nat_with_span_class_monospaced_iptables_span

just take the wlo1 as interface holding the default route, add a vmbr0 without any physical ports, configure ip-forwarding and optionally add NAT rules.

hope this helps!
is this still the case now we should all be able to use IP6? I mean no more NAT if I understood correctly right? I really hope it
 
  • Like
Reactions: ItsAlexx
I am new to this forum.
It would be nice if people share their resolved configurations.
My two cents.

wifi setup

Code:
iface enp4s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.10.5.80/24
        gateway 10.10.5.1
        bridge-ports enp4s0
        bridge-stp off
        bridge-fd 0


auto wlp5s0
iface wlp5s0 inet dhcp

auto vmbr1
iface vmbr1 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   iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o wlp5s0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s 10.10.10.0/24 -o wlp5s0 -j MASQUERADE    
#       post-up iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o wlp5s0 -j SNAT --to-source 192.168.20.180

Add a static route on your router to the private network behind the bridge. In my case:
Destination network: 10.10.10.0/24
Next hop address: 192.168.20.180 (a static IP address of my wifi card, dhcp-requested-address, check the link above).
Distance: 10
I am still struggling getting this to work. And even if I do I am assuming this wont work once connected to a different router (during traveling / hotel)

Is there something else I can try?
 
  • Like
Reactions: Jacopo1891
i gave up and am now installing virtualbox, yeah on a proxmox machine. it's sad that it is soo difficult for newcomers to networking
 
wow, virtualbox did not work due to some conflicts. but virtual machine manager has virtual network NAT out of the box. so I can continue using qemu/kvm
 
I configured it based on link you posted and it works. Thank you.
Can you please post your configuration files?
I've got the same problem but vm's network still not work but it can ping gateway (10.10.10.1).

Here it is my proxmox /etc/network/interfaces that do not let my vm to go online.
Code:
auto lo
iface lo inet loopback

iface enp3s0 inet manual

auto w1p2s0
iface w1p2s0 inet static
    address 192.168.1.252
    gateway 192.168.1.254
    netmask 255.255.255.0
  
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 iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o w1p2s0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o w1p2s0 -j MASQUERADE
 
Last edited:
Can you please post your configuration files?
I've got the same problem but vm's network still not work but it can ping 10.10.10.1.


Code:
auto lo
iface lo inet loopback

iface enp3s0 inet manual

auto w1p2s0
iface w1p2s0 inet static
    address 192.168.1.252
    gateway 192.168.1.254
    netmask 255.255.255.0
  
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 iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o w1p2s0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o w1p2s0 -j MASQUERADE
I second the request for a working configuration example.

I mean some of us use a laptop to test out setups before installing on bare metal
 
Hi everyone,

Someone can share your configuration file ?
I tried to configure WIFI and bridge without success....
@diversity
@lilu
someone can configure ?
Thanks in advance
I think it is dragging a dead horse in the meantime. The people that got it working seem no longer interested to give a working configuration otherwise they would have done so already.

I for one gave up on this a while back.

That is not to say that I would gladly go back to this if someone comes and safes us all!!.

I am now exploring the nginx on my laptop host route to reverse proxy to my VM's as I am also seem too UNknowledgeable to get IP6 working.
 
I think it is dragging a dead horse in the meantime. The people that got it working seem no longer interested to give a working configuration otherwise they would have done so already.

I for one gave up on this a while back.

That is not to say that I would gladly go back to this if someone comes and safes us all!!.

I am now exploring the nginx on my laptop host route to reverse proxy to my VM's as I am also seem too UNknowledgeable to get IP6 working.
thanks @diversity !!
I will continue looking this mistery
Hey guys, I don't know if you are still interested but I have made some steps.
Bear with me I installed Proxmox today on a HP Elitedesk 800 G3 Mini that I had laying around, and decided to turn it in a mini-homelab.
My goal:
- Having the mini-homelab connect to wifi because it will be hidden away in a console, having Proxmox working "normally"

Premise:
- Fresh install of Proxmox (latest)
- Did most of the installation via ethernet
- Started playing around with wifi even before having any VM or any significant configuration (i.e. I don't know it this will break something else)

This is my current config:

Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.10.10.10/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

auto wlp1s0
iface wlp1s0 inet static
        address 10.12.59.5/24
        netmask 255.255.255.0
        gateway 10.12.59.1
        wpa-essid XXX
        wpa-psk XXX

        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -A POSTROUTING -s '10.12.59.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.12.59.0/24' -o vmbr0 -j MASQUERADE

Explanation:
- Give vmbr0 (the bridge) a private IP outside of your current network
- Give your wlan (wlp1s0 in my case) the IP you expect Proxmox to serve its management page
- Use iptables to route all traffic from the wifi to the private address

It should work! I am still experimenting so please be careful.
Note: be sure to have physical access to the machine because by doing some tests i broke the network completely and had to plug a keyboard and a monitor into my machine and edit directly.

Hope this helps!
 
Hey guys, I don't know if you are still interested but I have made some steps.
Bear with me I installed Proxmox today on a HP Elitedesk 800 G3 Mini that I had laying around, and decided to turn it in a mini-homelab.
My goal:
- Having the mini-homelab connect to wifi because it will be hidden away in a console, having Proxmox working "normally"

Premise:
- Fresh install of Proxmox (latest)
- Did most of the installation via ethernet
- Started playing around with wifi even before having any VM or any significant configuration (i.e. I don't know it this will break something else)

This is my current config:

Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.10.10.10/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

auto wlp1s0
iface wlp1s0 inet static
        address 10.12.59.5/24
        netmask 255.255.255.0
        gateway 10.12.59.1
        wpa-essid XXX
        wpa-psk XXX

        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -A POSTROUTING -s '10.12.59.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.12.59.0/24' -o vmbr0 -j MASQUERADE

Explanation:
- Give vmbr0 (the bridge) a private IP outside of your current network
- Give your wlan (wlp1s0 in my case) the IP you expect Proxmox to serve its management page
- Use iptables to route all traffic from the wifi to the private address

It should work! I am still experimenting so please be careful.
Note: be sure to have physical access to the machine because by doing some tests i broke the network completely and had to plug a keyboard and a monitor into my machine and edit directly.

Hope this helps!

Dear @Maerlin

Sorry for my basic question
You wrote "ive your wlan (wlp1s0 in my case) the ..." how can I know my wlan reference?
Thanks
 
Dear @Maerlin

Sorry for my basic question
You wrote "ive your wlan (wlp1s0 in my case) the ..." how can I know my wlan reference?
Thanks
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.
 
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 yours easily in our online shop.

Buy now!