Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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
add comment

2 Answers

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
add comment

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

post-up ip addr add 192.168.0.1/24 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
    
@field: So, just assign a static IP instead. –  Khaled Jan 15 '13 at 15:38
    
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
add comment

Your Answer

 
discard

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.