Bug #3997
closed
get_interface_ip() returns first IP on interface, not necessarily primary IP
Added by Chris Buechler almost 10 years ago.
Updated over 8 years ago.
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.
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.
- Target version changed from 2.2 to 2.2.1
We'll review Ermal's patch post-2.2.
- Target version changed from 2.2.1 to 2.2.2
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.
On which scenario and which version this happens?
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.
Can you share your interfaces config or all of it so i can replicate that?
- Target version changed from 2.2.2 to 2.2.3
- Target version changed from 2.2.3 to 2.3
- Status changed from New to Confirmed
Same issue here, as stated in issue #5136.
Let me know if I can provide something useful.
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.
- 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.
- Status changed from Feedback to Resolved
- Related to Regression #11545: Primary interface address is not always used when VIPs are present added
Also available in: Atom
PDF