Skip to content

Instantly share code, notes, and snippets.

@nshalman
Created July 13, 2022 02:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nshalman/2ee472eb1ca3695908983fc2d9439a1a to your computer and use it in GitHub Desktop.
Save nshalman/2ee472eb1ca3695908983fc2d9439a1a to your computer and use it in GitHub Desktop.
Tailscale in LX branded zones
vmadm create -f lx-tailscale.json
ZONENAME=$(vmadm list -Ho zonename alias=lx-tailscale)
zonecfg -z ${ZONENAME?} "add device ; set match=tun ; end"
vmadm reboot ${ZONENAME?}
zlogin ${ZONENAME?}
curl -LO https://go.dev/dl/go1.18.4.linux-amd64.tar.gz
tar xzf go1.18.4.linux-amd64.tar.gz
apt-get update
apt-get -y install git
git clone -b illumos-1.26 https://github.com/nshalman/tailscale
cd tailscale
PATH=../go/bin:$PATH bash -x build.sh
cd v*illumos*
/native/usr/bin/elfedit -e "ehdr:ei_osabi ELFOSABI_SOLARIS" tailscale
/native/usr/bin/elfedit -e "ehdr:ei_osabi ELFOSABI_SOLARIS" tailscaled
cp tailscale tailscaled /usr/sbin/
cp ../cmd/tailscaled/tailscaled.defaults /etc/default/tailscaled
echo PATH=/native/sbin:/native/usr/sbin:/native/usr/bin >> /etc/default/tailscaled
cp ../cmd/tailscaled/tailscaled.service /etc/systemd/system
sed '/cleanup/d;/notify/d' -i /etc/systemd/system/tailscaled.service
systemctl daemon-reload
systemctl enable --now tailscaled
tailscale up
{
"alias": "lx-tailscale",
"hostname": "lx-tailscale",
"brand": "lx",
"kernel_version": "4.3.0",
"max_physical_memory": 2048,
"quota": 10,
"image_uuid": "0bf06d4d-b62f-4b3b-b560-3cd258df2070",
"resolvers": ["8.8.8.8","8.8.4.4"],
"nics": [
{
"nic_tag": "admin",
"ips": ["dhcp"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment