brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: ufw allow in on tailscale0 trusts one interface instead of addresses

Ufw
~/tips/tip-ufw-allow-in-on-interface

sudo ufw allow in on tailscale0

Allows traffic arriving on one network interface, such as a VPN.

Peers on a VPN change address often. A rule tied to the interface avoids chasing IP ranges.

sudo ufw allow in on tailscale0
sudo ufw allow in on tailscale0 to any port 22 proto tcp

The first line opens every port to traffic that arrives on tailscale0, the second only SSH. Public interfaces stay closed under the default deny policy. Use the narrow form if you do not want every device on the tailnet to reach every service. The interface must exist for the rule to match anything, so the name comes from ip link. Rules for an interface also survive a change of the VPN address.

Further reading: ufw manual page

More Ufw tips sudo ufw app update all sudo ufw show raw sudo ufw allow to 10.0.0.1 proto esp sudo ufw allow to 224.0.0.0/24 from 10.0.0.1 proto vrrp sudo ufw show listening All Ufw tips (32) All topics

Link