After some fighting I finally got ezjail to work.
Some overview before I hit you all up with a few issues and questions.
Running FreeBSD 10.1 on a VBox for testing purposes.
The jail 'www' is running.
>ezjail-admin console www:
I can ssh to my other server
But I cannot build any ports to populate the jail!
I am very confused. I have always used
I understand that /usr/jails/basejail has the ports dir used for all jails commonly, and that each jail issues a mount_nullfs to mount the common ports dir from inside the host as by the fstab.<jail.name> file, which is being done:
But, what am I missing? is not being able to route OUT from the jail a feature, and not something I should fix? How do I install ports without being able to route to www.FreeBSD.org? Is there a way I can turn on ALL traffic, ICMP included, to the jails and just control things with PF the way I am accustomed? And finally, I keep getting emails from a Nigerian Prince who wants to send me $1 million, and all I have to do is send him a cashiers check for $2k... Should I do it?
Some overview before I hit you all up with a few issues and questions.
Running FreeBSD 10.1 on a VBox for testing purposes.
Code:
root@freebsd_vm01:/usr/home/tim.falardeau # cat /etc/rc.conf
hostname="freebsd_vm01"
ifconfig_em0="inet 192.168.1.50 netmask 255.255.255.0"
ifconfig_em0_alias0="inet 192.168.1.51 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
ezjail_enable="YES"
Code:
root@freebsd_vm01:/etc # cat /etc/resolv.conf
nameserver 192.168.1.1
nameserver 8.8.4.4
Code:
root@freebsd_vm01:/usr/local/etc # ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 08:00:27:34:59:b2
inet 192.168.1.50 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.51 netmask 0xffffffff broadcast 192.168.1.51
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@freebsd_vm01:/usr/local/etc #
Code:
root@freebsd_vm01:/usr/local/etc/ezjail # cat /usr/local/etc/ezjail/www
# To specify the start up order of your ezjails, use these lines to
# create a Jail dependency tree. See rcorder(8) for more details.
#
# PROVIDE: standard_ezjail
# REQUIRE:
# BEFORE:
#
export jail_www_hostname="www"
export jail_www_ip="192.168.1.51"
export jail_www_rootdir="/usr/jails/www"
export jail_www_exec_start="/bin/sh /etc/rc"
export jail_www_exec_stop=""
export jail_www_mount_enable="YES"
export jail_www_devfs_enable="YES"
export jail_www_devfs_ruleset="devfsrules_jail"
export jail_www_procfs_enable="YES"
export jail_www_fdescfs_enable="YES"
export jail_www_image=""
export jail_www_imagetype=""
export jail_www_attachparams=""
export jail_www_attachblocking=""
export jail_www_forceblocking=""
export jail_www_zfs_datasets=""
export jail_www_cpuset=""
export jail_www_fib=""
export jail_www_parentzfs=""
export jail_www_parameters=""
export jail_www_post_start_script=""
export jail_www_retention_policy=""
The jail 'www' is running.
Code:
root@freebsd_vm01:/usr/local/etc # jls
JID IP Address Hostname Path
3 192.168.1.51 www /usr/jails/www
Code:
root@freebsd_vm01:/usr/local/etc # ping 192.168.1.51
PING 192.168.1.51 (192.168.1.51): 56 data bytes
64 bytes from 192.168.1.51: icmp_seq=0 ttl=64 time=0.074 ms
64 bytes from 192.168.1.51: icmp_seq=1 ttl=64 time=0.104 ms
64 bytes from 192.168.1.51: icmp_seq=2 ttl=64 time=0.108 ms
64 bytes from 192.168.1.51: icmp_seq=3 ttl=64 time=0.107 ms
64 bytes from 192.168.1.51: icmp_seq=4 ttl=64 time=0.106 ms
^C
--- 192.168.1.51 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.074/0.100/0.108/0.013 ms
>ezjail-admin console www:
Code:
root@www:/etc # cat rc.conf
ifconfig_em0="inet 192.168.1.51 netmask 255.255.255.0"
default_router="192.168.1.1"
Code:
root@www:/etc # ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 08:00:27:34:59:b2
inet 192.168.1.51 netmask 0xffffffff broadcast 192.168.1.51
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
root@www:/etc #
I can ssh to my other server
Code:
root@www:/etc # ssh 192.168.1.10
Password for root@kif:
But I cannot build any ports to populate the jail!
Code:
root@www:/etc # cd /usr/ports/www/apache24
root@www:/usr/ports/www/apache24 # make install clean
===> Building/installing dialog4ports as it is required for the config dialog
===> Cleaning for dialog4ports-0.1.5_2
===> Skipping 'config' as NO_DIALOG is defined
===> License BSD2CLAUSE accepted by the user
===> dialog4ports-0.1.5_2 depends on file: /usr/local/sbin/pkg - not found
===> Skipping 'config' as NO_DIALOG is defined
===> License BSD2CLAUSE accepted by the user
=> pkg-1.8.3.tar.xz doesn't seem to exist in /var/ports/distfiles/.
=> Attempting to fetch http://files.etoilebsd.net/pkg/pkg-1.8.3.tar.xz
fetch: http://files.etoilebsd.net/pkg/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.us-east.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.us-east.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.eu.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.eu.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.us-west.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.us-west.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://mirror.shatow.net/freebsd/pkg/pkg-1.8.3.tar.xz
fetch: http://mirror.shatow.net/freebsd/pkg/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/pkg-1.8.3.tar.xz
fetch: http://distcache.FreeBSD.org/ports-distfiles/pkg-1.8.3.tar.xz: No address record
=> Couldn't fetch it - please try to retrieve this
=> port manually into /var/ports/distfiles/ and try again.
*** Error code 1
Stop.
make[5]: stopped in /basejail/usr/ports/ports-mgmt/pkg
*** Error code 1
Stop.
make[4]: stopped in /basejail/usr/ports/ports-mgmt/pkg
*** Error code 1
Stop.
make[3]: stopped in /basejail/usr/ports/ports-mgmt/dialog4ports
*** Error code 1
Stop.
make[2]: stopped in /basejail/usr/ports/ports-mgmt/dialog4ports
===> Options unchanged
===> apache24-2.4.20_1 depends on file: /usr/local/sbin/pkg - not found
===> License BSD2CLAUSE accepted by the user
=> pkg-1.8.3.tar.xz doesn't seem to exist in /var/ports/distfiles/.
=> Attempting to fetch http://files.etoilebsd.net/pkg/pkg-1.8.3.tar.xz
fetch: http://files.etoilebsd.net/pkg/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.us-east.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.us-east.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.eu.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.eu.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.us-west.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz
fetch: http://distcache.us-west.FreeBSD.org/local-distfiles/portmgr/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://mirror.shatow.net/freebsd/pkg/pkg-1.8.3.tar.xz
fetch: http://mirror.shatow.net/freebsd/pkg/pkg-1.8.3.tar.xz: No address record
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/pkg-1.8.3.tar.xz
fetch: http://distcache.FreeBSD.org/ports-distfiles/pkg-1.8.3.tar.xz: No address record
=> Couldn't fetch it - please try to retrieve this
=> port manually into /var/ports/distfiles/ and try again.
*** Error code 1
Stop.
make[2]: stopped in /basejail/usr/ports/ports-mgmt/pkg
*** Error code 1
Stop.
make[1]: stopped in /basejail/usr/ports/www/apache24
*** Error code 1
Stop.
make: stopped in /basejail/usr/ports/www/apache24
root@www:/usr/ports/www/apache24 #
I am very confused. I have always used
cd /usr/ports/.../.../; make install clean
to install things. I don't mind having traceroute, ping, and such. But, without being able to get to www.freebsd.org for ports and such, how am I supposed to do this? I understand that /usr/jails/basejail has the ports dir used for all jails commonly, and that each jail issues a mount_nullfs to mount the common ports dir from inside the host as by the fstab.<jail.name> file, which is being done:
Code:
root@freebsd_vm01:/etc # cat /etc/fstab.www
/usr/jails/basejail /usr/jails/www/basejail nullfs ro 0 0
root@freebsd_vm01:/etc #
But, what am I missing? is not being able to route OUT from the jail a feature, and not something I should fix? How do I install ports without being able to route to www.FreeBSD.org? Is there a way I can turn on ALL traffic, ICMP included, to the jails and just control things with PF the way I am accustomed? And finally, I keep getting emails from a Nigerian Prince who wants to send me $1 million, and all I have to do is send him a cashiers check for $2k... Should I do it?