Hi.
I host a webserver under a jail, on a FreeBSD 14.0 machine. The jail is started on boot. Here my /etc/rc.conf:
Here's my /etc/jails.conf:
The jail starts on boot, the server behind the jail responds. At this point, it's ok. However, inside this jail, there is no Internet access... until I restart pf on the host machine. Example, after a
And... I got the same issue with opensmtpd inside the jail: I have to do a
So, on this machine, after a boot, I always have to restart pf and smtpd, if I want Internet access for my jail.
Any idea? Did I miss something?
Thanks a lot for your advices.
Regards,
I host a webserver under a jail, on a FreeBSD 14.0 machine. The jail is started on boot. Here my /etc/rc.conf:
Code:
hostname="machine.domain.tld"
ifconfig_em0="DHCP"
ifconfig_em0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
zfs_enable="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
nginx_enable="YES"
ntpd_enable="YES"
sendmail_enable="NONE"
smtpd_enable="YES"
jail_enable="YES"
jail_parallel_start="YES"
jail_list="my_jail"
Here's my /etc/jails.conf:
Code:
my_jail {
# STARTUP/LOGGING
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.consolelog = "/var/log/jail_console_${name}.log";
# PERMISSIONS
allow.raw_sockets;
exec.clean;
mount.devfs;
# HOSTNAME/PATH
host.hostname = "${name}";
path = "/jails/containers/${name}";
# NETWORK
#ip4 = inherit;
ip4.addr = "192.168.1.201";
interface = em0;
# MISC
jid = 1;
persist;
}
The jail starts on boot, the server behind the jail responds. At this point, it's ok. However, inside this jail, there is no Internet access... until I restart pf on the host machine. Example, after a
jexec my_jail, a simple ping google.fr returns a Unknown host. After a service pf restart, the jail can go to Internet (the ping is OK).And... I got the same issue with opensmtpd inside the jail: I have to do a
service smtpd restart on the host. After, the jail can send emails.So, on this machine, after a boot, I always have to restart pf and smtpd, if I want Internet access for my jail.
Any idea? Did I miss something?
Thanks a lot for your advices.
Regards,