小编Ale*_* M.的帖子

用于 OpenVPN 的 UFW

我想为 OpenVPN 配置 ufw(简单的防火墙)。

仅允许通过 OpenVPN 进行连接。其他一切都应该被阻止。因此,如果 OpenVPN 断开连接 -> 没有互联网!我在网上找到了这个脚本,我想知道它是否足够好。还是我必须添加更多规则?

#!/bin/bash
###########################################
#          Created by Thomas Butz         #
#   E-Mail: btom1990(at)googlemail.com    #
#  Feel free to copy & share this script  #
###########################################

# Adapt this value to your config!
VPN_DST_PORT=3478

# Don't change anything beyond this point
###########################################

# Check for root priviliges
if [[ $EUID -ne 0 ]]; then
   printf "Please run as root:\nsudo %s\n" "${0}"
   exit 1
fi


# Reset the ufw config
ufw --force reset …
Run Code Online (Sandbox Code Playgroud)

firewall vpn networking ufw openvpn

20
推荐指数
2
解决办法
4万
查看次数

标签 统计

firewall ×1

networking ×1

openvpn ×1

ufw ×1

vpn ×1