Hello everyone,
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.
/interface wireless setup-repeater number=wlan2 address=XX:XX:XX:XX:XX:XX ssid=MyHuaweiWIFI passphrase=MyPassword
Then I setup DHCP client adding default route with distance 2
/ip dhcp-client add interface=bridge disabled=no add-default-route=yes default-route-distance=2
It acquires IP address from my Huawei (192.168.8.8 for example)
Connect to my vpn adding default route with distance 1
/interface pptp-client add name=pptp-out1 user=MyUserName password= MyPasswordForVPN connect-to=46.1.101.100 disabled=no add-default-route=yes
MikroTik connect without a problem and pptp-out1 is reachable.
I get routes like this:
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibitDST-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 46.1.101.100/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
Setting up nat
/ip firewall nat add action=masquerade chain=srcnat out-interface= pptp-out1
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.
Then I tried to remove default route for VPN and set up Policy Based Routing
/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
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?
