Hi there. I installed the jails in Freebsd.
Path:
/usr/home/jails/www
jail_enable: NO -> YES
My ip address:
/etc/rc.conf
/etc/jail.conf
Then
Also
Looks like jail is not getting an ip address. What should I do?
Path:
Code:
pwd
Code:
sysrc jail_enable="YES"
My ip address:
Code:
ifconfig
em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
ether 08:00:27:d6:a8:80
inet 192.168.23.45 netmask 0xffffff00 broadcast 192.168.23.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
/etc/rc.conf
Code:
cat /etc/rc.conf
hostname="host"
ifconfig_em0="DHCP"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
jail_enable="YES"
/etc/jail.conf
Code:
cat /etc/jail.conf
www {
host.hostname = dia2.az; # Hostname
ip4.addr = 192.168.23.101; # IP address of the jail
path = "/usr/home/jails/www"; # Path to the jail
mount.devfs; # Mount devfs inside the jail
exec.start = "/bin/sh /etc/rc"; # Start command
exec.stop = "/bin/sh /etc/rc.shutdown"; # Stop command
}
Then
Code:
root@host:/home/jails/www # service jail start www
Starting jails: www.
root@host:/home/jails/www # jls
JID IP Address Hostname Path
1 192.168.23.101 dia2.az /usr/home/jails/www
root@host:/home/jails/www # jexec 1 csh
root@dia2:/ # ping 8.8.8.8
ping: ssend socket: Operation not permitted
Also
Code:
root@dia2:/ # pkg install nginx
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly, please wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly/Latest/pkg.txz: Non-recoverable resolver failure
Address resolution failed for http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly.
Consider changing PACKAGESITE.
Code:
root@dia2:/ # ifconfig
em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
ether 08:00:27:d6:a8:80
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
groups: lo
Looks like jail is not getting an ip address. What should I do?