# ping: unknown protocol icmp.

## flickerfly

When ever I try to ping anything (root or otherwise) I get:

```

ping: unknown protocol icmp.

```

Anyone have any idea what might cause this  :Question:   I rather miss ping and traceroute to for that matter.

Funny thing is NFS, web browsing, all that stuff works great.

Thanks  :Exclamation: 

----------

## Eagle-Eye

 *flickerfly wrote:*   

> When ever I try to ping anything (root or otherwise) I get:
> 
> ```
> 
> ping: unknown protocol icmp.
> ...

 

Do you have an entry for ICMP in your /etc/protocols? If I put a comment at the line for ICMP and try to ping I recieve the same message. Otherwise it works.

```
# /etc/protocols:

# $Id: protocols,v 1.2 2002/05/12 21:48:18 azarah Exp $

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/protocols,v 1.2 2002/05/12 21:48:18 azarah Exp $

#

# Internet (IP) protocols

#

#       from: @(#)protocols     5.1 (Berkeley) 4/17/89

#

# Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992).

ip      0       IP              # internet protocol, pseudo protocol number

icmp    1       ICMP            # internet control message protocol

igmp    2       IGMP            # Internet Group Management

ggp     3       GGP             # gateway-gateway protocol

...
```

----------

## flickerfly

Yep, listed second.  Here's the full version of it:

```

<clip header comments />

ip      0       IP              # internet protocol, pseudo protocol number

icmp    1       ICMP            # internet control message protocol

igmp    2       IGMP            # Internet Group Management

ggp     3       GGP             # gateway-gateway protocol

ipencap 4       IP-ENCAP        # IP encapsulated in IP (officially ``IP'')

st      5       ST              # ST datagram mode

tcp     6       TCP             # transmission control protocol

egp     8       EGP             # exterior gateway protocol

pup     12      PUP             # PARC universal packet protocol

udp     17      UDP             # user datagram protocol

hmp     20      HMP             # host monitoring protocol

xns-idp 22      XNS-IDP         # Xerox NS IDP

rdp     27      RDP             # "reliable datagram" protocol

iso-tp4 29      ISO-TP4         # ISO Transport Protocol class 4

xtp     36      XTP             # Xpress Tranfer Protocol

ddp     37      DDP             # Datagram Delivery Protocol

idpr-cmtp 38    IDPR-CMTP       # IDPR Control Message Transport

ipv6    41      IPv6            # IPv6

ipv6-route 43   IPv6-Route      # Routing Header for IPv6

ipv6-frag 44    IPv6-Frag       # Fragment Header for IPv6

idrp    45      IDRP            # Inter-Domain Routing Protocol

rsvp    46      RSVP            # Reservation Protocol

gre     47      GRE             # General Routing Encapsulation

esp     50      ESP             # Encap Security Payload for IPv6  

ah      51      AH              # Authentication Header for IPv6

skip    57      SKIP            # SKIP

ipv6-icmp 58    IPv6-ICMP       # ICMP for IPv6

ipv6-nonxt 59   IPv6-NoNxt      # No Next Header for IPv6

ipv6-opts 60    IPv6-Opts       # Destination Options for IPv6 

rspf    73      RSPF            # Radio Shortest Path First.

vmtp    81      VMTP            # Versatile Message Transport   

ospf    89      OSPFIGP         # Open Shortest Path First IGP

ipip    94      IPIP            # IP-within-IP Encapsulation Protocol

encap   98      ENCAP           # Yet Another IP encapsulation

pim     103     PIM             # Protocol Independent Multicast

```

While I'm at it, here is the results of a "locate icmp" if that's of any use:

```

/lib/iptables/libip6t_icmpv6.so

/lib/iptables/libipt_icmp.so

/usr/include/linux/icmp.h

/usr/include/linux/icmpv6.h

/usr/include/linux/netfilter_ipv4/ip_conntrack_icmp.h

/usr/include/netinet/icmp6.h

/usr/include/netinet/ip_icmp.h

/usr/share/man/man7/icmp.7.gz

/usr/src/linux-2.4.19-gentoo-r10/include/linux/icmp.h

/usr/src/linux-2.4.19-gentoo-r10/include/linux/icmpv6.h

/usr/src/linux-2.4.19-gentoo-r10/include/linux/netfilter_ipv4/ip_conntrack_icmp.h

/usr/src/linux-2.4.19-gentoo-r10/include/net/icmp.h

