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

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Skynet86
OpenVpn Newbie
Posts: 7
Joined: Sun May 17, 2020 2:21 pm

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

Post by Skynet86 » Sun May 17, 2020 2:52 pm

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
Last edited by Skynet86 on Mon May 18, 2020 5:43 am, edited 1 time in total.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Sun May 17, 2020 3:51 pm


Skynet86
OpenVpn Newbie
Posts: 7
Joined: Sun May 17, 2020 2:21 pm

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

Post by Skynet86 » Sun May 17, 2020 4:06 pm

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.

Skynet86
OpenVpn Newbie
Posts: 7
Joined: Sun May 17, 2020 2:21 pm

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

Post by Skynet86 » Sun May 17, 2020 4:11 pm

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?

Skynet86
OpenVpn Newbie
Posts: 7
Joined: Sun May 17, 2020 2:21 pm

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

Post by Skynet86 » Mon May 18, 2020 5:41 am

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

Skynet86
OpenVpn Newbie
Posts: 7
Joined: Sun May 17, 2020 2:21 pm

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

Post by Skynet86 » Mon May 18, 2020 3:39 pm

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

Post Reply