Debian Server IP not static

There are 14 replies in this Thread which was already clicked 705 times. The last Post () by hs5424.

  • Hi all,
    I need help in trying to set my debian server IP to static.
    I thought I had acheived this weeks back but I was wrong. After server was switched off for a long period it came back on with a new IP address.
    I use winScp and can access the network settings but when I change from DHCP to static I get the notice 'cannot overwrite remote file'.
    Can I use putty or some other tool to change the setting. Simple instructions please as I am a complete novice.
    Thanks in advance.

  • Hi bud i have debian on my raspberry pi,


    sudo cp /etc/network/interfaces /etc/network/interfaces.sav ( is to back up the interface settings)


    sudo vi /etc/network/interfaces


    This is what ive got in my file:-


    iface eth0 inet static


    address 192.168.0.110


    netmask 255.255.255.0


    gateway 192.168.0.1



    then type :wq and press enter


    That saves..


    sudo /etc/init.d/networking restart (To restart network)




    Hope this helps


    Regards

  • Hi All,
    Just as I thought I had my static IP sorted I messed up all network settings. I was using WinScp and was logged in as root etc/network/interfaces. I changed dhcp to static and it appeared to accept my changes. I then rebooted the server using putty and reboot command. When reboot was completed I could not connect to the server. I had a look at the network settings at the server using the Gnome interface. The IPv4 settings which previously showed the server IP (192.168.1.127) now displays 0.0.0.0.
    Is there any way to undo my mess.
    I am definitely learning the hard way.
    Thanks in advance

  • Hi bud i have debian on my raspberry pi,


    sudo cp /etc/network/interfaces /etc/network/interfaces.sav ( is to back up the interface settings)


    sudo vi /etc/network/interfaces


    This is what ive got in my file:-


    iface eth0 inet static


    address 192.168.0.110


    netmask 255.255.255.0


    gateway 192.168.0.1



    then type :wq and press enter


    That saves..


    sudo /etc/init.d/networking restart (To restart network)




    Hope this helps


    Regards[/QUOTE]
    Hi crazi,
    I followed your instructions and put sudo vi /etc/network/interfaces in root terminal. I am then presented with a list of what looks like a list of previous network interface setups with a time, date and ID number for each entry. The bottom of the page has some options. One of them is R (recover). Is this a facility to roll back to a previous seup. If so how do I go about this.
    I want to avoid a total re install of debian to get the network back up and running.

  • have a look here


    Code
    http://wiki.debian.org/NetworkConfiguration#Configuring_the_interface_manually


    This is exactly the guide i followed to change to static - it is better to assign the MAC address of your device to a fixed ip on your router because a conflict could happen if DHCP assignes the IP address you have fixed on your server to another device while your server is turned off.

    If I take a while to respond, you can see why.....


    :red:

  • Yes putty is the correct tool for SSH, you should also have an option in your router menu to assign a static ip address for all devices..


    Thanks master G.
    My network interfaces eth0 says static with no subnet or gateway information shown. If I open root terminal and go to /etc/network/interfaces I am not allowed to make changes. I thought that when I log on to root with its password I should then be able to edit or input my own ip configs. Maybe I am going about this the wrong way. Is there any way to roll back linux to an earlier time before I messed up the interface.
    Any help appreciated.
    Thanks again.

  • nano /etc/network/interfaces


    that should get you in and able to change mate?


    Add the relevent bits of info


    Ctrl + X and Save and Reboot



    lssdalogo.png



    "Don't Gain The World & Lose Your Soul, Wisdom Is Better Than Silver Or Gold"
    “Herb is the healing of a nation, alcohol is the destruction”



  • Thanks mrgmx,
    Success at last. The nano /etc/network/interfaces command you suggested did the trick. I got a little confused then I got to the save ctrl + X command as I was presented with some options at the bottom of the page. However I typed reboot + enter and after rebooting all appears back online again. I checked using Gnome also and all settings are now restored in interfaces. Just discovered that 'nano' is necessary for editing etc. Well this old timer has to start somewhere.
    Thanks again.
    hs5424

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!