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 |
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). |
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 |
"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 |
Quote:
The "127.0.0.1" address is expected, it's normal ... and it's a Good Thing. |
Quote:
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 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 |
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 ... |
"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 |
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 |
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 |
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 |
Code:
I'd the DNS setup but still I get the problem What is the hostname? How did you setup your network? Code:
router => ubuntu server => internal network If the IP doesn't has a DNS entry, you can't resolve it. what is the output from Code:
nslookup hostname Kind regards |
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 |
Quote:
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 |
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. |
All times are GMT -5. The time now is 04:39 PM. |