Solved

Problem Pinging out of Linux

Posted on 2002-07-14
17
299 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
  • 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
 

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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 50 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now