I’m new at MikroTik, and I have some problems to set up VPN and route all my traffic through it.
First off all I have Huawei E5372 working at 5GHz, so I set up a repeater on my hap ac2 wlan2 interface.
Then I setup DHCP client adding default route with distance 2
/interface wireless setup-repeater number=wlan2 address=XX:XX:XX:XX:XX:XX ssid=MyHuaweiWIFI passphrase=MyPassword
It acquires IP address from my Huawei (192.168.8.8 for example)
/ip dhcp-client add interface=bridge disabled=no add-default-route=yes default-route-distance=2
Connect to my vpn adding default route with distance 1
MikroTik connect without a problem and pptp-out1 is reachable.
/interface pptp-client add name=pptp-out1 user=MyUserName password= MyPasswordForVPN connect-to=126.96.36.199 disabled=no add-default-route=yes
I get routes like this:
Setting up natFlags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS 0.0.0.0/0 pptp-out1 1
1 DS 0.0.0.0/0 192.168.8.1 2
2 ADS 188.8.131.52/32 192.168.8.1 0
3 ADC 192.168.1.1/32 192.168.8.3 pptp-out1 0
4 ADC 192.168.8.0/24 192.168.8.8 bridge1 0
Then I look up my ip (at https://www.whatismyip.com/) and it shows my Huawei IP, like I’m not connected to VPN, so my traffic doesn’t go through my VPN gateway.
/ip firewall nat add action=masquerade chain=srcnat out-interface= pptp-out1
Then I tried to remove default route for VPN and set up Policy Based Routing
But the result stays the same. I guess that is because there is a conflict between my routes to Huawei Modem and VPN. Is there any possible way to route all my traffic through vpn?
/ip firewall address-list add address=192.168.8.0/24 list=LocalAddress /ip firewall mangle add action=mark-routing chain=prerouting dst-address=0.0.0.0 dst-address-list=”!LocalAddress” new-routing-mark=VPN passthrough=yes src-address=192.168.8.0/24 /ip route add distance=1 gateway=pptp-out1 routing-mark=VPN