LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ping: sendmsg: operation not permitted (http://www.linuxquestions.org/questions/linux-networking-3/ping-sendmsg-operation-not-permitted-307848/)

br_sriram 03-30-2005 12:33 PM

ping: sendmsg: operation not permitted
 
Dear Friends,

My Intel (865GBF) system runs Mandrake 10.0 Official. It was having one D-Link LAN Card and worked fine as our server. We wanted to attach an ADSL to it and so we have added another LAN Card (This time Realtek). The configuration of the new LAN Card is all right, i suppose. But, later, both of the LAN cards refuse to work. I have removed the new Lan Card but, still my Lan does not work.

I am able to ping 127.0.0.1 and the server IP 192.168.2.3 (original IP of the same server).

When I ping other machine on the Lan, I am getting the following error:

From 192.168.2.3 icmp_seq=1 Destination Host Unreachable
Ping: sendmsg: Operation not permitted

Anyone to help?
Thanks and regards,
Sriram.

Avatar 03-30-2005 12:42 PM

Please post the output of "ifconfig"

br_sriram 03-30-2005 12:53 PM

Thanks Avatar,

Here is the ifconfig result. As the server on which the linux runs is not networked, I had to type the ifconfig output manually to post it here.... :(( So, please forgive the spelling mistakes, if any.
-----------
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:80:48:35:EC:64
inet addr:192.168.2.3 Bcast:192.168.2.255 Mask: 255.255.255.0
inet6 addr: fe80::280:48ff:fe35:ec64/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:763 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:61237 (59.8 Kb) TX bytes:678 (678.0 b)
Interrupt:18 Base address:0xec00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.255.255.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:62 errors:0 dropped:0 overruns:0 frame:0
TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4598 (4.4 Kb) TX bytes:4598 (4.4 Kb)


-----------




Thanks in advance.
Sriram.

Avatar 03-30-2005 01:13 PM

Well, everything looks good... except the mask for lo should be 255.0.0.0

Let's do the obvious first.. I assume you checked the cables are plugged in securely, and you have also tried a known good cable to the LAN switch.

I also assume you tried shutting down and restarting the server.

What is "route -n?" (sorry, this will mean more typing, but it might help)

br_sriram 03-30-2005 01:23 PM

Hi Avatar,
Thanks for your quicker reply.

If I have to change the lo's Mask, how can I do that?

Secondly, the cable are tested and good ones. I restarted my Linux box several times. The output of 'route -n' is given below.

------
#route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
------

I think the output of route -n must be something more. But, I dont get any result than the above. I logged in as root user only to generate this empty output.!!!

Thanks and regards,
Sriram.

Avatar 03-30-2005 01:36 PM

To change the mask for lo, type this
"ifconfig lo netmask 255.0.0.0"

Yes route -n should have some routes in it! Here is mine, for example.

Code:

[root@IBMFB1L0DH etc]# route -n
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.1.0    0.0.0.0        255.255.255.0  U    0      0        0 eth0
127.0.0.0      0.0.0.0        255.0.0.0      U    0      0        0 lo
0.0.0.0        192.168.1.1    0.0.0.0        UG    0      0        0 eth0
[root@IBMFB1L0DH etc]#

Note; my computer is a client, not a server.

try to add some routes to your routing table. More information can be found in the man pages for route, and here: http://linux-ip.net/html/tools-ip-route.html

"route add 192.168.2.0 netmask 255.255.255.0 gw 0.0.0.0"
"route add 127.0.0.0 netmask 255.0.0.0 gw 0.0.0.0"
"route add 0.0.0.0 netmask 0.0.0.0 gw 192.168.2.3"

Note; gateway for the last one should be the IP for whatever machine serves the Internet/DNS - if it's you, your own IP.

Try it and see if it helps.

br_sriram 03-30-2005 01:56 PM

Avatar,
Thanks for your quick reply.

I applied ifconfig to change the netmask of lo. It did change the netmask.

I tried applying the commands "route add 192.168.2.0 netmask 255.255.255.0 gw 0.0.0.0" etc, but, it did not get through. I got the error message while running the above command.

It is :
---
route: netmask 000000ff doesn't make sense with host route.
---
The rest of the error message is the "man" pages of route.

Please help.

Thanks,
Sriram.

br_sriram 03-30-2005 02:09 PM

Avatar,

I searched the man pages and found that 'route add' command example. I modified your command to look like the following.

--
route add -net 192.168.2.0 netmask 255.255.255.0 eth0
--
Note that I have added -net portion on your command and removed gw portion, instead added eth0. When I tried the above command, I got the following error:

---
SIOCADDRT: File exists
---


Please help.

Thanks,
Sriram.

br_sriram 03-30-2005 02:19 PM

Avatar,

I read the man pages carefully and ran the commands to create routes. Now my route -n looks like this. What next has to be done? Can you makeout anything further?

----------
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.2.3 0.0.0.0 UG 0 0 0 eth0
----------

Please help.

Thanks,
Sriram.

Avatar 03-30-2005 02:24 PM

Good, glad you got some routing tables set up. Now... what happens when you try to connect? Like if you try to ping another computer on the same subnet? Ping 192.168.2.XXX?

br_sriram 03-30-2005 02:28 PM

Avatar,

When I ping'ed 192.168.2.80, I got the following (same) reply.
-----
Ping: sendmsg: Operation not permitted
From 192.168.2.3 icmp_seq=1 Destination Host Unreachable.
-----
Please help.

Thanks,
Sriram.

Avatar 03-30-2005 02:31 PM

Also make sure your "named" service is running (DNS)

Avatar 03-30-2005 02:32 PM

Blast! Hm.... don't worry we will find the solution just give me a moment

br_sriram 03-30-2005 02:35 PM

Avatar,
Thank you very much for your help and hopes.

But, how to find out if the named service is running?

Thanks,
Sriram.

Avatar 03-30-2005 02:38 PM

What about IPTABLES? Do you have a firewall running and if so, try clearing it. Check with the command "iptables -L INPUT" and "iptables -L OUTPUT" to see if there are any DENY rules.

(More on iptables command options: http://www.faqs.org/docs/iptables/commands.html)


All times are GMT -5. The time now is 10:01 AM.