LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-09-2009, 11:36 AM   #1
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
Question IP Address


Hi All,

Could anybody please let me know where all the IP addresses get stored in Linux?
How can we change the IP address in Linux...

Thanks in advance,
Kapil.
 
Old 01-09-2009, 11:46 AM   #2
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
IP address is set differently depending upon the distribution of Linux you are using.

This site explains the different configurations:

http://www.yolinux.com/TUTORIALS/Lin....html#ASSIGNIP

Last edited by AuroraCA; 01-09-2009 at 11:47 AM.
 
Old 01-09-2009, 11:46 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
/etc/network/interfaces

Quote:
How can we change the IP address in Linux...
take a look at man ipconfig and man iwconfig
 
Old 01-09-2009, 11:46 AM   #4
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
What is your distribution? Usually, the IP address of an interface is stored in a configuration file, that deals with networking. For example, in Slackware, it's /etc/rc.d/rc.inet1.conf In other distributions it's different.
Usually, there are tools to change the IP and other things without editing these files directly. Like the netconfig in Slackware.
 
Old 01-09-2009, 12:12 PM   #5
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
I think you need to do some research into IP Addresses, or more specifically how you're getting your IP Address. Are you using DHCP? If so, where ever your DHCP server (or zero-config stuff) is, thats where you want to change it. If you're setting your own IP address, and not using DHCP, /etc/networks/interfaces is the place to look.

You can set it with ifconfig, too.

What do you need to change it for?
 
Old 01-09-2009, 12:38 PM   #6
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by AuroraCA View Post
IP address is set differently depending upon the distribution of Linux you are using.

This site explains the different configurations:

http://www.yolinux.com/TUTORIALS/Lin....html#ASSIGNIP


Hi there,
thank you for the response...i will check the portal, and if requred then will get back again...

Thankx again,
kapil.
 
Old 01-09-2009, 12:40 PM   #7
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Question

Quote:
Originally Posted by Uncle_Theodore View Post
What is your distribution? Usually, the IP address of an interface is stored in a configuration file, that deals with networking. For example, in Slackware, it's /etc/rc.d/rc.inet1.conf In other distributions it's different.
Usually, there are tools to change the IP and other things without editing these files directly. Like the netconfig in Slackware.

hi There,
I am using RHEL5, and as you have already told us thta it depends upon distribution, so what could be the location for rhel5?

Thankx,
Kapil.
 
Old 01-09-2009, 12:46 PM   #8
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Original Poster
Rep: Reputation: 41
Question

Quote:
Originally Posted by jamescondron View Post
I think you need to do some research into IP Addresses, or more specifically how you're getting your IP Address. Are you using DHCP? If so, where ever your DHCP server (or zero-config stuff) is, thats where you want to change it. If you're setting your own IP address, and not using DHCP, /etc/networks/interfaces is the place to look.

You can set it with ifconfig, too.

What do you need to change it for?
Hi There,

I am using rhel5 and i already tried ifconfig, but it is not working at all. Ipconfig is not good for linux at all. I tried accessing /etc/network/interfaces as well, but there is no such route either with user or with root...

What should I do?

Regards,
Kapil.
 
Old 01-09-2009, 12:55 PM   #9
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by kapilbajpai88 View Post
I am using rhel5 and i already tried ifconfig, but it is not working at all.
Make sure you are not running a DHCP client for that interface:
Code:
[machine:~]:ps aux | grep dhc
dhcp      3004  0.0  0.0   2396   564 ?        S<s  13:36   0:00 dhclient3 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0
root      4919  0.0  0.0   2800   764 pts/0    S+   13:48   0:00 grep dhc
[machine:~]:kill -9 3004
[machine:~]:ifconfig eth0 N.N.N.N netmask M.M.M.M
This syntax assumes you are logged in as root. "N.N.N.N" should be replaced by your desired IP address (for example 192.168.1.128) and "M.M.M.M" should be replaced by the desired subnet mask (for example 255.255.255.0).

This will not be persistent across reboots. If you need to make your changes permanent, look at the file named
Code:
/etc/sysconfig/network-scripts/ifcfg-eth0
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Router gateway address being picked up as primary DNS address under SuSe Hubmasterflex Linux - Networking 13 10-18-2008 01:40 PM
WARNING: IP: Hardware address '***' trying to be our address 172.016.104.065 sunram Solaris / OpenSolaris 1 05-30-2008 08:51 AM
Find real ip address using link local address, mdns/zeroconf dannemanare Linux - Networking 0 01-17-2008 04:31 AM
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration