[SOLVED] using wifi instead of ethernet

lilu

New Member
Jul 31, 2019
5
0
1
47
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)
 

lilu

New Member
Jul 31, 2019
5
0
1
47
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
 

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
6,673
991
163
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

lilu

New Member
Jul 31, 2019
5
0
1
47
I configured it based on link you posted and it works. Thank you.
 

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
6,673
991
163
Glad you resolved your issue!
Please mark the thread as 'SOLVED' so that others know what to expect
Thanks
 

Sujan

New Member
Jun 4, 2021
5
0
1
44
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
 

lk777

Member
Oct 27, 2021
33
2
8
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

diversity

Member
Feb 19, 2020
161
6
23
52
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
 

diversity

Member
Feb 19, 2020
161
6
23
52
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

diversity

Member
Feb 19, 2020
161
6
23
52
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
 

diversity

Member
Feb 19, 2020
161
6
23
52
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
 

Jacopo1891

New Member
Mar 23, 2022
7
0
1
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:

diversity

Member
Feb 19, 2020
161
6
23
52
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
 

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!