LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-11-2011, 03:12 PM   #1
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Rep: Reputation: 0
Ubuntu Server ip address


I've installed a new copy of Ubuntu Server 10.10. To test that I executed a "ping hostname" at command line.I see that the ip address is set to the loopback(lo) inet addr:127.0.0.1. "ifconfig" returns the etho details which look good to me.

I've read somewhere that it sets to the loopback inet addr initially.Also,it doesn't allow me to ping/ssh from external machines to test it.

How,do I set the machine to use the address in etho0.

Thanks

Andrew
 
Old 04-11-2011, 03:23 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
The machine's address *is* the IP address you see in ifconfig.

Which, I presume, is NOT 127.0.0.1

If you can't "ping" other hosts (or they can't "ping" you), that's a separate problem:

1. Use DHCP, if possible.

2. If you have multiple hosts, they should use DHCP if possible, too.

3. Each host should be able to "ping" it's gateway.

4. Each host should be able to "ping" each other...

5. ... UNLESS your firewall prohibits ICMP

'Hope that helps .. PSM

PS:
Using "localhost" (127.0.0.1) for local connectivity is a Good Thing. But you can change this behavior by editing /etc/hosts (among other ways).

Last edited by paulsm4; 04-11-2011 at 03:25 PM.
 
Old 04-11-2011, 03:34 PM   #3
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
Thanks Paul,

I can "ping" other hosts. Also,when I ping from other hosts to the new machine,it says

PING hostname(ip addr) 56(84 bytes of data) and stucks there.ip addr which showed up when I ping from other hosts is different from the inet address(under eth0) I get when I run "ifconfig".I guess that should be the problem.How do I configure this from command line?I don't GUI on the new machine for now

Andrew
 
Old 04-11-2011, 04:36 PM   #4
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
"ping hostname" looks for different ipaddr and ifconfig(for eth0) returns different ipaddr. I guess this should the problem that worrying me.

Is there anyway I can set eth0 such that it looks for same addr.I tried "ifconfig etho 129.***.**.*** up" and restarting the network.And I noticed that the inet addr was reset to previous value for eth0

Any suggestions

Andrew
 
Old 04-11-2011, 05:24 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
I executed a "ping hostname" at command line...is set to the loopback(lo) inet addr:127.0.0.1. "ifconfig" returns the etho details which look good to me.

I guess this should the problem that worrying me.
Don't let it worry you
The "127.0.0.1" address is expected, it's normal ... and it's a Good Thing.

Last edited by paulsm4; 04-11-2011 at 07:40 PM.
 
Old 04-11-2011, 06:01 PM   #6
sibe
Member
 
Registered: Apr 2011
Location: Jakarta, Indonesia
Distribution: Fedora, CentOS
Posts: 122

Rep: Reputation: 21
Quote:
Originally Posted by ansrewdps View Post

PING hostname(ip addr) 56(84 bytes of data) and stucks there.ip addr which showed up when I ping from other hosts is different from the inet address(under eth0) I get when I run "ifconfig".I guess that should be the problem.How do I configure this from command line?I don't GUI on the new machine for now

Andrew
I think that could be the problem; the machine from which you're pinging has translated the hostname to a different IP. Try to ping the IP address, not hostname, and see if it still stucks.

If it does, check the output from ifconfig eth0 command, the good thing that you're looking for is lying around the fourth line, it must be saying

Code:
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
If it's not UP and RUNNING, then your interface is offline, you need to bring it online (i.e. restarting network service).

One thing, what you have configured through the command prompt will be lost once you restart the service, nor it will survive in the event of reboot. To be persistent, you need to put it in your configuration file (e.g. /etc/network/interfaces).

Is there any intermediate device between your pinging machine and the troubled one?


----
sibe

Last edited by sibe; 04-11-2011 at 08:41 PM.
 
Old 04-11-2011, 10:26 PM   #7
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
sibe -

