Solved

Linux - Change IP Address

Posted on 2007-04-03
5
2,530 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I actually found this on my own, but goign to etc/network/interfaces is exactly what I did.  Thanks.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now