Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6745
  • Last Modified:

ping: sendmsg:Invalid argument - resolved if adding to the routing table?

Having a weird problem with pinging some (but not all) servers:

[root@azproduction root]# ping e.mx.mail.yahoo.com
PING e.mx.mail.yahoo.com (216.39.53.1) from 192.168.10.11 : 56(84) bytes of data.
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument

--- e.mx.mail.yahoo.com ping statistics ---
3 packets transmitted, 0 received, 100% loss, time 2014ms


For reference, the routing table before:
[root@azproduction root]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
90.0.0.0        *               255.255.255.0   U     0      0        0 eth0
192.168.10.0    *               255.255.255.0   U     0      0        0 eth1
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
128.0.0.0       192.168.10.3    128.0.0.0       UG    0      0        0 ipsec0
default         192.168.10.3    0.0.0.0         UG    0      0        0 eth1

Add the entry:
[root@azproduction root]# route add -host 216.39.53.1 gw 192.168.10.3

Try again:
[root@azproduction root]# ping e.mx.mail.yahoo.com
PING e.mx.mail.yahoo.com (216.39.53.1) from 192.168.10.11 : 56(84) bytes of data.
64 bytes from mta-v12.mail.vip.re4.yahoo.com (216.39.53.1): icmp_seq=1 ttl=54 time=108 ms
64 bytes from mta-v12.mail.vip.re4.yahoo.com (216.39.53.1): icmp_seq=2 ttl=54 time=108 ms
64 bytes from mta-v12.mail.vip.re4.yahoo.com (216.39.53.1): icmp_seq=3 ttl=54 time=108 ms
64 bytes from mta-v12.mail.vip.re4.yahoo.com (216.39.53.1): icmp_seq=4 ttl=54 time=107 ms

--- e.mx.mail.yahoo.com ping statistics ---
4 packets transmitted, 4 received, 0% loss, time 3006ms
rtt min/avg/max/mdev = 107.453/108.124/108.496/0.566 ms

Then, it is working as expected.

One server, 192.168.10.3 is the access point to the internet for the rest of the machines.  It has two interfaces with the first of which being our public IP address.  Various ports are forwarded to the other internal machines from this external address.  The network was kind of an emergency thing, we had the main firewall just up and die, I will have a replacement tomorrow but we're dead in the water for mail off this server.  Before, things were OK.  Below is the forwarding table if that is of any help.  The machine we're looking at above is 192.168.10.11

Incoming port      Routed to IP      Routed to port
990/tcp      192.168.10.5      990/tcp
554/tcp      192.168.10.5      554/tcp
21/tcp      192.168.10.5      21/tcp
8001/tcp      192.168.10.11      8001/tcp
25/tcp      192.168.10.11      25/tcp
22/tcp      192.168.10.11      22/tcp
1352/tcp      192.168.10.11      1352/tcp
1025/tcp      192.168.10.11      25/tcp
8088/tcp      192.168.10.10      8088/tcp
8084/tcp      192.168.10.10      8084/tcp
8083/tcp      192.168.10.10      8083/tcp
8082/tcp      192.168.10.10      8082/tcp
8081/tcp      192.168.10.10      8081/tcp
80/tcp      192.168.10.10      80/tcp
3101/tcp      192.168.10.10      3101/tcp
1533/tcp      192.168.10.10      1533/tcp
1433/tcp      192.168.10.10      1433/tcp
3389/tcp      192.168.10.1      3389/tcp

Other things I can ping and it doesn't have an issue:
[root@azproduction root]# ping 4.2.2.2
PING 4.2.2.2 (4.2.2.2) from 192.168.10.11 : 56(84) bytes of data.
64 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=51.5 ms
64 bytes from 4.2.2.2: icmp_seq=2 ttl=57 time=51.3 ms
64 bytes from 4.2.2.2: icmp_seq=3 ttl=57 time=50.7 ms

--- 4.2.2.2 ping statistics ---
3 packets transmitted, 3 received, 0% loss, time 2004ms
rtt min/avg/max/mdev = 50.780/51.247/51.598/0.432 ms
[root@azproduction root]#


Any ideas?

Thank you in advance.
0
tlmacr
Asked:
tlmacr
  • 3
1 Solution
 
lanboyoCommented:
This route is causing the problem

128.0.0.0       192.168.10.3    128.0.0.0       UG    0      0        0 ipsec0

It says to send every ip destination above 127.255.255.255 to the ipsec0 interface, but send it to your normal gateway as a first hop. Since your normal gateway is not on the ipsec interface... it gives you a protocol invalid message. This route is more specifig (by a single bit) than the ddefault route, but is less specific than almost any other route, like your local networks and the /32 you put in for yahoo.

You can down the ipsec interface, or fix its netmask.

Don't know what happens to it if you don't have ipsec running....

You can fix the imediate problem with a few broad route statements,

route add -net  0.0.0.0 64.0.0.0 gw 192.168.10.3
route add -net  64.0.0.0 64.0.0.0 gw 192.168.10.3
route add -net  128.0.0.0 64.0.0.0 gw 192.168.10.3
route add -net  196.0.0.0 64.0.0.0 gw 192.168.10.3

But this is more specific than the ipsec interface, and will break it if it is doing anything. Maybe set it for

route add -net  128.0.0.0 255.0.0.0  ipsec0

and hope for the best.

0
 
lanboyoCommented:
Actually that one route shpuld be

route add -net  192.0.0.0 64.0.0.0 gw 192.168.10.3
0
 
lanboyoCommented:
Did any of this work.
0
 
tlmacrAuthor Commented:
Yes, we just had to down the ipsec0 interface and everything snapped back into place!  Thanks again, great to have this problem over with.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now