-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assign an IPv4 address from the link-local subnet #833
Conversation
f4d95fd
to
081bbe7
Compare
While the 192.0.2.0/24 TEST-NET-1 block would avoid collisions, the 169.254.0.0/16 subnet described in RFC3927 has been specified precisely for such cases. We should probably select "an address using a pseudo-random number generator with a uniform distribution in the range from 169.254.1.0 to 169.254.254.255 inclusive" as described in RFC3927. However, that would of course require more code and I'm lazy, but more importantly it had been reported that FortiClient uses 169.254.2.1. I'd rather use the same address as FortiClient.
081bbe7
to
45e12d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back in #280 we had a discussion if this address does really matter. We came to the conclusion that an arbitrary address could be used here for building up the communication over ppp. It's send as a proposal and the remote side uses it until dhcp has assigned a proper address.
The only problem I see is that a host route to this address is added via the ppp interface. The link local addresses can coexist on different links and they don't need explicit routing as far as I know.
I'm not sure what happens if this particular address is used on several interfaces and an explicit host route via one particular interface is added. Does the communication on the other interfaces still work, even if the routing table would suggest to send the packets over the ppp link?
Not certain about the issues you raise either. I don't want to modify something that works, it's just that this IP address might have an effect on the VPN speed on macOS Mojave. |
@ultrafiber Do we really need to change |
I have given this change a try and here is the resulting routing table on Linux:
While there is already a class B network route on the ethernet device for the link local network, openfortivpn adds a host route over the ppp interface. So I must correct myself in this point:
There is a network route, and it would still work even if we add a host route to a single address of this network on a different interface. My expectation is that nothing gets broken unless something else (another instance of openfortivpn?) uses |
@mrbaseman If I understand you correctly, the situation won't be worse with Then we could address Conflict detection and defense in Section 2.5 and Considerations for Multiple Interfaces in Section 3 later on. How soes this sound? |
Right, it's just that the But, given the fact that I'm connected with two instances of openfortivpn right now, which both use the |
The address you're discussing is the address of the remote end of a tunnel (that is, a point-to-point connection). It's utterly meaningless and a correct implementation of a point-to-point connection (such as a VPN tunnel) shouldn't attempt to route the "address of the remote end of the tunnel" in any way. 🤷♂️
In all the protocols supported by OpenConnect, including in the in-development support for Fortinet… we just ignore "remote end of a tunnel" addresses that we receive, and it works just fine. |
@dlenski Yet it looks like On the other hand the
We do omit the local IP address. We could try omitting the remote IP address. I seem to recall |
If you don't give pppd a remote address, it will attempt to negotiate one using IPCP:
I've verified that at least one Fortinet server is willing to do this negotiation (using
Yeah, this is probably because pppd is incorrectly trying to set up a route the peer's address. From
☝️ This behavior is essentially undesirable for tl;dr Setting it to a non-forwardable address definitely works as a bandaid. Reusing the same peer address |
I have verified that omitting the remote IP address ( Yet if I understand you correctly, the proper way to fix this is to stop forking |
While the 192.0.2.0/24 TEST-NET-1 block would avoid collisions,
the 169.254.0.0/16 subnet described in RFC3927 has precisely been
specified precisely for such cases.
We should probably select "an address using a pseudo-random number
generator with a uniform distribution in the range from 169.254.1.0
to 169.254.254.255 inclusive", as described in RFC3927. However,
that would of course require more code and I'm lazy, but more
importantly it had been reported that FortiClient uses 169.254.2.1.
I'd rather use the same address as FortiClient.
Fixes #832.