Community discussions

MikroTik App
 
yegorovp
just joined
Topic Author
Posts: 8
Joined: Tue Mar 02, 2021 10:24 am

Routing exact IP thru VPN?

Tue Mar 02, 2021 10:41 am

Hello, guys!
You're my only hope =)

I have the following setup:
1) Linux server running OpenVPN Server. It has full access to the Internet and public IP 1.2.3.4. OpenVPN uses tun0 and static IP 10.8.0.1
2) Mikrotik hEX lite (i don't think the model really matter). It also has a full access to the Internet, but it's behind some other, uncontrolled router. It's connected to OpenVPN server via myvlan, IP 10.8.0.2.
3) OpenVPN tunnel is active, i can ping each other, using 10.8.0.*

I'm trying to route traffic from linux server to 100.1.1.1 through VPN tullel to Mikrotik and then to the internet, like shown on the picture. So I have
route add 100.1.1.1 via 10.8.0.2 dev tun0
on linux server:
$ ip route get 100.1.1.1
100.1.1.1 via 10.8.0.2 dev tun0 src 10.8.0.1 uid 1000
    cache
But I have lack of knowledge, what should I do on Mikrotik side? I thought that default masquerade aka "scrnat everything to Out. Interface List = WAN" would be enough, but I was wrong.

Image

Who is online

Users browsing this forum: Bing [Bot], mike7 and 53 guests