Skip to content

Conversation

@tendstofortytwo
Copy link
Contributor

@tendstofortytwo tendstofortytwo commented Nov 23, 2023

Updates #9084.

Currently, we have to tell users to manually open UDP ports on Linux when certain firewalls (like ufw) are enabled. This change automates the process of adding and updating those firewall rules as magicsock changes what port it listens on.

Updates #9084.

Currently, we have to tell users to manually open UDP ports on Linux when
certain firewalls (like ufw) are enabled. This change automates the process of
adding and updating those firewall rules as magicsock changes what port it
listens on.

Signed-off-by: Naman Sood <mail@nsood.in>
@tendstofortytwo tendstofortytwo force-pushed the naman/linuxfw-magicsock-port-rule branch from 8524910 to 15d5e0d Compare November 23, 2023 21:23
Signed-off-by: Naman Sood <mail@nsood.in>
Signed-off-by: Naman Sood <mail@nsood.in>
@tendstofortytwo tendstofortytwo requested review from twitchyliquid64 and removed request for raggi November 27, 2023 20:00
Copy link
Contributor

@twitchyliquid64 twitchyliquid64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great! Have you had a chance to test this on a variety of linux distros? No better test coverage than tests that arent tests lol

And afaict youre mostly changing the wiring in userspace.go - that should apply to use in both tailscaled.go and tsnet.go, but maybe double check the way that tsnet initializes all the subsystems is compatible with your changes?

Signed-off-by: Naman Sood <mail@nsood.in>
Signed-off-by: Naman Sood <mail@nsood.in>
@tendstofortytwo
Copy link
Contributor Author

tendstofortytwo commented Dec 5, 2023

@twitchyliquid64 tested on arch+no firewall, fedora+firewalld, and ubuntu+ufw, seems to correctly create the iptables/nftables rules in all of those cases.

looking at tsnet/tsnet.go, it seems like tsnet uses a fake router, not the linux one, so this should not affect tsnet at all, I think?

@twitchyliquid64
Copy link
Contributor

Excellante!

@tendstofortytwo tendstofortytwo merged commit d46a4ec into main Dec 5, 2023
@tendstofortytwo tendstofortytwo deleted the naman/linuxfw-magicsock-port-rule branch December 5, 2023 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants