• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved pkg update issue in jail (no connectivity)

FBSD

Member

Thanks: 4
Messages: 44

#1
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:

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,080
Messages: 26,957

#2
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.
 

linux->bsd

Active Member

Thanks: 35
Messages: 110

#3
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.
 
Top