[CentOS] openvpn and firewalld

Fri May 8 16:06:22 UTC 2015
Bowie Bailey <Bowie_Bailey at BUC.com>

On 5/8/2015 9:34 AM, Bowie Bailey wrote:
> I am trying to build a new openvpn server based on CentOS7. Everything 
> is working fine as long as I disable firewalld.  With firewalld 
> enabled, I can connect to the vpn and ping the machines on the 
> network, but I am unable to ssh to them.
> What I had on my old server with iptables was two simple rules:
> -A RH-Firewall-1-INPUT -s <localnet>/ -d 
> <vpnnet>/ -j ACCEPT
> -A RH-Firewall-1-INPUT -s <vpnnet>/ -d 
> <localnet>/ -j ACCEPT
> This allowed all traffic to flow between my vpn subnet and the local 
> network.  How can I duplicate this behavior with firewalld?

Replying to myself here, I finally figured out how to do it with direct 
rules.  Firewalld on CentOS 7 defaults to a drop rule for the FORWARD 
chain which my previous server didn't have.  So I needed to put the 
rules in the FORWARD chain rather than the INPUT chain.

The rules may not have been necessary on the old server since FORWARD 
defaulted to accept, but they would have worked anyway because the 
RH-Firewall-1-INPUT chain was referenced by both the INPUT and FORWARD 

I'm still trying to sort out how to do this using firewalld's normal or 
rich rules.  So far, no success.  I'm not sure how to affect the FORWARD 
chain with firewalld.

Right now, I have:

# firewall-cmd --direct --get-all-rules
ipv4 filter FORWARD 0 -s <localnet>/ -d <vpnnet>/ 
ipv4 filter FORWARD 0 -s <vpnnet>/ -d <localnet>/ 

So how can I duplicate this behavior without using direct rules?