Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to use DHCP to pick up the network configuration information including DNS, but still assign a static IP address.

On OS X, this is "Using DHCP with manual address", but I see no similar configuration option for ubuntu in the GUI, and I can't find any information about how to configure /etc/network/interfaces to do that.

share|improve this question
For what it's worth, I have this exact same question. It looks like perhaps the right answer for me is from @Khaled, though... has anyone gotten that to work? The syntax given is a null-op for me. – Dav Clark Aug 8 at 6:15
Actually, it was working, I just didn't see it (per my ip addr show comment below). – Dav Clark Aug 8 at 7:25

2 Answers 2

Or you can just set up IP address reservations in your DHCP server. This associates IP addresses with specific MAC addresses, so that the same network interface always gets the same IP address. Consult your DHCP server documentation for details.

share|improve this answer
That's what I normally do, but apparently that's not possible with the DHCP server we're using (Cisco ASA 5505) - it doesn't support DHCP reservations. Yes, I could switch to another machine for running the DHCP server, but that is more work than what my question is asking. – fields Jan 15 '13 at 18:30

You can append the following line to your /etc/network/interfaces file:

post-up ip addr add dev eth0

Of course, you can change the IP/mask and interface name to suit your needs.

share|improve this answer
That will still use up an ip address reservation slot from the dhcp pool though, right? – fields Jan 15 '13 at 15:31
This will just execute the ip utility to assign additional IP address whenever the interface becomes up. – Khaled Jan 15 '13 at 15:34
Ideally, I don't want it to grab an ip address from the dhcp pool at all. – fields Jan 15 '13 at 15:37
That's the entirety of my question - how to assign a static IP address while still using DHCP for the other configuration information. This should be possible somehow. – fields Jan 15 '13 at 15:41
@DavClark: See man interfaces. – Khaled Aug 8 at 7:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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