Bug #3997
closedget_interface_ip() returns first IP on interface, not necessarily primary IP
0%
Description
In some circumstances, IPs can be added/removed from an interface in such ways that an interface's primary IP is no longer the first IP in ifconfig output. This leads to issues as described in #3811 and #2495 for instance.
Ermal's long since fixed most of these possibilities by ensuring consistency in IP change/add/remove. There are circumstances where this fails catastrophically though.
assigning to myself for further testing and analysis. Ermal, if you can add thoughts here it'd be appreciated.
Related issues
Updated by Ermal Luçi about 10 years ago
That does not have issues with the first ip address but rather no strict linkage of vip/carp interface to its information.
That is what the patch i sent re-enforces.
Updated by Chris Buechler almost 10 years ago
- Target version changed from 2.2 to 2.2.1
We'll review Ermal's patch post-2.2.
Updated by Chris Buechler almost 10 years ago
- Target version changed from 2.2.1 to 2.2.2
Updated by Mike Noordermeer almost 10 years ago
Just FYI, I have a bridge interface with x.x.x.106 as primary IP, and an IP alias x.x.x.105. This fails consistently, ending up with .105 as the primary IP.
Updated by Ermal Luçi almost 10 years ago
On which scenario and which version this happens?
Updated by Mike Noordermeer almost 10 years ago
2.1.5 and 2.2.0. After reboot the VIP becomes the primary IP, and all outbound traffic and firewall rules referencing 'bridge address' suddenly use the VIP instead of the interface IP, breaking things.
Updated by Ermal Luçi almost 10 years ago
Can you share your interfaces config or all of it so i can replicate that?
Updated by Mike Noordermeer almost 10 years ago
Interfaces config, slightly censored: https://gist.github.com/MikeN123/009bc5fb76347663e448
Virtual IP config, slightly censored as well: https://gist.github.com/MikeN123/86fd05a7fb4b3c1f75de
Please let me know if you need any additional information.
Updated by Mike Noordermeer almost 10 years ago
Oh, and bridges and gateway config: https://gist.github.com/MikeN123/22d50fa3d37834b9659a
Updated by Chris Buechler over 9 years ago
- Target version changed from 2.2.2 to 2.2.3
Updated by Chris Buechler over 9 years ago
- Target version changed from 2.2.3 to 2.3
Updated by Chris Buechler about 9 years ago
- Status changed from New to Confirmed
Updated by Guillaume Hilt about 9 years ago
Same issue here, as stated in issue #5136.
Let me know if I can provide something useful.
Updated by Chris Buechler almost 9 years ago
This happens with bridges during boot because in interfaces_configure, interfaces_vips_configure is run before the interface_configure of the bridge interface, which leaves the IP alias first. There are a variety of catch 22s there with dynamic interface types (GRE, gif at least) because they may be dependent on VIPs, and the bridge may be dependent on them.
It works upon applying changes on interfaces.php because that uses interface_reconfigure rather than interface_configure, the process of which removes the IP aliases and adds them back so their order is correct.
Updated by Chris Buechler almost 9 years ago
- Status changed from Confirmed to Feedback
what I just pushed fixes the bridge issue.
The subject issue still exists and is difficult because FreeBSD has no concept of a primary IP on an interface. The bridge scenario should be the only circumstance that was still an issue in 2.2.x and 2.3, as the remainder of interface types are all handled correctly in that regard to ensure appropriate order of IPs.
Leaving to feedback for a bit more testing.
Updated by Jim Pingle over 3 years ago
- Related to Regression #11545: Primary interface address is not always used when VIPs are present added