summaryrefslogtreecommitdiff
path: root/_posts/2018-10-13-freebsd-jail-networking-continued.md
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-08-05 23:39:28 -0400
committerBen Burwell <ben@benburwell.com>2019-08-05 23:40:21 -0400
commit1baf94c686767eea75c551e1ae12c9acfb4fb98c (patch)
treeef2fabd7b30453d4f51a4a65d0d9b3b87ca18683 /_posts/2018-10-13-freebsd-jail-networking-continued.md
parent2b8fa7b0266d846c8728a65a9fb0bdefc6d48436 (diff)
Move FreeBSD posts to blog
Diffstat (limited to '_posts/2018-10-13-freebsd-jail-networking-continued.md')
-rw-r--r--_posts/2018-10-13-freebsd-jail-networking-continued.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/_posts/2018-10-13-freebsd-jail-networking-continued.md b/_posts/2018-10-13-freebsd-jail-networking-continued.md
new file mode 100644
index 0000000..9653410
--- /dev/null
+++ b/_posts/2018-10-13-freebsd-jail-networking-continued.md
@@ -0,0 +1,24 @@
+---
+title: FreeBSD Jail Networking Continued
+---
+
+I decided to take another crack at the jail configuration I started in
+[Experiment 1]({% post_url 2018-09-20-freebsd-jails %}). After reading bits and
+pieces of a few random websites (including various ServerFault posts), on an
+inkling I added the line `interface = "bge0";` to my `/etc/jail.conf` file and
+ran `service jail restart www` (`bge0` is my LAN interface on the host). After
+`jexec`ing in, I tried `pkg install nginx` again and it worked like a charm!
+
+<!--more-->
+
+I also noticed that when I run `ifconfig` on my host now, both the original
+10.0.2.201 and the jail's 10.0.2.202 addresses had been added to the `bge0`
+interface. I wondered whether that meant that I could now SSH into the host
+using the jail's IP address. So on my laptop, I ran `ssh bb@10.0.2.202` and lo
+and behold, it worked. The opposite, however, is _not_ true: loading
+http://10.0.2.201 in a web browser does not give me the beautiful "welcome to
+nginx" page that http://10.0.2.202 has.
+
+I'm sure some trickier stuff will arise when dealing with NAT and multiple
+interfaces, but for now I'm satisfied that I have a basic understanding of how
+to set up a service in a jail and expose it to the network.