?
Solved

Problem Pinging out of Linux

Posted on 2002-07-14
17
Medium Priority
?
307 Views
Last Modified: 2010-04-20
Hi
I am unable to ping from Linux. Other machines can however access my linux box thru samba, but i cannot ping from it.
What could be the problem ?
0
Comment
Question by:farhadtarapore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 3
  • +2
17 Comments
 
LVL 1

Expert Comment

by:Techno__Mage
ID: 7153479
Possibly your resolver config in /etc/resolv.conf and/or nsswitch.conf, but that's a guess at this point.  

Can you list for us what happens exactly when you try to ping ?
0
 

Author Comment

by:farhadtarapore
ID: 7153604
Nothing happens when I ping. The program just halts there.
I can ping localhost, but not, say, www.yahoo.com.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7153806
please post etc/resolv.conf and nsswitch.conf

You need to add your DNS server in /etc/resolve.conf.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:farhadtarapore
ID: 7153846
The nameserver entry is already there in resolv.conf along with two other entries for domain and search. But still the ping gives me : unknown host: www.yahoo.com when I try to ping www.yahoo.com
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7153855
please post etc/resolv.conf and nsswitch.conf
0
 
LVL 14

Expert Comment

by:psadac
ID: 7153889
try to ping the ip address directly, if it still doesn't work, do you have iptables/ipchains rules rejecting icmp packets ?

type iptables -L / ipchains -L to see the rules
0
 
LVL 1

Expert Comment

by:petereilering
ID: 7156481
Some distro's require root rights to be able to ping
So su to root
0
 

Author Comment

by:farhadtarapore
ID: 7156691
I am pinging as root only.
Here are the files:
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#     nisplus or nis+          Use NIS+ (NIS version 3)
#     nis or yp          Use NIS (NIS version 2), also called YP
#     dns               Use DNS (Domain Name Service)
#     files               Use the local files
#     db               Use the local database (.db) files
#     compat               Use NIS on compat mode
#     hesiod               Use Hesiod for user lookups
#     [NOTFOUND=return]     Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files nisplus nis
shadow:     files nisplus nis
group:      files nisplus nis

#hosts:     db files nisplus nis dns
hosts:      files nisplus nis dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files    

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus

RESOLV.CONF (dummy addresses here, but this is what it looks like)
============
domain kc.roadrunner.com
search kc.roadrunner.com roadrunner.com
nameserver 63.32.36.22

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7156764
in your nsswitch.conf:
  hosts:      files nisplus nis dns

DNS is consulted last, after NIS have timed out sevaral times. So you need to wait 'til ping gives up, that's ok according to your setup.
Do you have NIS available in you network?

what does following report (please post full output):

  nslookup www.ripe.net
0
 
LVL 1

Expert Comment

by:petereilering
ID: 7156935
It shure looks like a fire wall issue here.
Can you show the output of the following command:

ipchains -L -n

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7157301
in a previous comment:
> .. But still the ping gives me : unknown host: www.yahoo.com 

This is a resolver problem, and not a ICMP filter problem.
Forget about the firewall/packetfilter, except it filters DNS.
0
 

Author Comment

by:farhadtarapore
ID: 7158634
Output of nslookup www.ripe.net
===============================
***cant find server name for address <my ip add>: no response from server
***Default servers are not available

Output of ipchains
==================
bash:ipchains: command not found

ipchains is not there on my machine. I can ping the intranet machines, but not outside.
0
 
LVL 1

Expert Comment

by:petereilering
ID: 7158746
Something in your gateway or no default route to your gateway?
Hoffman is wright it isn't a firewall issue
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 7158931
you need to setup your /etc/resolv.conf with valid values for domain and nameserver, or you need to add the IP - name - mapping to your /etc/hosts file. That's all.
0
 
LVL 1

Expert Comment

by:Techno__Mage
ID: 7160825
If you do not have NIS or are unsure, then change your /etc/nsswitch.conf file...  

**** Change this line :  
hosts:      files nisplus nis dns

**** To look like this :  
hosts:      files dns


After you make this change, then try these commands and post your results for us :  

ping -v www.yahoo.com

traceroute -v www.yahoo.com
**(may need to specify path with command as /usr/sbin/traceroute )
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7160832
changing /etc/nsswitch.conf without changing /etc/resolv.conf and/or /etc/hosts, will not solve the problem here
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7161350
what was wrong/unsufficient with my suggestions?
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question