Solved pkg update issue in jail (no connectivity)

Hi guys,

I have successfully set up jails with ezjail in the past, but for some reason this time it's just not working (on 11.1). I'm sure it's my oversight here or there.
My jail does not have access with the outside world and cannot do a pkg update

Installing the suggest port doesn't work either, as there's no internet connection (telnet from jail doesn't connect either).
 
Last edited:
You need to enable routing and you need to set up routing or NAT in order for the jail to be able to talk to the outside world.
 
Telnet google.com in jail:
telnet google.com 80
root@webserver:~ # telnet google.com 80
google.com: hostname nor servname provided, or not known

In addition to what SirDice said, it looks like you need to add name servers to your guest, too:
Code:
# mv /etc/resolv.conf /etc/resolv.conf.down
# nc -vw 2 freebsd.org 80
nc: getaddrinfo: hostname nor servname provided, or not known
# mv /etc/resolv.conf.down /etc/resolv.conf
# nc -vw 2 freebsd.org 80
Connection to freebsd.org 80 port [tcp/http] succeeded!
# cat /etc/resolv.conf
# Generated by resolvconf
nameserver 208.67.222.222
nameserver 208.67.220.220
Edit to add: 8.8.8.8 is Google. Using 8.8.8.8 instead of google.com to test network issues allows you to bypass DNS resolving issues to focus on routing and connectivity issues. Then once they're sorted, you can fix DNS.

Also, I prefer to use 8.8.178.110 and freebsd.org instead of feeding the maw of Google.
 
You need to enable routing and you need to set up routing or NAT in order for the jail to be able to talk to the outside world.

Thanks for the pointer SirDice. PF wasn't turned on.
Dank je wel voor de suggestie.
 
Back
Top