/usr/src/linux-2.4.19-gentoo-r10/net/ipv4/.icmp.o.flags

/usr/src/linux-2.4.19-gentoo-r10/net/ipv4/icmp.c

/usr/src/linux-2.4.19-gentoo-r10/net/ipv4/icmp.o

/usr/src/linux-2.4.19-gentoo-r10/net/ipv4/netfilter/ip_conntrack_proto_icmp.c

/usr/src/linux-2.4.19-gentoo-r10/net/ipv4/netfilter/ip_nat_proto_icmp.c

/usr/src/linux-2.4.19-gentoo-r10/net/ipv6/icmp.c

/usr/src/linux-2.4.20/include/linux/icmp.h

/usr/src/linux-2.4.20/include/linux/icmpv6.h

/usr/src/linux-2.4.20/include/linux/netfilter_ipv4/ip_conntrack_icmp.h

/usr/src/linux-2.4.20/include/net/icmp.h

/usr/src/linux-2.4.20/net/ipv4/.icmp.o.flags

/usr/src/linux-2.4.20/net/ipv4/icmp.c

/usr/src/linux-2.4.20/net/ipv4/icmp.o

/usr/src/linux-2.4.20/net/ipv4/netfilter/ip_conntrack_proto_icmp.c

/usr/src/linux-2.4.20/net/ipv4/netfilter/ip_nat_proto_icmp.c

/usr/src/linux-2.4.20/net/ipv6/icmp.c

```

Thanks ,

Josiah

----------

## rajl

check your firewall rules.  If you have any chains dealing with icmp packets, you can get that message as well.  That's why I haven't implemented any icmp rules yet, because I still like to use ping and traceroute as well.

----------

## flickerfly

I have  have made sure I have the most updated version of iptables.  When i do iptables -L I get this.

[code]

[root:1@ 15:31:06~]>> iptables -L

modprobe: Can't locate module ip_tables

iptables v1.2.7a: can't initialize iptables table `filter': iptables who? (do you need to insmod?)

Perhaps iptables or your kernel needs to be upgraded.

[/code]

Haveing little iptables experience I figure this is the case because I'm not running iptables.  Got a firewall I'm behind and trusting till I get iptables figured out.  ( I know the guy who runs the firewall knows much more about iptables than I do.)

----------

## flickerfly

ALSO: When I try to start ftp I get:

```
ftp: ftp/tcp: unknown service
```

But: I can ssh.  I can't use any other ftp clients.

----------

## mglauche

double/tripple check your nsswith.conf ... I once did install LDAP auth and had the same problem ... so check if your nsswith.conf  has something like this:

services:   files

networks:   files

----------

## flickerfly

Thanks mglauche, that's a great direction I hadn't though about yet.  It looks ok from what you said, but I'm not very familiar with this.

Here's my nsswitch (-headers).  I did recently try to make changes including ldap  (as you can see).  I'm trying to setup an SAMBA/LDAP PDC-killer, which I'm still working on i.e. It doesn't work yet, maybe this has something to do with it.

```
passwd:         ldap compat

shadow:         ldap compat

group:          ldap compat

hosts:          files dns

networks:       ldap [NOTFOUND=return] files dns

protocols:      ldap [NOTFOUND=return] db files

rpc:            ldap [NOTFOUND=return] db files

ethers:         ldap [NOTFOUND=return] db files

services:       ldap [NOTFOUND=return] db files

netgroup:    files

bootparams:  files

automount:   files

aliases:     files

```

I'm reading man nsswitch.conf, but if you see anything obvious, great.  I learn better by critique and example.  Could this also be related to changes I made in PAM?

----------

## mglauche

use only the first 3 for ldap, change the rest to "files" as there's no real need to store them in ldap anyway (they usually should not change that often, and it makes the whole thing more complicated)

having services to "ldap .." is the source of your problem  :Wink: 

----------

## flickerfly

I removed ldap from the services line, and the network line also.  Now is there a service I need to restart to refresh this info, cause I'm getting the same error still.

Thanks for your help.

----------

## mglauche

sorry, it should be the protocol line .. too early in the morning ,)

----------

## flickerfly

 *mglauche wrote:*   

> sorry, it should be the protocol line .. too early in the morning ,)

 

<drama>

Praises upon you, I can ping and ftp again!!!

 Thanks many times over.  What a relief.

</drama>

AAhhh...

----------

