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.
Debian Server IP not static
- hs5424
- Thread is marked as Resolved.
-
-
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
-
Thanks crazi,
I see yours is static. I need to change mine to static also. What is the best way to change it. I am trying with putty but no luck yet. Is using putty the correct way to go about this.
Thanks -
Quote
Is using putty the correct way to go about this.
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..
-
Yeah buddy putty is all i use for ssh tbh...
regards
-
Thanks master G.
Can you give me some details of the exact way I need to make the IP static.
Thanks in advance. -
Depends on your router, but look on your router html page for Lan Settings and address reservation...
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
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.
-
Thanks for that.
I think that what happened as my server was off for a while. I will give it a go and let you know how I get on. -
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
-
Thanks mate,
I will give it a go. I will get back to you win or lose. -
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!