This is a HOWTO for configuring Wifi for Proxmox VE 8-1.2 w/ SNAT. I've read a bunch of various writeups but none of them are consistent so hopefully this will be a one-stop shop for people to get Wifi w/ SNAT configured. Hopefully this can be added to the Wiki.
Note: This configuration DOES NOT use DHCP for anything. It uses all static addressing.
Prerequisites:
1) Wired ethernet connection - this is required to install wpasupplicant
2) Configure your wifi router to route to networks that will be associated with wifi adapter. Example for /24 network:
Destination = 192.168.3.0
Netmask = 255.255.255.0
Gateway = 192.168.1.100 (specify IP address of wifi adapter)
Setup:
1) Connect ethernet cable.
2) Install Proxmox 8-1.2.
3) After the install completes and the system has rebooted, install wpasupplicant (and install vim while you're at it):
4) Configure wpasupplicant:
5) Determine wireless adapter device name:
6) Create /etc/systemd/system/wpa_supplicant.service and add configuration:
7) Enable wpasupplicant service:
8) Configure /etc/network/intefaces:
9) Restart wpa_supplicant and networking services to connect wireless adapter to wifi network:
10) Remove subscription nag message:
11) Log into proxmox web interface:
12) Create SDN config (Datacenter --> SDN):
Zone: Simple, ID = Zone1 (use any name you like for ID)
Vnet: Name = vnet1 (use any name you like for Name), Zone = Zone1 (must match Zone ID)
Subnet: Subnet = 192.168.3.0/24, Gateway = 192.168.3.1, SNAT (check)
13) Apply config: SDN --> Apply
14) Edit /etc/network/intefaces and uncomment lines that were previously commented out:
15) Restart network service:
16) Done. Profit.
Note: This configuration DOES NOT use DHCP for anything. It uses all static addressing.
Prerequisites:
1) Wired ethernet connection - this is required to install wpasupplicant
2) Configure your wifi router to route to networks that will be associated with wifi adapter. Example for /24 network:
Destination = 192.168.3.0
Netmask = 255.255.255.0
Gateway = 192.168.1.100 (specify IP address of wifi adapter)
Setup:
1) Connect ethernet cable.
2) Install Proxmox 8-1.2.
3) After the install completes and the system has rebooted, install wpasupplicant (and install vim while you're at it):
Code:
apt update && apt install wpasupplicant vim
systemctl disable wpa_supplicant
4) Configure wpasupplicant:
Code:
wpa_passphrase SSIDNAME PASSWORD >> /etc/wpa_supplicant/wpa_supplicant.conf
5) Determine wireless adapter device name:
Code:
root@px1:/etc/pve/qemu-server# dmesg | grep -i wlp
[ 4.984791] mt7921e 0000:02:00.0 wlp2s0: renamed from wlan0
6) Create /etc/systemd/system/wpa_supplicant.service and add configuration:
touch /etc/systemd/system/wpa_supplicant.service
Code:
[Unit]
Description=WPA supplicant
Before=network.target
After=dbus.service
Wants=network.target
IgnoreOnIsolate=true
[Service]
Type=dbus
BusName=fi.w1.wpa_supplicant1
ExecStart=/sbin/wpa_supplicant -u -s -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlp2s0 ## specify your wireless device here
Restart=always
[Install]
WantedBy=multi-user.target
Alias=dbus-fi.w1.wpa_supplicant1.service
7) Enable wpasupplicant service:
systemctl enable wpa_supplicant
8) Configure /etc/network/intefaces:
Code:
auto lo
iface lo inet loopback
iface enp1s0 inet manual
auto wlp2s0
iface wlp2s0 inet manual
address 192.168.1.100/24
gateway 192.168.1.1
auto vmbr0
iface vmbr0 inet static
address 192.168.2.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
## uncomment these lines after completing step 13
#iface vnet1 inet static
# address 192.168.3.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 '192.168.3.0/24' -o wlp2s0 -j MASQUERADE
# post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone zone1
# post-down iptables -t nat -D POSTROUTING -s '192.168.3.0/24' -o wlp2s0 -j MASQUERADE
# post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone zone1
source /etc/network/interfaces.d/*
9) Restart wpa_supplicant and networking services to connect wireless adapter to wifi network:
systemctl restart wpa_supplicant && systemctl restart networking
10) Remove subscription nag message:
Code:
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
11) Log into proxmox web interface:
https://<ip_of_your_wifi_adapter>:8006
12) Create SDN config (Datacenter --> SDN):
Zone: Simple, ID = Zone1 (use any name you like for ID)
Vnet: Name = vnet1 (use any name you like for Name), Zone = Zone1 (must match Zone ID)
Subnet: Subnet = 192.168.3.0/24, Gateway = 192.168.3.1, SNAT (check)
13) Apply config: SDN --> Apply
14) Edit /etc/network/intefaces and uncomment lines that were previously commented out:
Code:
auto lo
iface lo inet loopback
iface enp1s0 inet manual
auto wlp2s0
iface wlp2s0 inet manual
address 192.168.1.100/24
gateway 192.168.1.1
auto vmbr0
iface vmbr0 inet static
address 192.168.2.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
iface vnet1 inet static
address 192.168.3.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 '192.168.3.0/24' -o wlp2s0 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone zone1 ## Zone ID
post-down iptables -t nat -D POSTROUTING -s '192.168.3.0/24' -o wlp2s0 -j MASQUERADE
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone zone1 ## Zone ID
source /etc/network/interfaces.d/*
15) Restart network service:
systemctl restart networking
16) Done. Profit.
Last edited: