Aliased ip's and DHCP

Shane Kerr Shane_Kerr at isc.org
Tue Nov 13 08:51:44 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Javier,

Javier Ubillos wrote:
> I'm using an ISPwho's (amazingly) limiting bandwidth per IP (and not
> per port/NIC).
> 
> At home I'm using a linuxbox as a router/firewall for the other
> computers, and the ISP gives me 5 IP's
> Now I'd like to make use of these IPs.
> 
> The IPs are assigned via DHCP and I only have (/want to use) one NIC.
> 
> I have done some testing with aliased ips using e.g. "ifconfig eth0:1
> 192.168.0.1 netmask 255.255.255.0". However I have had no success
> trying to assign an IP using DHCP.
> 
> I'm getting the error "Error, eth0: dhcpcd already running on pid 8906
> (/var/run/dhcpcd-eth0.pi"
> 
> Is it possible to do this and how?
> 
> I'm using gentoo (2.6.18-gentoo-r3).

Warning: The Gentoo DHCP client is not from ISC, so I'm not really that familiar
with the code. You can install the ISC client if you want, with "emerge dhcp".
You configure Gentoo to use it by changing your /etc/conf.d/net to include:

modules=( "dhclient" )

However the real problem is basically that only one DHCP client can run at a
time per interface - meaning real, physical interface, not an aliased interface.
This is because something needs to see all DHCP packets for that device to look
for messages from DHCP servers - and this is the DHCP client in most Unix platforms.

It is *possible* to have a DHCP client that requests multiple addresses. The
client would have to use a unique client identifier for each request, and even
then some servers might use the hardware address of the client (which would make
the request for different addresses fail). I don't know of any clients that do
this - it's pretty antisocial in the general case (although not for your
specific case).

The best thing would probably be to get a list of IP addresses from the ISP and
configure them statically. You can then possibly set your client to request the
configuration information without getting an address (this is the DHCPINFORM
message), if you need to get this information from DHCP.

- --
Shane
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOWWYMsfZxBO4kbQRAqadAJ97EgHgU8IYMcm6tzeqkrhO48UfpgCg0OIs
A2yRepc8Axyae3beYFBkrQU=
=c7xE
-----END PGP SIGNATURE-----


More information about the dhcp-users mailing list