I have a remote office with a firewall running OpenVPN which clients can connect to.
Firewall interfaces:
* eth0 - 1.2.3.4 (public)
* br0 - 192.168.1.1 (/24)
* tun0 - 192.168.254.1 (/24, VPN clients)
So VPN clients, 192.168.254.0/24, can see 192.168.1.0/24 though they don't need to. But I do need 192.168.1.0/24 to talk to VPN clients. From the firewall itself I can SSH to VPN clients. And from one VPN to another I can SSH - though this flow isn't necessary it might be nice at some point. The problem is I can't SSH from hosts on 192.168.1.0/24 to VPN clients. Default policy for each chain, Input, Forward and Output is to drop.
I don't feel this is an OpenVPN problem but a netfilter (iptables) problem.
Relevant rules in place:
INPUT -p udp --dport 1194 -j ACCEPT
FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
FORWARD -i br0 -o tun0 -j ACCEPT
FORWARD -i tun0 -o br0 -j ACCEPT
FORWARD -s 192.168.254.0/24 -j ACCEPT
OUTPUT -d 192.168.254.0/24 -j ACCEPT
The above rules all get hits. I've tried other rules with various source and destination interfaces and IP addresses but can't come up with what is missing. The most obvious, I initially thought, was:
FORWARD -d 192.168.254.0/24 -j ACCEPT
...but when added it didn't work. Didn't even get hits.
=== EDIT 1 ===
The firewall has the following routes:
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.254.0 0.0.0.0 255.255.255.0 U 0 0 0 tun2
Also, the following rule (also listed above)...
FORWARD -i br0 -o tun0 -j ACCEPT
...gets hits when 192.168.1.0/24 hosts try to reach VPN clients.
=== EDIT 2 ===
From 192.168.1.x (.171 specifically) I did a traceroute --icmp 192.168.254.2
while running a packet capture on the firewall's tun0 interface and I see the the requests but no replies. The target, 192.168.254.2, replies to traceroute from 192.168.254.0/24. It allows all ICMP. This traffic is allowed by the broad firewall rule, FORWARD -i br0 -o tun0 -j ACCEPT
and I see it logged accordingly.