Can't ping in jail

doug doug at
Sat Dec 3 23:10:14 UTC 2016

On Sat, 3 Dec 2016, doug wrote:

> This is a 9.3-RELEASE-p49 system. In the jail:
> gaia:~> sysctl security.jail.allow_raw_sockets
> security.jail.allow_raw_sockets: 1
> gaia:~> ifconfig
> em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>        ether c8:9c:dc:eb:ab:fb
>        inet netmask 0xffffffff broadcast
>        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>
> and as root
> gaia:/home/doug# ping -c 2
> PING ( 56 data bytes
> ping: sendto: Can't assign requested address
> ping: sendto: Can't assign requested address
> ^C
> --- ping statistics ---
> 2 packets transmitted, 0 packets received, 100.0% packet loss
> ctrl-c is required to end the command. This is without a loopback defined. If 
> I define the loopback I can ping but nothing else. What am I 
> missing?

Okay after lots of reading: handbook, man pages, wiki's, and google (I did RTFM) 
I an pretty sure I have a routing issue and that security.jail.allow_raw_sockets 
works. That said, I give up. The host was getting its IP via DHCP so I changed 
that, defined the host as a gateway, did what I know how to so with netmasks and 
set all the sysctl's that seemed remotely related to this in the host. At the 
end of the day virtually all combinations of the aforementioned allow the jail 
to ping its own IP and localhost. Now moving on to stuff that pays the rent. Any 
thoughts welcomed though.

More information about the freebsd-questions mailing list