There have been various questions asked a long time ago about obtaining two IP addresses via DHCP on Linux. Most of those are still relating to old 'alias interfaces', like eth0:0
, which has been deprecated for a long time.
As referenced in this question, it should be possible to get multiple IP addresses by using send dhcp-client-identifier
with different values, and indeed there is a partial example of this in the manual page for dhclient.conf
But that refers to "you must also provide a separate client script for the pseudo-interface" to configure it. Such a script would presumably need to run ip address add
and ip address del
for the secondary IP address when the DHCP client reaches the right states.
Is there any example anywhere out there of a working version of such a script? And will it work with the default script for the primary address (which seems to be very enthusiastic in deleting any and all other IP addresses on the interface)
Has anyone ever got such a setup to work?