Community discussions

MikroTik App
 
User avatar
kiler129
Member
Member
Topic Author
Posts: 354
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

[BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Sun Jan 08, 2017 9:11 am

I'm currently running EoIP between two locations, one of them has dynamic IP (and there's precisely 0% chance to get a static one there). EoIP on the side with static IP has following configuration:
/interface eoip add 
	allow-fast-path=no
	arp=proxy-arp
	ipsec-secret=[SHARED_KEY]
	keepalive=2s,2 
	local-address=[STATIC_WAN_IP]
	mac-address=00:00:5E:80:20:05 
	name=eoip-remote-location
	remote-address=remote.location.domain.com
	tunnel-id=2
On the other side, where IP is dynamic configuration looks as follow:
/interface eoip add
	allow-fast-path=no
	arp=proxy-arp
	ipsec-secret=[SHARED_KEY]
	keepalive=2s,2
	local-address=[DYNAMIC_WAN_IP]
	mac-address=00:00:5E:80:20:06
	name=eoip-home-location
	remote-address=home.location.domain.com
	tunnel-id=2
There're two problems:
1. Local address cannot be a domain - you can type it, but it will be resolved only once. It works properly, for quite some time, for remote address however (wtf?)
2. The bigger problem and the bug hits where WAN IP changes and configuration needs to be updated on remote location. Changing the address changes it on interface only where all IPSec stuff like policy stays with old address. Since elements created in IPSec are dynamic you cannot alter them. This effectively makes impossible to change the IP or e.g. use script to change it. The worst part of that is the only way I've found to change the IP is to completely remove interface and re-add it (which of course creates gigantic mess in other places like firewall).


I performed all tests on 6.37.3, since 6.38 is not production-stable yet. Is anyone has any suggestions?
 
User avatar
kiler129
Member
Member
Topic Author
Posts: 354
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Sat Jan 21, 2017 9:02 am

Bump.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10234
Joined: Mon Jun 08, 2015 12:09 pm

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Sat Jan 21, 2017 12:07 pm

For some things you just need a static IP.
In this case you could think of running a VPN that overcomes this problem and another EoIP on
top of that, but it all becomes very messy.

Well, EoIP is already messy to start with, so maybe it is better to do some network re-design.
 
User avatar
kiler129
Member
Member
Topic Author
Posts: 354
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Sat Jan 28, 2017 6:42 am

@pe1chl: The thing is no VPN offers such flexibility and messing with VPN+EoIP is horrible. I just can't understand why static IP is implemented for remote only? The check is done before connection attempt is made - I don't see problem with doing the same with local IP.
Probably it's not implemented because of this bug - even if you change IP everything stays with old one without any chance of changing it...
 
pe1chl
Forum Guru
Forum Guru
Posts: 10234
Joined: Mon Jun 08, 2015 12:09 pm

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Sat Jan 28, 2017 12:02 pm

There are limits to what the underlying IPsec code can do - it essentially assumes static addresses.
However, you can always write a script that changes the static configuration when your WAN address
has changed.
 
User avatar
kiler129
Member
Member
Topic Author
Posts: 354
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Thu Mar 02, 2017 9:27 am

I wish it is possible! The script wouldn't be a problem, but if you change the local IP on EoIP with IPSec policies aren't updated and they cannot be changed since they're dynamic...
 
y64xkuo
newbie
Posts: 37
Joined: Wed Jan 13, 2016 11:11 am

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Sat Mar 04, 2017 11:03 pm

I wish it is possible! The script wouldn't be a problem, but if you change the local IP on EoIP with IPSec policies aren't updated and they cannot be changed since they're dynamic...
Is the IPsec policy automatically generated from EoIP or have you created is manually? I think a script would solve your problem, but will break the connection a few seconds.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7054
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Mon Mar 06, 2017 12:52 pm

Try to disable/enable eoip tunnel after changing local-address.
 
User avatar
kiler129
Member
Member
Topic Author
Posts: 354
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Mon May 01, 2017 8:44 am

Is the IPsec policy automatically generated from EoIP or have you created is manually?
Generated.
I think a script would solve your problem, but will break the connection a few seconds.
It's not a huge deal - working with dynamic addressed connections is already a PITA and everyone needs to be aware of compromises ;)
Try to disable/enable eoip tunnel after changing local-address.
6.38 seems to partially fix the problem - before that cycling the interface or even restarting whole router had no effect. Why I'm saying it's fixed partially? Well, there's no way to listen for any events in scripts, so I cannot effectively check for new IP on connection.
Could you maybe sneak peek why implementing remote-address auto-resolve wasn't a problem but local-address has to be fixed and cannot be resolved before connection is initiated?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10234
Joined: Mon Jun 08, 2015 12:09 pm

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Mon May 01, 2017 11:02 am

I agree with you that a nice wishlist item would be to be able to use symbols referring to dynamic addresses in all places
where fixed addresses have to be configured now. When the address changes, that particular item would be automatically
reconfigured. It would trigger the config change e.g. when the DHCP Client receives a new address or when a PPP
link gets a new address.
 
sid5632
Long time Member
Long time Member
Posts: 554
Joined: Fri Feb 17, 2017 6:05 pm

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Mon May 01, 2017 12:40 pm

When the address changes, that particular item would be automatically
reconfigured. It would trigger the config change e.g. when the DHCP Client receives a new address or when a PPP
link gets a new address.
Addresses can change without either of those two events occurring, so you'd still need to check periodically.
Given that, it seems pointless to check on those events. You'd just rely on the periodic check alone.
So, how often are you going to check?
 
User avatar
kiler129
Member
Member
Topic Author
Posts: 354
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

Re: [BUG] EoIP w/ automatic IPSec is useless and stale after IP change

Sun May 07, 2017 8:15 pm

You'd just rely on the periodic check alone.
So, how often are you going to check?
Actually for purpose of tunnels it can be easily bind to the tunnel connection itself, like remote-address now. If the tunnel disconnected ROS should resolve names, create policies and attempt connection like it's doing with remote-address. If connection is still alive (and it's guaranteed by ping check on route) there's no need to update neither of the addresses.

Who is online

Users browsing this forum: Bing [Bot], bobr, dcavni, infabo, Onas, tim427 and 132 guests