Routing between two interfaces

I have a droplet running OpenVPN-AS. I connect to this server to surf the internet when I am using hostile wifi or unsecure networks (OpenVPN client IP 172.27.234.X). The OpenVPN-AS server connects to OpenVPN on a Linksys router to access my internal home network. I can ping and access the IPs on my home network from the server. I would like to route ONLY traffic for my home network over the tunnel on the server.


my iPhone (172.27.234.x) ----connects to----> OpenVPN-AS Digital Ocean Server (172.19.13.x) ----connects to----> OpenVPN on Linksys home router ----connects to----> internal home network (172.16.222.x)

Right now the iPhone connects perfectly routing all traffic through OpenVPN-AS and receiving an IP from OpenVPN-AS of 172.27.234.x.

OpenVPN-AS connects to OpenVPN Linksys

OpenVPN-AS is assigned an IP to tun0 of 172.19.13.x

OpenVPN Linksys allows access to 172.16.222.x

I would like iPhone to be able to client into OpenVPN-AS surf the net from OpenVPN-AS’s internet but be able to access anything in 172.16.222.x.

Here’s OpenVPN-AS’s routing table route-n

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 64.x.x.x UG 0 0 0 eth0 U 0 0 0 eth0 64.x.x.x U 0 0 0 eth0 UG 0 0 0 tun0 U 0 0 0 tun0 U 0 0 0 as0t0 U 0 0 0 as0t1 U 0 0 0 as0t2 U 0 0 0 as0t3 U 0 0 0 as0t4 U 0 0 0 as0t5 U 0 0 0 as0t6 U 0 0 0 as0t7


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!