anyone know what 'ping: sendto: Can't assign requested" means

3,545 views
Skip to first unread message

DTD

unread,
Dec 6, 2016, 1:33:31 PM12/6/16
to freebsd-...@freebsd.org
For truth in advertising this is pinging from a jail. The problem is limited to
pinging outside of the jailed environment. I took a shot a the ping source to
see if there was an illuminating comment around the message but got lost in
tacking this through libc source.

I can show this is not a routing issue and the jails can ping. Our LAN has a
dozen or so devices all in the network 192.168.2.0/24. To demonstrate the
problem I used two hosts in the LAN and some external systems. The jail
environment is chaos (host) and two jails, gaia and gsscc. First, from either
jail all the above is ping-able:

From gaia:

gaia:~> ping -c 2 chaos
PING chaos.boltsys.com (192.168.2.117): 56 data bytes
64 bytes from 192.168.2.117: icmp_seq=0 ttl=64 time=0.020 ms
64 bytes from 192.168.2.117: icmp_seq=1 ttl=64 time=0.047 ms

--- chaos.boltsys.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.020/0.034/0.047/0.013 ms
gaia:~> ping -c 2 gsscc
PING gsscc.boltsys.com (192.168.2.111): 56 data bytes
64 bytes from 192.168.2.111: icmp_seq=0 ttl=64 time=0.022 ms
64 bytes from 192.168.2.111: icmp_seq=1 ttl=64 time=0.023 ms

artemis is a host on the 192.168.2.0/24:

gaia:~> ping -c 2 artemis
PING artemis.boltsys.com (192.168.2.102): 56 data bytes
ping: sendto: Can't assign requested address
ping: sendto: Can't assign requested address
^C
--- artemis.boltsys.com ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss

Any TCP protocol works:

gaia:~> ssh artemis
Password for do...@artemis.boltsys.com:
Last login: Tue Dec 6 13:00:12 2016 from :0.0
FreeBSD 10.3-RELEASE-p11 (GENERIC) #0: Mon Oct 24 18:49:24 UTC 2016

Welcome to FreeBSD!

artemis:~> ping -c 2 www.ibm.com
PING e2874.x.akamaiedge.net (104.119.114.9): 56 data bytes
64 bytes from 104.119.114.9: icmp_seq=0 ttl=60 time=8.996 ms
64 bytes from 104.119.114.9: icmp_seq=1 ttl=60 time=10.140 ms

--- e2874.x.akamaiedge.net ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 8.996/9.568/10.140/0.572 ms
artemis:~> exit
logout
Connection to artemis closed.

So everything but ping works. I took a shot at making chaos a gateway and using
NAT to get around this. Turns out I do not know how to do that. within the same
/24 anyway.

So the question comes down to under what conditions does ping give the 'sendto:
Can't assign requested address' error. I have not been able to get that to
happen outside of a jailed environment.

Just to do all posibilities DNS or not, does not change anything:

gaia:~> ping -c 2 192.168.2.117
PING 192.168.2.117 (192.168.2.117): 56 data bytes
64 bytes from 192.168.2.117: icmp_seq=0 ttl=64 time=0.032 ms
64 bytes from 192.168.2.117: icmp_seq=1 ttl=64 time=0.020 ms

--- 192.168.2.117 ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.020/0.026/0.032/0.006 ms
gaia:~> ping -c 2 192.168.2.102
PING 192.168.2.102 (192.168.2.102): 56 data bytes
ping: sendto: Can't assign requested address
ping: sendto: Can't assign requested address
^C
--- 192.168.2.102 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss



_____
Douglas Denault
http://www.safeport.com
do...@safeport.com
Voice: 301-217-9220
Fax: 301-217-9277
_______________________________________________
freebsd-...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Anton Yuzhaninov

unread,
Dec 19, 2016, 8:36:53 PM12/19/16
to freebsd-...@freebsd.org
On 12/06/16 13:33, DTD wrote:
>
> So the question comes down to under what conditions does ping give the
> 'sendto:
> Can't assign requested address' error. I have not been able to get that to
> happen outside of a jailed environment.

Outside jails this error happens when you ping address from 127.0.0.0/8
(but not 127.0.0.1)

:~> ping 127.0.0.2
PING 127.0.0.2 (127.0.0.2): 56 data bytes
ping: sendto: Can't assign requested address

doug

unread,
Dec 20, 2016, 12:06:10 AM12/20/16
to Anton Yuzhaninov, freebsd-...@freebsd.org
On Mon, 19 Dec 2016, Anton Yuzhaninov wrote:

