Solved

Linux - Change IP Address

Posted on 2007-04-03
5
2,553 Views
Last Modified: 2013-12-15
I have a customer that is using a Toshiba Magnia SG20 as a web server.  We need to change th IP Addrress on this server.  Normally I woul log onto the console and do just that, but sinc ethere is no monitor and keyboard on this device, what is the best way for me to change the IP Address?
0
Comment
Question by:rshooper76
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:rajendraone
ID: 18848233
Can it be accessed remotely I mean from current IP address. If you know the current IP address and if it has telnet or ssh enabled then try login to it and chang the IP address and restart the network service. Be careful that you do the things right before restarting.

Goodluck,
Rajen
0
 
LVL 8

Accepted Solution

by:
frashii earned 500 total points
ID: 18848629
There are a couple of different ways to change an IP address on a linux machine, but what you need to be careful of is that after a reboot, or after the network service is restarted it does not revert back to the previous one.

Each distro of Linux has its own way of doing things, and you are best off using the proper tools. Yes, a simple ifconfig script change might do the trick, but it might not 'stick' as a mentioned above.

What version of linux are you running ?

One of my favorite tricks when I do something dangerous is to set up a cron job that will 'reset' the IP address, firewall rule, etc every 5 minutes so that if I make a mistake, all I must do is wait 5 minutes for it to be put back. Once you sucessfully make the change, you delete the cron job. Once again, this requires knowledge of how you distro stores its configuration information.
0
 
LVL 9

Author Comment

by:rshooper76
ID: 18870115
It is running Debian.   I have used ifconfig commands to change this IP Address, but won't the IP Address change back when it's rebooted?
0
 
LVL 8

Expert Comment

by:frashii
ID: 18929820
The answer is the /etc/network/interfaces for debian.

Look for the line that has the interface you want to change, most probably eth0, but it could be another (Please do a ifconfig and check!)

Here is how a static IP looks :

iface eth0 inet static
       address 192.168.1.10
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255
       gateway 192.168.1.1
0
 
LVL 9

Author Comment

by:rshooper76
ID: 18932217
I actually found this on my own, but goign to etc/network/interfaces is exactly what I did.  Thanks.
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question