-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc/networking/firewall: add more restrictive UFW rules #12266
Conversation
88304ed
to
948abb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of it, I was about to do it :)
|
||
# allow the guest to have access to outbound connections | ||
# determine <IPv4> with: lxc network list | grep lxdbr0 | ||
sudo ufw route allow in on lxdbr0 from <IPv4> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make it easy to copy and paste (as well as explain what it does):
CIDR4="$(lxc network get lxdbr0 ipv4.address | sed 's|\.[0-9]\+/|.0/|')"
CIDR6="$(lxc network get lxdbr0 ipv6.address | sed 's|:[0-9]\+/|:/|')"
sudo ufw route allow in on lxdbr0 from "${CIDR4}"
sudo ufw route allow in on lxdbr0 from "${CIDR6}"
948abb7
to
2255e6d
Compare
Thanks! Updated now - but please check, not sure I understood it 100%. ;) |
No. Those rules don't specify an ip address so they will apply to both ipv4 and ipv6 rulesets. The suggestion in #12266 (comment) was good because my initial suggestion for the route rule was ipv4 specific, so adding an ipv6 specific rule made a lot of sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Ruth!
Add an example for more restrictive firewall rules. Closes canonical#11824 Signed-off-by: Ruth Fuchss <[email protected]>
2255e6d
to
fe67eed
Compare
Add an example for more restrictive firewall rules.
Based on @jdstrand suggestions #11824 (comment)