Route all my traffic through a VPN

I created and OpenVPN in my mikrotik router.
It works fine but when i connect to the VPN from another network like my school’s network, all traffic dont goes to the VPN unless i specify a service in my home network.
As a consecuence i cant use some forbidden services like ftp, ssh because the traffic is blocked in the school’s firewall.
I would like to route all traffic to my home network to be able to access these services outside my network with encrypted data.
What should i do?

Just to make sure I am following correctly…

When you are referring to connecting to the VPN on your Mikrotik; are you talking about your Mikrotik is sitting at home and you are attempting to VPN from school to home? Or have you brought your Mikrotik with you and you are connecting it to the school’s network and having your computer connect through it?

If you have a VPN from your computer(at school) to the Mikrotik at home, you need to make sure that you have selected the option in the VPN settings to send all traffic to the VPN.

If it was the later option, you need to focus on your routing on the Mikrotik itself.

Yes, my Mikrotik is sitting at home and im attempting to VPN from school to home.
I dont know where is the option in settings to send all traffic to the VPN

You’re looking for this client option:

–redirect-gateway flags…
Automatically execute routing commands to cause all outgoing IP traffic to be redirected over the VPN. This is a client-side option.

This option performs three steps:

(1) Create a static route for the --remote address which forwards to the pre-existing default gateway. This is done so that (3) will not create a routing loop.

(2) Delete the default gateway route.

(3) Set the new default gateway to be the VPN endpoint address (derived either from --route-gateway or the second parameter to --ifconfig when --dev tun is specified).

When the tunnel is torn down, all of the above steps are reversed so that the original default route is restored.

Option flags:

local – Add the local flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The local flag will cause step 1 above to be omitted.

autolocal – Try to automatically determine whether to enable local flag above.

def1 – Use this flag to override the default gateway by using 0.0.0.0/1 and 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of overriding but not wiping out the original default gateway.

bypass-dhcp – Add a direct route to the DHCP server (if it is non-local) which bypasses the tunnel (Available on Windows clients, may not be available on non-Windows clients).

bypass-dns – Add a direct route to the DNS server(s) (if they are non-local) which bypasses the tunnel (Available on Windows clients, may not be available on non-Windows clients).

block-local – Block access to local LAN when the tunnel is active, except for the LAN gateway itself. This is accomplished by routing the local LAN (except for the LAN gateway address) into the tunnel.

ipv6 – Redirect IPv6 routing into the tunnel. This works similar to the def1 flag, that is, more specific IPv6 routes are added (2000::/4, 3000::/4), covering the whole IPv6 unicast space.

!ipv4 – Do not redirect IPv4 traffic - typically used in the flag pair ipv6 !ipv4 to redirect IPv6-only.

I dont understand what you want i do, im looking for options and everything in PPP>Interface>OVPN SERVER, PPP>Secrets, PPP>Profile…
I can see client recive a Private IP from the VPN pool but dont recieve any default gateway (ipconfig /all [TAP-Windows Adapter V9])

Hi,

I think Sob is reffering to openVPN client settings not into Mikrotik RB side. On school on your laptop/pc you have installed a OpenVPN client in order to make VPN connection to your MK at home, right ?

kind regards,

Now its solved, i added “redirect-gateway def1” at the end of the *.ovpn file and now it works.
In cmd using ipconfig /all i keep seeing the default gateway is empty but with the sniffer i can see now all the traffic going through VPN interface. And if i use the sniffer in wireless adapter all traffic is encrypted and im not able to see where im surfing, just my home public ip :smiley: .
Tomorrow i should be able to use ssh or other services in class 99% sure.
Thanks guys for the support!, i went crazy looking for options on server side :S

Im testing VPN at class right now and its working fine, thx all guys :wink: