Page 1 of 1

OpenVPN client and server on Tomato router. Mobile access to client and LAN (policy routing)

Posted: Sun May 17, 2020 2:52 pm
by Skynet86
Hello community,

I specially registered in this forum to learn a few things that I cannot implement with my own knowledge.

My idea is the following:

I would like to access my home network and the internet connection provided by an OpenVPN client while on the go from my Android phone.

I successfully got an OpenVPN server up and running on my Tomato router (version 1.28 by shibby). Access on the go, as well as access to my home network works with the OpenVPN app without any problems.

Even after this
https://support.vyprvpn.com/hc/de/artic ... BCr-Tomato
Instructions set up OpenVPN client from Vypervpn runs without problems.

Unfortunately, I can't get both in combination.

I have been looking for a solution for many hours and days so far but have not found any. Maybe it is just too much input for a beginner like me and I do not see the right solution or have overlooked it.

Maybe someone can put me on the right track or tell me whether this project is as possible as I imagine it to be.

Here are a few of my configs.

My Client Config:

Code: Select all

client
dev tun
proto udp
remote XXX.XXX.com 1195
route-gateway 192.168.1.1
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert XXX.crt
key XXX.key
remote-cert-tls server
cipher AES-256-CBC
comp-lzo
verb 6
auth-user-pass
float
My Administration-Scripts-Firewall:

Code: Select all

iptables -A INPUT -p udp --dport 1195 -m state --state NEW -s 10.10.10.0/24 -j ACCEPT

Re: OpenVPN client and server on Tomato router. Mobile access to client and LAN

Posted: Sun May 17, 2020 3:51 pm
by TinCanTech

Re: OpenVPN client and server on Tomato router. Mobile access to client and LAN

Posted: Sun May 17, 2020 4:06 pm
by Skynet86
OK thank you. I have read the link, and unfortunately I have to say that I understand almost none of it.

Could you give me this concept in simple words.

Re: OpenVPN client and server on Tomato router. Mobile access to client and LAN

Posted: Sun May 17, 2020 4:11 pm
by Skynet86

Code: Select all

-A PREROUTING -m conntrack --ctstate NEW -i eth0 -j CONNMARK --set-mark 0x1
-A OUTPUT -m connmark --mark 0x1 -j CONNMARK --restore-mark

Code: Select all

ip route add default via 192.168.0.1 table 100
ip rule add fwmark 0x1 table 100
Where do I have to enter the specified lines? Administration scripts?

Re: OpenVPN client and server on Tomato router. Mobile access to client and LAN

Posted: Mon May 18, 2020 5:41 am
by Skynet86
I entered these lines under Administration - Scripts - Firewall

Code: Select all

-A PREROUTING -m conntrack --ctstate NEW -i eth0 -j CONNMARK --set-mark 0x1
-A OUTPUT -m connmark --mark 0x1 -j CONNMARK --restore-mark
and this one under WAN Up

Code: Select all

ip route add default via 192.168.0.1 table 100
ip rule add fwmark 0x1 table 100
but unfortunately it doesn't work. would be very nice if someone could help me. Thank you

Re: OpenVPN client and server on Tomato router. Mobile access to client and LAN (policy routing)

Posted: Mon May 18, 2020 3:39 pm
by Skynet86
I read a lot and added the following lines under Administration-Scripts-WAN UP.

Code: Select all

ip route add default via 192.168.1.1 table 10
ip rule add from 10.10.10.0/24 table 10
But unfortunately it doesn't work