Solved

Linux - Change IP Address

Posted on 2007-04-03
5
2,565 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

690 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