-
-
Save KlfJoat/dd675e7052fadbd41481d350825ae3b9 to your computer and use it in GitHub Desktop.
Enable MDNS on a FreeNAS/BSD jail. That will allow a Avahi name resolution of the jail in the local network.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script is to be executed on the FreeNAS/BSD host itself (and not inside the jail) | |
# Warning: The proper space-delimited interface(s) must be passed in mdnsd_flags or it will not work. | |
# usage : ./mnds.sh <jail name or jid> | |
pkg -j ${1} install --yes openmdns | |
sysrc -j ${1} mdnsd_enable=yes | |
#IFACE=$(jexec -l ${1} ifconfig | grep epair | head -n 1 | cut -f1 -d:) # This assumes different networking than I use. | |
IFACE=$(ifconfig -l -u | sed -e 's/[[:space:]]lo.[[:space:]]*//g') # Why use 3 pipes when the base command will format it for you? | |
sysrc -j ${1} mdnsd_flags="${IFACE}" | |
service -j ${1} mdnsd start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment