Okay , so this i how i would do it
on Main Office server - two vpn server configs
1. p2p tunnel between main office server and remote vpn server
in each servers configuration you should have a "route" statement like
Main Office config:
route route 192.168.248.0 255.255.255.0
Remote Office config:
route route 192.168.250.0 255.255.255.0
after this is done , and vpn tunnel is up on both sides , the two LAN's should see each other with the condition that ip_forward is enabled on the servers and for the LAN on both sides the openvpn server is also the default gateway.
2. On Main Office , create a second vpn server like the one you posted in the first message ( UserVPN.conf ) , from which you can remove the "route" statement because it's not needed.
Add am iptables rule like
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -o tun0 -j MASQUERADE
where
tun0 , is the
interface for the first tunnel between your two offices
at this point your remote clients , connecting to the second tunnel on your main office server , should also have connectivity to the remote lan.
i've done this in a test environment and it works as expected.
--------------------------------------------------------
3. This said you can also set it up using a single VPN Server , running on in the main office and the remote office server + remote clients as vpn clients.
more about it here
https://community.openvpn.net/openvpn/wiki/RoutedLans
which basically boils down to , having the main office server set up with a config like this
proto udp
port 1194
dev tun
topology subnet
server 192.168.100.0 255.255.255.0
persist-key
persist-tun
keepalive 10 6
remote-cert-tls client
client-to-client
tls-auth ta.key 0
ca /etc/openvpn/keys/ca.crt
dh /etc/openvpn/keys/dh2048.key
tls-auth /etc/openvpn/keys/ta.key
key /etc/openvpn/keys/OpenVPN.key
cert /etc/openvpn/keys/OpenVPN.crt
client-config-dir /etc/openvpn/userkeys/
route 192.168.248.0 255.255.255.0
push "dhcp-option DNS 192.168.250.1"
push "dhcp-option DNS 192.168.250.2"
push "route 192.168.248.0 255.255.255.0"
push "route 192.168.250.0 255.255.255.0"
verb 3
status /var/log/openvpn/status.log
log-append /var/log/openvpn/openvpn.log
in /etc/openvpn/userkeys/ , having a file named
remote if common name of your remote server certificate is
remote , with an
iroute 192.168.248.0 255.255.255.0
which tells openvpn server to route this specific network to the remote office server (vpn client) , and also tells the remote office server (vpn client) to not route the
192.168.248.0 255.255.255.0 network over the vpn (since this is the local lan)
you do not need to add any other iptables nat rule , but you need ip_forward enabled on both servers.
Pick the method that it's easier to understand or set up for you