Help - Search - Members - Calendar
Full Version: Ethernet Configuration lost on shutdown
Linuxhelp > Support > Technical Support
AH7
Sometime back, I configured my small Debian linux server to use a fixed IP address on my network.

Coming back to the server after a short absence, I needed to reconfigure the fixed IP address for a new network. To do this I use the command:

ifconfig eth0 192.168.2.nn

All well and good. I can then fire up PuTTY to find the server and off I go. Only one problem though, everytime I shutdown, I need to reconfigure the fixed ethernet adddress again. My previous configuration is always lost. I have tried "doctoring" my etc/hosts file with an entry showing the server name and the assigned IP address. This doesn't seem to make any difference.

Any help to permanently configure my ethernet card would be gratefuly received !!!

AH7
michaelk
The ifconfig command does not save settings to a configuration file.
/etc/hosts is a local file for resolving URLs to IP address it does not effect any other configuration file.

Check your /etc/network/interfaces file. Modify it to look like the following for the lines relating to eth0. It would be wise to save the file prior to changing it just in case something goes awry.

auto eth0
iface eth0 inet static
address 192.168.0.2.xx
netmask 255.255.255.0

Change xx to match your actual IP address.
AH7
Many thanks....

When I configured etc/network/interfaces it had a line of comment explaining that the file had been setup automatically as part of the Debian install I did. I must have provided the fixed IP address but, unfortunately, I hadn't remembered and/or wasn't aware of the file it changed !

Still in very early stages of getting to grips with Linux but am already sure that it well worth the time and effort !

Thanks again for your help !

AH7
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.