Community discussions

MikroTik App
 
Inssomniak
Member
Member
Topic Author
Posts: 332
Joined: Fri Apr 13, 2007 11:21 pm

Methods to use VPN as default GW

Sun Nov 14, 2010 4:04 pm

Hi all. Im looking for ideas and methods to use a VPN tunnel (IPIP/IPsec) as a default gateway, but of course not killing off the default gateway the tunnel is using. There wont be any NAT performed until the traffic reaches the other end of the VPN tunnel.

Thanks!
 
roadracer96
Forum Veteran
Forum Veteran
Posts: 736
Joined: Tue Aug 25, 2009 12:01 am

Re: Methods to use VPN as default GW

Sun Nov 14, 2010 5:48 pm

Never done it, but policy routing or a VRF should do it. Simply putting the LAN interface and the tunnel interface in the same VRF and leaving the WAN interface in the main routing table would probably do it. Then just add a second default gateway in the LAN/tunnel VRF dst of 0.0.0.0 gateway of remote vpn ip.
 
Inssomniak
Member
Member
Topic Author
Posts: 332
Joined: Fri Apr 13, 2007 11:21 pm

Re: Methods to use VPN as default GW

Mon Nov 15, 2010 1:17 am

Never done it, but policy routing or a VRF should do it. Simply putting the LAN interface and the tunnel interface in the same VRF and leaving the WAN interface in the main routing table would probably do it. Then just add a second default gateway in the LAN/tunnel VRF dst of 0.0.0.0 gateway of remote vpn ip.
Ive never done this either (had to google VRF), but Im not using MPLS on this network, will mikrotiks VRF work without MPLS?
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: Methods to use VPN as default GW

Mon Nov 15, 2010 1:41 am

Yes.
 
Inssomniak
Member
Member
Topic Author
Posts: 332
Joined: Fri Apr 13, 2007 11:21 pm

Re: Methods to use VPN as default GW

Mon Nov 15, 2010 1:52 am

Yes.

I googled around about this VRF and there isnt a lot of info, any simple examples ? seems I still have to mark traffic with routing marks still so Im not sure how VRF is advantageous to using the main routing table with marks.?


I have a wan interface, and an IPIP tunnel over it to another mikrotik, and I want LAN traffic to go out the IPIP tunnel by default (not natted).
 
roadracer96
Forum Veteran
Forum Veteran
Posts: 736
Joined: Tue Aug 25, 2009 12:01 am

Re: Methods to use VPN as default GW

Mon Nov 15, 2010 2:42 am

/ip route vrf add interfaces=ether1,ipip1 routing-mark=vpn-lan

Then all the routing that happens on the ether1 and ipip1 interface will happen in its own routing table called vpn-lan.

I think it should work. I use VRFs, but not for default gateway, just for private VPNs. MPLS is just for distributing the private routing tables across broad networks.
 
Inssomniak
Member
Member
Topic Author
Posts: 332
Joined: Fri Apr 13, 2007 11:21 pm

Re: Methods to use VPN as default GW

Mon Nov 15, 2010 2:52 am

/ip route vrf add interfaces=ether1,ipip1 routing-mark=vpn-lan

Then all the routing that happens on the ether1 and ipip1 interface will happen in its own routing table called vpn-lan.

I think it should work. I use VRFs, but not for default gateway, just for private VPNs. MPLS is just for distributing the private routing tables across broad networks.
So I would add a default route 0.0.0.0/0 via tunnel IP and select vpn-lan as the routing mark?
 
roadracer96
Forum Veteran
Forum Veteran
Posts: 736
Joined: Tue Aug 25, 2009 12:01 am

Re: Methods to use VPN as default GW

Mon Nov 15, 2010 3:35 am

Yep.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Methods to use VPN as default GW

Mon Nov 15, 2010 3:26 pm

hmmm... why not just use policy routing? actually, VRFs in RouterOS are PBR-based...

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], GoogleOther [Bot], McSee, RobertsN, silviub and 47 guests