Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions deploy/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ if [[ -f "$(dirname "$0")/nftables/sandbox-nat.nft" ]]; then
install -m 0644 "$(dirname "$0")/nftables/sandbox-nat.nft" /etc/nftables.d/sandbox-nat.nft
else
cat > /etc/nftables.d/sandbox-nat.nft <<'NFT'
destroy table inet sandboxd

table inet sandboxd {
define SANDBOX_NET = 10.200.0.0/16
define HOST_DNS = 10.200.0.1
Expand Down Expand Up @@ -187,6 +189,12 @@ nft -f /etc/nftables.d/sandbox-nat.nft 2>/dev/null || warn "nft apply deferred u
sysctl -qw net.ipv4.ip_forward=1
echo 'net.ipv4.ip_forward=1' >/etc/sysctl.d/99-workdir.conf

if command -v ufw >/dev/null 2>&1; then
ufw allow in on wdbr0 to 10.200.0.1 port 53 proto udp >/dev/null 2>&1 || true
ufw allow in on wdbr0 to 10.200.0.1 port 53 proto tcp >/dev/null 2>&1 || true
ufw reload >/dev/null 2>&1 || true
fi

# ---------------------------------------------------------------------------
# 6. Config + systemd unit
# ---------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions deploy/nftables/sandbox-nat.nft
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# Apply with: nft -f /etc/nftables.d/sandbox-nat.nft
# Persist via /etc/nftables.conf `include "/etc/nftables.d/*.nft"`.

destroy table inet sandboxd

table inet sandboxd {
# Sandboxes live on this private supernet; one /30 (or tap) per microVM.
define SANDBOX_NET = 10.200.0.0/16
Expand Down
4 changes: 3 additions & 1 deletion deploy/provision-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ systemctl enable --now workdir-net >/dev/null 2>&1
if command -v ufw >/dev/null 2>&1; then
sed -i 's/^DEFAULT_FORWARD_POLICY=.*/DEFAULT_FORWARD_POLICY="ACCEPT"/' /etc/default/ufw
ufw allow 22/tcp >/dev/null 2>&1 || true
ufw allow in on ${BRIDGE} to 10.200.0.1 port 53 proto udp >/dev/null 2>&1 || true
ufw allow in on ${BRIDGE} to 10.200.0.1 port 53 proto tcp >/dev/null 2>&1 || true
yes | ufw enable >/dev/null 2>&1 || true
ufw reload >/dev/null 2>&1 || true
fi
log " uplink=$UPLINK, forwarding on, ufw routes allowed"
log " uplink=$UPLINK, forwarding on, controlled DNS allowed"

# --- 5. build the daemon ---------------------------------------------------
if ! command -v cargo >/dev/null 2>&1; then
Expand Down