Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm somewhat new to Linux, but I'm trying to network a few Linux machines. I can't seem to be able ping the gateway or the other Linux machines.

My scenario: I have a few Linux boxes set up on a 10.45.89.x subnet with the gateway being 10.45.89.1. On all of these, I'm unable to ping anything except 127.0.0.1. I'm wondering if I need to modify any of the routing tables or hosts file. Below is a few commands and their output. Perhaps I need to check something else?

netstat -r output:

10.45.89.0   *   255.255.255.0    U
10.112.0.0    *    255.255.0.0    U
169.254.0.0    *    255.255.0.0    U
default    10.45.89.1    0.0.0.0    UG

/etc/hosts

127.0.0.1 localhost.localdomain  localhost
127.0.0.1 localhost.localdomain  localhost
9.37.253.154 rpt.rhn.linux.ul.com

/etc/resolv.conf

domain demolotus.com
namserver 127.0.0.1

/etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=st852.demolotus.com

ip route show dev eth0

10.45.89.0/24  proto  kernel  scope  link  src  10.45.89.138
default via 10.45.89.1

ifconfig

eth0    Link encap:Ethernet  HWaddr 00:0C:29:01:28:CD
inet addr:10.45.89.138  Bcast:10.45.89.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1

eth0:0 Link encap:Ethernet HWaddr 00:0C:29:01:28:CD
inet addr:10.45.89.139  Bcast:10.45.89.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1

ip addr show dev eth0

2: etho0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:01:28:cd brd ff:ff:ff:ff:ff:ff
inet 10.45.89.138/24 brd 10.45.89.255 scope global eth0
inet 10.45.89.139/24 brd 10.45.89.255 scope global secondary eth0:0

Any suggestions are greatly appreciated. Thanks!

share|improve this question
    
10.112.0.0 * 255.255.0.0 U Do you have another network configured on the same interface? Or are you running a firewall? And on top of that etho0: < NO-CARRIER ,BROADCAST,MULTICAST,UP> you don't seem to have a physical connection reported by eth0. –  Karlson Jan 3 '13 at 17:14
    
Thanks, I started playing around with it and got it working. One of the problems was it seemed that I had eth0 disabled, which ifup eth0 corrected. Thanks again. –  Matt Jan 3 '13 at 18:39
    
The "no carrier" means that there is no connection on that interface (bad cable, not plugged in correctly, broken switch at the other end, ...). –  vonbrand Jan 18 '13 at 0:31

1 Answer 1

up vote 1 down vote accepted

on each host, they should have at least their hostname and a corresponding entry in /etc/hosts with their IP in the relevant network, no? ^^ You only show 127.0.0.1 in there, and the "localhost" hostname... So how can it know it is also part of the 192.whatever network and should therefore be able to ping all the other hosts on there? In other words: just edit the hosts file and add a line with:

10.45.89.xxx  st852.demolotus.com

xxx being the last IP digit of st852.demolotus.com in the 10.45.89.X/24 subnetwork

share|improve this answer
    
and restart (stop ; start) networking, or reboot, to have it re-read its hostname and ip and create its routing information. –  Olivier Dulac Jan 3 '13 at 18:43
    
I assume the hostname command does indeed reply "st852.demolotus.com", otherwise you need to edit the relevant filse for it to know it is its hostname (it's unix/linux/distribution dependant) –  Olivier Dulac Jan 3 '13 at 18:44
    
otherwise, even if ping does go out, the remote machine sees it coming from "127.0.0.1" : when replying, it goes to themselves (as 127.0.0.1 will also be that machine's localhost ip) so you never see the packet go back to the machine who originated the ping. –  Olivier Dulac Jan 4 '13 at 14:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.