Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to change dhcp to static

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
purrkur
Posts: 4
Joined: 2004-09-27 06:34
Location: Stockholm

How to change dhcp to static

#1 Post by purrkur »

While building a new machine to replace a running one, I used Debian Sarge installer RC1 and everything went fine. The new machine will take over the old one but during the installation I had both up and running. The old machine has a static IP so I used dhcp on the new one during the install process in order to get things up and running quickly.

Now I am ready to shut down the old one and make the new one take it's place with a static address as well as the same hostname. I have never done this before so I was wondering if there was any simple way (like dpkg-reconfigure) that I could reconfigure the whole networking part of the installation. I don't need the dhcp stuff either so I would like to remove that as well.

Any help would be appreciated.
"If you don't know where you 're going, you'll end up somewhere else"

-- Alfred Adler (1870-1937), Austrian psychiatrist

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#2 Post by lacek »

The most simple way, I think, is to copy the /etc/network/interfaces file from the 'old' computer to the 'new' one.
This way, you don't need anything but copy the file and restart /etc/init.d/networking.

I don't know how to ask dpkg to let you reconfigure the network, but editing the interfaces fole is pretty straightforward. See interfaces(5) for more info.

purrkur
Posts: 4
Joined: 2004-09-27 06:34
Location: Stockholm

#3 Post by purrkur »

lacek wrote:The most simple way, I think, is to copy the /etc/network/interfaces file from the 'old' computer to the 'new' one.
This way, you don't need anything but copy the file and restart /etc/init.d/networking.

I don't know how to ask dpkg to let you reconfigure the network, but editing the interfaces fole is pretty straightforward. See interfaces(5) for more info.
how about the dhcp stuff? Won't that be working in the background trying to pull an IP, build resolv.conf and so on even though I change the interfaces file?
"If you don't know where you 're going, you'll end up somewhere else"

-- Alfred Adler (1870-1937), Austrian psychiatrist

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#4 Post by lacek »

how about the dhcp stuff? Won't that be working in the background trying to pull an IP, build resolv.conf and so on even though I change the interfaces file?
No. The network settings are done according the interfaces file, so dhcp won't start. Anyway, you can remove the DHCP client after you copied the file.

Guest

#5 Post by Guest »

Thanks lacek. That did the trick for me!

Post Reply