I don't think the OP has a problem per se. I believe he's just under the mistaken impression if "ping hostname" returns 127.0.0.1, that's somehow a Bad Thing.

IMHO ...
 
Old 04-12-2011, 11:31 AM   #8
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
"ifconfig " returns expected output in the eth0(fourth line)...

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Sorry about that...Let me make my problem clear if thats confusing you guys...

I've recently installed Ubuntu Server 10.10 on the machine and
1. from new server machine: "ifconfig" returns an output with eth0 inetaddr:129.***.**.*** and ping hostname(new machine hostname) works well.
2. from other hosts: "ping hostname"(new machine hostname) looks for different ip address other than it returned in eth0 addr which I believe is the problem.
3. "ping ipaddr"(of the new machine's eth0 inet addr) from other hosts works again

So,is there any way I can configure the machine so every host look for same ip address thats returned in eth0 inet addr. I guess ping from other hosts are looking for wrong ipaddr.


Andrew
 
Old 04-12-2011, 01:22 PM   #9
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
I guess the hostname is pointing to different ip address which I need to set it to correct address.May be something to do with DCHP??not sure. Any idea on how to do this?

Thanks
 
Old 04-12-2011, 01:35 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Is 129.x.x.x
a public IP given to you by your ISP?
Are you pinging from inside the local network(LAN)
or from outside the network?
If ping <hostname> times out, it means it can't resolve the IP
Do you have a DNS setup to resolve 129.x.x.x to your hostname?
Code:
dig 129.x.x.x
Kind regards
 
Old 04-12-2011, 02:11 PM   #11
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
If I understood your question,it uses DHCP to get an IP and I'm pinging from inside the LAN.

I'd the DNS setup but still I get the problem
 
Old 04-12-2011, 02:21 PM   #12
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Code:
I'd the DNS setup but still I get the problem
What did you do?
What is the hostname?
How did you setup your network?
Code:
router => ubuntu server => internal network
or do you have a different setup?
If the IP doesn't has a DNS entry, you can't resolve it.
what is the output from
Code:
nslookup hostname
from a machine on your local network.

Kind regards
 
Old 04-12-2011, 02:34 PM   #13
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
It returns

Server: ipaddr1
Address: ipaddr1#53

name: hostname
address: ipaddr2

But the ipaddr2 is different from the eth0 inet address.Shouldn't both the address be same??

Thanks

Andrew
 
Old 04-12-2011, 02:40 PM   #14
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
But the ipaddr2 is different from the eth0 inet address.Shouldn't both the address be same??
Depends how the network is setup
Do you have a router, a modem?
How is the setup from the router, how is the setup from the network?
Does eth0 receives an ip from the router, or directly from the provider?
Is eth0 also your external IP, or is it setup via DHCP from the router?
To find the external IP from your network, got to
http://www.whatismyip.com
The DNS should resolve to the external ip from the router/modem
Do you have a fixed IP?

Kind regards

Last edited by repo; 04-12-2011 at 02:43 PM.
 
Old 04-12-2011, 02:56 PM   #15
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
It is connected via switch...But I'm pretty sure that they should have the same ip because it's how the other server that's connected to the same switch is behaving(which is infact working fine).It has the same eth0's inet addr and in nslookup.
However,the new server has different addresses.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 1 09-14-2009 09:31 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 0 09-14-2009 11:45 AM
Cannot connect to Ubuntu server through the internet after I fixed the IP address mrotsliah Linux - Server 1 06-22-2009 05:02 PM
I cant make my ip address public (ubuntu server 9.10) and mysqld.sock is empty Jamie Kugelmann Linux - Server 11 05-26-2009 07:40 AM
No IP address from DHCP server on Ubuntu 6.06, 6.1, Knoopix, Fedoce 5 and SuSE 10.1 MatWab Linux - Wireless Networking 8 06-19-2007 06:44 PM


All times are GMT -5. The time now is 04:26 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration