I'm hoping some iptables or dd-wrt guru can help me here.

I'm basically trying to configure my network with an additional wireless virtual interface so that I have a separate SSID (wl1.1) that I can use for VPN traffic via openVPN enabling me to access my vpn connection just by switching wifi network.

I've a test dd-wrt router that I have configured at the moment and I'm able to connect to my openVPN server okay, however this is forwarding all traffic regardless of wireless interface over the VPN. I think I just need some iptables rules to forward all traffice from the virtual wireless interface (wl1.1) to my tun0 interface.

Anyone any ideas?


I'm assuming that you have the two wireless interfaces configured appropriately, with different DHCP ranges. Remove the redirect-gateway directive from your OpenVPN configuration so that it doesn't send all traffic via the VPN. Then setup policy routing to send traffic from the IP range for wl1.1 via the VPN.

Assuming that the IP range for wl1.1 is, and the internal IP of the remote VPN server is

echo "100 vpn" >> /etc/iproute2/rt_tables
ip route add default via table vpn
ip rule add from lookup vpn
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.