Linux ultimate self-hosted network security guide ║ Linux 终极自托管网络安全指南 ║ Guía definitiva de seguridad de red autohospedada de Linux ║ लिनक्स परम स्व-होस्टेड नेटवर्क सुरक्षा गाइड ║ Окончательное руководство по безопасности собственной сети Linux
MIT License
772
stars
60
forks
source link
How to: Make AdGuard UI and DNS service ports only accessible via VPN #42
I was fiddling around a bit with ufw and decided to share my results with you: How to Make AdGuard UI and DNS service ports only accessible via VPN
Note: by enabling ufw you can block new connections required to manage your server (SSH). Make sure you keep an SSH connection to your server open and test the rules by opening a another SSH connection. Otherwise you risk loosing access to your server!
Allow access to the Wireguard VPN server (in this case the default port used in this tutorial)
sudo ufw allow 51820
Identify network adapter used by Wireguard (can be identified by a name starting with "wg" followed by a number, if you start with a fresh install and follow this tutorial it should be wg0)
ip link show
Allow access to all ports by requests coming from the Wireguard network adapter
sudo ufw allow in on wg0
Enable ufw
sudo ufw enable
Check the status of ufw
sudo ufw status numbered
I hope you find these rules useful. Feedback, modifications and suggestions are welcome 😊
I was fiddling around a bit with ufw and decided to share my results with you: How to Make AdGuard UI and DNS service ports only accessible via VPN Note: by enabling ufw you can block new connections required to manage your server (SSH). Make sure you keep an SSH connection to your server open and test the rules by opening a another SSH connection. Otherwise you risk loosing access to your server!
I hope you find these rules useful. Feedback, modifications and suggestions are welcome 😊