What's new

Forbid OpenVPN access from Guest WiFi

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

netcatz

New Around Here
Hi folks.

I'm running RT-AC68U with Merlin 380.70. I also have a OpenVPN client pushing several networks I need for work. The problem is, anyone within Guest WiFi can also access them too. OpenVPN is NOT my default gateway, so it's just a couple of networks.

I've tried to block guest with something like this

iptables -I INPUT -i wl0.1 -d 192.168.0.0/16 -j DROP
iptables -I FORWARD -i wl0.1 -d 192.168.0.0/16 -j DROP

But it doesn't seem to work. Can you suggest me how to implement that? I don't want to create black/white lists for my/guest hardware, just block anyone from guest WiFi from accessing tun11 or something like that.
 
Last edited:
Hi folks.

I'm running RT-AC68U with Merlin 380.70. I also have a OpenVPN client pushing several networks I need for work. The problem is, anyone within Guest WiFi can also access them too. OpenVPN is NOT my default gateway, so it's just a couple of networks.

I've tried to block guest with something like this

iptables -I INPUT -i wl0.1 -d 192.168.0.0/16 -j DROP
iptables -I FORWARD -i wl0.1 -d 192.168.0.0/16 -j DROP

But it doesn't seem to work. Can you suggest me how to implement that? I don't want to create black/white lists for my/guest hardware, just block anyone from guest WiFi from accessing tun11 or something like that.

How many guests? How secure? Easiest way would be to staticly assign ip's and only setup routes for the hosts you want using the vpn.
 
Well, it's in a small office (~10 people). I don't want to constantly monitor new devices of my colleagues and add them on the fly, who brought his new iPad or her HP notebook etc.
Just a simple rule - if they know the password for the main WiFi they are ok. If they know only Guest WiFi pass - no access to VPN for them. I wonder why it's not in the core actually.
 
So, if you know the exact networks you wish to block you may do it as follows

firewall-start script:
Code:
#!/bin/sh

for iface in `nvram get wl0_vifs` `nvram get wl1_vifs`
do
  for net in 192.168.0.0/16 10.0.0.0/8 172.16.0.0/12
  do
    if ! $(ebtables -t broute -L | grep -q "p IPv4 -i $iface --ip-dst $net -j DROP"); then
      ebtables -t broute -I BROUTING -p IPv4 -i $iface --ip-dst $net -j DROP
    fi
  done
done

Unfortunatelly physdev module of iptables is not included in the kernel for some reason (it breaks IPTV or something like that).
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top