How to change dhcp to static

Kernels & Hardware, configuring network, installing services

How to change dhcp to static

Postby purrkur » 2004-09-27 16:45

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
purrkur
 
Posts: 4
Joined: 2004-09-27 06:34
Location: Stockholm

Postby lacek » 2004-09-27 18:22

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.
lacek
Moderator Team Member
 
Posts: 769
Joined: 2004-03-11 18:49
Location: Budapest, Hungary

Postby purrkur » 2004-09-27 19:31

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
purrkur
 
Posts: 4
Joined: 2004-09-27 06:34
Location: Stockholm

Postby lacek » 2004-09-28 08:50

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.
lacek
Moderator Team Member
 
Posts: 769
Joined: 2004-03-11 18:49
Location: Budapest, Hungary

Postby Guest » 2004-09-28 15:14

Thanks lacek. That did the trick for me!
Guest
 


Return to System configuration

Who is online

Users browsing this forum: No registered users and 18 guests

fashionable