1820636 Members
1720 Online
109626 Solutions
New Discussion юеВ

Chage IP address

 
SOLVED
Go to solution
juno2
Super Advisor

Chage IP address

I modify the file " /etc/sysconfig/network-scripts/ifcfg-eth0" to add the ip address to the entry "IPADDR" , and reboot the linux 8 , but i run ifconfig , it still show my ip is 127.0.0.1 , why will this happen , what is wrong in my setting ? thx
8 REPLIES 8
juno2
Super Advisor

Re: Chage IP address

what file need to be modify to change the ip address ? thx
Vitaly Karasik_1
Honored Contributor
Solution

Re: Chage IP address

127.0.0.1 related to loopback (lo) interface.

your 1st ethernet interface is eth0


1) run

ifconfig -a

in order to check if LINUX see your network card

2) if you see eth0 interface, just add

ONBOOT=yes

into your ifcfg-eth0 file

3) if you don't see "eth0" in "ifconfig -a" output, run "kudzu" in order to detect you NIX

Regards,
Vitaly
Zeev Schultz
Honored Contributor

Re: Chage IP address

I think Vitaly is right,eth0 is present but
you didn't set the interface options to be preserved on boot.
Can also run lspci to see your Ethernet adapter.Check also /etc/sysconfig/network has NETWORKING=yes.
So computers don't think yet. At least not chess computers. - Seymour Cray
Jerome Henry
Honored Contributor

Re: Chage IP address

Under grap??ical interface run hat menu, then system tools, network peripherical configuration (I'm translating from my french menu), you'll see eth0, run configure, then select eth0 and modify : check that you have an IP, that device is started at boot time. As both Pals said, 127.0.0.1 is your loopback interface, it ensures that your system can talk to itself on client/server basis, but this has nothing to fo with your NIW, which isn't configured right.
J
You can lean only on what resists you...
Caesar_3
Esteemed Contributor

Re: Chage IP address

Hello!

First you don't need to run ifconfig -a
to see all the interfaces, without the
parameters it's show all the active interfaces.
The 127.0.0.1 should always be present,
it's your loopback interface address (lo0).
If all your parameters of the interface are OK
("/etc/sysconfig/network-scripts/ifcfg-" eth0 or something else depend on the interface, check /etc/modules.conf)
you can start it manually by:
ifup
If you will see any errors you will understand if no check if you have connection.
You may have this problems if the configuration is OK : same IP on the net (linux automaticly check if IP in use)
or maybe you have problems with the cabel.

Caesar
Steven E. Protter
Exalted Contributor

Re: Chage IP address

Caesar is dead on with the -a option. Most distributions will display all interfaces with a simple ifconfig command.

ifconfig | more

My guess is based on results you see nothing with regards to eth0.

So try this.

ifconfig eth0 netmask

Take these straight out of your /etc/sysconfig/network-scripts/ifcfg-eth0 file.

That is if it makes sense.

Try the command. If eth0 comes up, there is something else in that directory messing with your NIC card.

Possible causes:

1) Syntax error in the config file. Take and modify the ifcfg-eth0 file from a working machine, perferably with the same NIC card and modify it.

2) The configuration makes no sense. An IP address impossible based on network mask is an example.

3) Conflict with another machine on the network. If your IP address is in use, possbily without your network admin's knowledge it won't come up on the Linux box. See network administration and/or try a different IP address

4) Linux never detected your NIC card. The hardware might not be supported, the card might not be firmly in the PCI bus, there may be a conflict with another plug and play card.

This is a start, post specific data for more help. I won't be back until the morning because I drove my kids from NYC to Chicago all night and am beat.

Later.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vitaly Karasik_1
Honored Contributor

Re: Chage IP address

2 Caesar & Steve,

Just becase to determinate if


1) Linux knows about eth0 but didn't up it

or

2) Linux doesn't know about this NIC


I suggest to run "ifconfig -a" - it will show eth0 in case 1) and will not show in case 2)

at least in RHL "ifconfig" shows all interfaces with status "UP", and "ifconfig -a" shows *all* interfaces

Regards,
Vitaly.
twang
Honored Contributor

Re: Chage IP address

you can simply use ifconfig to do this, for example:
# ifconfig eth0 192.168.0.2 netmask 255.255.255.0