I have OpenVPN setup on a CentOS box. Clients can connect to the vpn just fine and access its resources, ping the server's lan address. However i wanted OpenVPN clients to be able to access a computer on lan connected to the OpenVPN server. I enabled ip forwarding on the server, pushed the route as i've read you need to do but when testing an OpenVPN client is not even able to ping a computer on the servers lan.
After disabling firewalld, the problem goes away and clients can ping computers on the lan behind the openvpn server just fine. I've tried putting set-target on firewalld for the openvpn zone to accept (just as a test), created rules to accept all traffic from the openvpn subnet but no change. The only way it appears to work is if I completely stop firewalld. Has anyone else had this trouble and could guide me in the right direction?
Note this is a copy of the output from firewalld's list command for the zone in which openvpn resides:
Upon checking firewalld there are no rich rules or manual port forwards on this system apart from ticking the services http/https, openvpn and ssh to allow those ports through. This is a copy of the list command for the openvpn zone:
target: default
icmp-block-inversion: no
interfaces: enp8s0 enp9s0 tun0
sources:
services: http https openvpn ssh
ports:
protocols:
forward: no
masquerade: yes
forward-ports:
source-ports:
icmp-blocks:
rich rules:
I ended up having to add the following rules:
firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i tun0 -o virbr2 -j ACCEPT
firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i virbr2 -o tun0 -j ACCEPT
The only problem is that although this works, if i try to add them in with the permanent option they dont take effect - even though it's listed in direct.xml
Thanks, James.