Operating System - Linux
1822349 Members
5133 Online
109642 Solutions
New Discussion юеВ

Need to change from static IP to DHCP on Debian 3.1

 
Jay Bollyn
Honored Contributor

Need to change from static IP to DHCP on Debian 3.1

When I installed Debian, I followed the installation prompts to assign a static IP address, which is working. I would now like to change that, to pick up its address from a bootp server on my network.

Could someone give me step-by-step instructions?

TIA - J.
check Facebook
11 REPLIES 11
Ivan Krastev
Honored Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

Just edit interfaces file:

vi /etc/network/interfaces

find your card - eth1 for example and change to:
iface eth1 inet dhcp

after that : /etc/init.d/networking reload

and you will be on dhcp for that interface.

For more see "man interfaces"

regards,
ivan
Sheriff Andy
Trusted Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

Just to add.

Make sure you don't have any references in your hosts file as well.

/etc/hosts
Jay Bollyn
Honored Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

I changed 'static' to 'dhcp', commented out the static lines, and tried to restart networking. It looks like I am missing the dhclient.eth0.pid file, and as a result, a DHCP server could not be found on the network. I rebooted, did not help. So I logged onto the console and edited interfaces back to a static configuration, and ran 'networking restart', which is now connected to the network.

Any idea what I have done wrong?

nat-12-157:/etc/init.d# ./networking reload
Usage: /etc/init.d/networking {start|stop|restart|force-reload}
nat-12-157:/etc/init.d# ./networking restart
Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...cat: /var/run/dhclient.eth0.pid: No such file or directory
ifup: interface lo already configured
Internet Software Consortium DHCP Client 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

Listening on LPF/eth0/00:06:5b:1c:05:e9
Sending on LPF/eth0/00:06:5b:1c:05:e9
Sending on Socket/fallback/fallback-net
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 19
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
No DHCPOFFERS received.
No working leases in persistent database.

Exiting.

Failed to bring up eth0.
done.
check Facebook
Sheriff Andy
Trusted Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

What is it saying in your /var/adm/syslog?

Did you edit the /etc/dhclient.conf? Do a man on dhclient.
Sheriff Andy
Trusted Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

Jay,

What happens when you run the following command?

# dpkg -l | grep -i dh
Jay Bollyn
Honored Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

It looks like I need to edit the sample dhclient.conf file, and write it to /var/run/dhclient.eth0.pid, and then restart networking. I am not sure I edited the file correctly, because I still did not get an addr from our bootp server.

I might look at this again next week.

J.
check Facebook
Heironimus
Honored Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

The pid file is not a configuration file, and you shouldn't manipulate it directly. There isn't much to configure for a DHCP client. Is there any logging on your bootp server to say if it saw a request at all?
Jay Bollyn
Honored Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

That server is in the office, and I am at home for the weekend.

I am installing sarge on a test Sony Vaio laptop. I think my main problem will be that the laptop needs to connect to my home network with a 'Dell wireless 1450 USB adapter'. Do I have any hope of getting Debian installed under these circumstances?

J.
check Facebook
Maarten Verwijs
Advisor

Re: Need to change from static IP to DHCP on Debian 3.1

You have a fighting chance, since it appearently works on the Debian-based Ubuntu:

http://www.ubuntuforums.org/showthread.php?t=49071

Use google for more hits on how to solve this.

--mverwijs
Jay Bollyn
Honored Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

I think I will just use a wire NIC in this laptop. (This should be in another thread anyway.)

Regarding my main issue in this thread, I think I will just install sarge on another similar PC which is in my bootp server from the getgo, and compare the two.

Thanks all - J.
check Facebook
Jay Bollyn
Honored Contributor

Re: Need to change from static IP to DHCP on Debian 3.1

J.
check Facebook