Answer the question
In order to leave comments, you need to log in
How to set up UFW blocks on Debian for VPN clients?
Hello friends!
There is a server used as a VPN server to access the benefits of civilization through Europe, this is a VPN that is currently successfully working in the following version:
- Debian 10
- SoftEtherVPN Server (1 hub, everything that is unnecessary is chopped off, the ability to connect from clients is left OpenVPN)
- SoftEtherVPN disables built-in (slow and resource-intensive) NAT and DHCP server functions.
- Instead, DHCP functions are performed by dnsmasq, and VPN clients are hung up on the tap_virtual virtual interface via local bridge: VPN Hub > tap_virtual
- UFW is set as the control shell for iptables, in which it is configured that we have FORWARDING ipv4 and the corresponding packet forwarding rule is entered from eth0 to tap_virtual.
added to /etc/ufw/before.rules and works:
# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to eth0
-A POSTROUTING -s 10.0.2.0/8 -o eth0 -j MASQUERADE
COMMIT
# END OPENVPN RULES
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question