Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a local DHCP Server running on 10.04 want have a few host entries so that the machines can just use DHCP but allows me to route traffic to them via IPTABLES. One of them is a Windows 2008 server and it allows me to assign multiple IP's to one card if I use static IP's. Is there a way to do this if it is using DHCP?

Looking at http://linux.die.net/man/5/dhcpd.conf I don't think it is, at least the attempt I had didn't work. As I understand it the following would just choose the best IP and assign it that one, rather than all of them:

host mymachine {
    hardware ethernet 00:00:00:00:00:00;
    fixed address 192.168.10.96, 192.168.10.97;
}

EDIT

everything I have read would suggest this is not possible. Hope someone can prove me wrong, or show an alternative way of dealing with this so that all IP's are dealt with at a central location and machines can have more than one IP (dev and web servers).

share|improve this question

closed as too localized by Luis Alvarado Mar 14 '13 at 17:17

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

Do you really need to give out multiple IPs for devices to get traffic routed to them using iptables? For webservers, it may be easier to use a single IP and different ports, or just use virtual hosts in Apache, for example.

It doesn't appear to me as if giving multiple IPs to an interface using DHCP is really possible. at least the manual for dhcpd.conf doesn't mention it is:

The fixed-address declaration is used to assign one or more fixed IP addresses to a client. It should only appear in a host declaration. If more than one address is supplied, then when the client boots, it will be assigned the address that corresponds to the network on which it is booting. If none of the addresses in the fixed-address statement are valid for the network to which the client is connected, that client will not match the host declaration containing that fixed-address declaration. Each address in the fixed-address declaration should be either an IP address or a domain name that resolves to one or more IP addresses.

Which means you can put more than one address, but they need to be in different subnets (according to the subnet configuration in dhcpd as well). FWIW, I don't recall seeing a DHCP client which supports giving out more than one IP for an interface... that's even if other applications like NetworkManager supports it.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.