Well, this is a cluster and your help sorting it out is appreciated. On my desktop, I'm exploring jails via Michael Lucas's Jail Mastery. In that text, it says "For our initial testing, use an IP address already attached to the host". That's a mouthful. It implies that there are addresses attached to the host. I only had one address (other than loopback), so I went messing with the network (always painful). After a bit of travail, here's what I did:
Then I tested the internet and whatnot and I appear to have preserved my access. Then I tested from a remote location and sure enough, I was able to ping both addresses.
So, apparently, I can have multiple ip addresses associated with my nic this way (is it the right way?).
Next up was the jail. I created a place for my jails to live, extracted 32 bit 13.2 base.txz, and edited jail.conf:
Then, I fired up sh in the jail:
I got a prompt, and did uname -a
Weird, but seems different from my working env, am I really in a jail?
Apparently so. I added resolv.conf, etc. and then tried ping
Ouch. So, from the host?
Hmm... is that the host or my jail. dunno, kinda lost at this point. Time to bail
Fascinating. I thought sh worked fine, networking, not so much, but sh, WTF?
Any helpful observations appreciated. No, I don't know what I'm doing, but I'd like to
.
Code:
vi /etc/rc.conf
ifconfig_em0="inet 192.168.111.13 netmask 255.255.255.0"
defaultrouter="192.168.111.1"
ifconfig_em0_alias0="inet 192.168.111.131 netmask 255.255.255.255"
service netif restart
service routing restart
Then I tested the internet and whatnot and I appear to have preserved my access. Then I tested from a remote location and sure enough, I was able to ping both addresses.
So, apparently, I can have multiple ip addresses associated with my nic this way (is it the right way?).
Next up was the jail. I created a place for my jails to live, extracted 32 bit 13.2 base.txz, and edited jail.conf:
Code:
$j="/jail";
path="$j/$name";
host.hostname="$name.my.home"
loghost {
ip4.addr="192.168.111.131";
}
Then, I fired up sh in the jail:
Code:
sudo jail /jail/loghost loghost 192.168.111.131 /bin/sh
I got a prompt, and did uname -a
Code:
FreeBSD loghost 14.0-RELEASE-p3 FreeBSD 14.0-RELEASE-p3 #0: Mon Dec 11 04:56:01 UTC 2023 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC i386
Weird, but seems different from my working env, am I really in a jail?
Code:
sysctl security.jail.jailed
security.jail.jailed: 1
Apparently so. I added resolv.conf, etc. and then tried ping
Code:
ping -4 8.8.8.8
ping: ssend socket: Operation not permitted
Ouch. So, from the host?
Code:
ping -4 192.168.111.131
PING 192.168.111.131 (192.168.111.131): 56 data bytes
64 bytes from 192.168.111.131: icmp_seq=0 ttl=64 time=0.045 ms
Hmm... is that the host or my jail. dunno, kinda lost at this point. Time to bail
Code:
# exit
jail: /bin/sh: failed
Fascinating. I thought sh worked fine, networking, not so much, but sh, WTF?
Any helpful observations appreciated. No, I don't know what I'm doing, but I'd like to
