Hi have a pi server running on my lan which also runs a hotspot on the wlan. Lan address is dynamically assigned but has.a reservation on the dhcp server so always has the same address. All this works fine, but I need to access clients in the VPN subnet as I have a Pi-camera at a remote sited want to grab some images to this server for the web page it hosts.
My eth0 is in a private range 10.x.y.0/23 and always has the address 10.x.y.15 the default gateway is obviously 10.x.y.1 and the VPN server sits at 10.x.y.7 and is running TUN mode so issues clients with addresses in the range 10.x.z.0//24. From the client end all is good as the connection sets up routing to access the local lan and the internet via the local gateway. The issue comes with accessing those clients from the home network.
On a PC or I would just say 'route add -p 10.x.z.0/24 10.x.z.7' and on my Mac I use something similar although it is much harder to make it persistent. I cannot get this to work with my Pi server though. The above command (minus the -p) yields and error "route: netmask 000000ff doesn't make sense with host route"
I have tried adding a route command to dhcpcd.conf in a section called interface eth0 but as that interface is assigned dynamically I don't think it is read.
I would be happy to find a simple command line solution as I can script it to run when I want.