> On 12/06/16 13:33, DTD wrote:
>>
>> So the question comes down to under what conditions does ping give the
>> 'sendto:
>> Can't assign requested address' error. I have not been able to get that to
>> happen outside of a jailed environment.
>
> Outside jails this error happens when you ping address from 127.0.0.0/8 (but
> not 127.0.0.1)
>
> :~> ping 127.0.0.2
> PING 127.0.0.2 (127.0.0.2): 56 data bytes
> ping: sendto: Can't assign requested address

Sorry to be dense but I do not understand the comment. I have a LAN with a few
hosts:

192.168.2.1 (ISP gateway)
tardis.boltsys.com (192.168.2.22)
lilac.boltsys.com (192.168.2.44)
zeus.boltsys.com (192.168.2.45)
thor.boltsys.com (192.168.2.104)
192.168.2.105
hphub.boltsys.com (192.168.2.106)
192.168.2.107
gaia.boltsys.com (192.168.2.110)
gsscc.boltsys.com (192.168.2.111)
odin.boltsys.com (192.168.2.112)
aether.boltsys.com (192.168.2.113)
chaos.boltsys.com (192.168.2.117)
pontos.boltsys.com (192.168.2.118)
192.168.2.120
192.168.2.125
artemis.boltsys.com (192.168.2.102)

The jail host is chaos, jails are gaia, gsscc, and pontos. Without showing
examples of all the pings, what I have is that any jail can ping the other jails
and the host but can not ping any other host in 192.168.2.0/24, e.g., using
gaia:

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
ether c8:9c:dc:eb:ab:fb
inet 192.168.2.110 netmask 0xffffffff broadcast 192.168.2.110
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.0.1.1 netmask 0xffffffff

gaia:~> ping -c 1 gsscc
PING gsscc.boltsys.com (192.168.2.111): 56 data bytes
64 bytes from 192.168.2.111: icmp_seq=0 ttl=64 time=0.025 ms
--
gaia:~> ping -c 1 pontos
PING pontos.boltsys.com (192.168.2.118): 56 data bytes
64 bytes from 192.168.2.118: icmp_seq=0 ttl=64 time=0.021 ms
---
gaia:~> ping -c 1 artemis
PING artemis.boltsys.com (192.168.2.102): 56 data bytes
ping: sendto: Can't assign requested address

pinging localhost works
gaia:~> ping -c 1 localhost
PING localhost (127.0.1.1): 56 data bytes
64 bytes from 127.0.1.1: icmp_seq=0 ttl=64 time=0.027 ms

and (obviously)

gaia:~> ping -c 1 microosoft.com
PING microosoft.com (52.178.167.109): 56 data bytes
ping: sendto: Can't assign requested address

Does not.

So either that's the way it is suppost to work or there is a 9.3 bug. I assume I
could use chaos as a gateway and use NAT via pf/ipfw but thats not worth the
effort in the production systems, I can just ping from the host.

So my question stands. I can not find out what that error means and do not know
how to reproduce it outside of a jail.

Adam Vande More

unread,
Dec 20, 2016, 11:58:19 AM12/20/16
to DTD, FreeBSD Questions
The message indicates it can't use the correct source address eg ping -S

--
Adam

DTD

unread,
Dec 20, 2016, 12:37:32 PM12/20/16
to Adam Vande More, FreeBSD Questions
Neat, thanks Adam.

gaia:~> ping -S 192.168.2.110 artemis
PING artemis.boltsys.com (192.168.2.102) from 192.168.2.110: 56 data bytes
64 bytes from 192.168.2.102: icmp_seq=0 ttl=64 time=0.974 ms
64 bytes from 192.168.2.102: icmp_seq=1 ttl=64 time=1.082 ms
64 bytes from 192.168.2.102: icmp_seq=2 ttl=64 time=0.742 ms
64 bytes from 192.168.2.102: icmp_seq=3 ttl=64 time=1.256 ms
^C
As 192.168.2.110 is the jail IP address:

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
ether c8:9c:dc:eb:ab:fb
inet 192.168.2.110 netmask 0xffffffff broadcast 192.168.2.110
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active

I guess it's a jail thingy in kernel. Seems like a bug to me but I could not
even find where the error was coming from. Thank you again. I would (and did
not) get -S from 'man ping' as solving the problem

Doug
Reply all
Reply to author
Forward
0 new messages