hi, thanks.
I think it's better to clearly explain my setup I don't know if this can help
this is my setup
--<vpnbox>
|
<client>---<firewall/gateway> -
|
--<lan>
|
--<special host>
where <vpnbox>, <special host> and all the <lan> are in the same IP class: 192.168.x.0/24
* <vpnbox> has 192.168.x.26 on its eth0 and 10.8.0.1 on its tun0
* <vpnbox> has ip forwarding enabled ( /proc/sys/net/ipv4/ip_forward = 1)
* openvpn on <vpnbox> routes all the 192.168.x.0/24 IP class to the client
* <client> (10.8.0.5) connects with openvpn to <vpnbox> (10.8.0.1)
an example of what i want to achieve is:
to let <vpnbox> allow <client> to only access <special host> on port 80 (lan web app), denying all the rest
ultimately, i would like to set up a "simple" setup to allow any specific <client> to access anly a set of "special" hosts/ports on the lan
i am experimenting with ufw because of the "simple" setup target i have, but if is not possible, i will switch to directly manage iptables rules. up to now i tried, without any specific firewalling rule applied:
if ufw on <vpnbox> is
off, then
* <vpnbox> can connect to all hosts on <lan>
if ufw on <vpnbox> is
on,
without DEFAULT_FORWARD_POLICY="ACCEPT", then
* <vpnbox> can NOT connect to any host on <lan>
if ufw on <vpnbox> is
on,
with DEFAULT_FORWARD_POLICY="ACCEPT", then
* <vpnbox> can connect to any host on <lan>
if ufw on <vpnbox> is
on,
with DEFAULT_FORWARD_POLICY="ACCEPT"
but with "default deny outgoing" (ufw comes with default deny incoming, allow outgoing), then
* <vpnbox> cannot connect to any host on <lan>
what is the best approach I could take to have simple rules allowing my intended target setup?
I don't really understand how to relate requests coming from tun0 to firewall rules on the 192.168.x.0/24 ip class of the lan, on <vpnbox>...
Thanks,
Marco