openvpn_inc wrote
The --route directive has to be global, on the server, so clients know to route those networks through the VPN. There would be no point to setting a route in a CCD. OTOH --iroute is about what route goes to which client, so it has to be in a CCD.
Hi rob0, maybe I'm misunderstanding something or I didn't explain my problem properly (my English is terrible).
I have client to server (OVPN) routed (tun) connection, machine with OVPN server is also default gateway for server network.
And my goal is client connection with, from server LAN, enabled routing to subnet behind client.
From what I understand, I need to have both set up on the server side:
1) iroute $CLIENTsUBNET - sets OVPN server internal routing only. Directive may be (and perhaps preferred to be) in CCD file.
2) route $CLIENTsUBNET ${ifconfig_pool_remote_ip} - sets route in OVPN server machine OS(=DF GW) routing table and in my case is effectively equal to iproute2 command "ip route add $CLIENTsUBNET via ${ifconfig_pool_remote_ip} dev ${dev}"
Without 2) OS on OVPN server not know, how route packets from its subnets to subnet behind client (without it, server OS does not know, that packets must be routed to clients tun IP via server tun interface).
From my view should be optimal to set both 1) and 2) (OVPN server internal and its OS routin table) in client connection time - thus "--route $CLIENTsUBNET" directive optimally should be not in global OVPN server configuration, but in CCD or so (simply in something that is executed at the time of connection).
Did I miss something?