일부 VPN 클라이언트가 포함된 OpenVPN 서버가 있고 모든 클라이언트에 대해 이 하위 도메인에 대한 액세스를 차단하고 싶습니다:teampeak.site.com OpenVPN 구성을 사용하여 이를 달성할 수 있는 방법이 있습니까? 그렇지 않다면 iptables 규칙은 어떻습니까? 먼저 호스트 파일을 사용하려고 시도했지만 OpenVPN이 파일을 고려하지 않는 것 같습니다. 내 OpenVPN 구성은 다음과 같습니다.
port 1194 #- port
proto udp #- protocol
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
reneg-sec 0
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
#plugin /usr/lib64/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login #- Comment this line if you are using FreeRADIUS
#plugin /etc/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf #- Uncomment this line if you are using FreeRADIUS
client-cert-not-required
username-as-common-name
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 5 30
comp-lzo
persist-key
persist-tun
status 1194.log
verb 3
답변1
다음과 같이 iptables 규칙을 시도해 볼 수 있습니다.
iptables -A FORWARD -i tun0 -d <IP of teamspeak.site.com> -j REJECT
이렇게 하면 tun0을 통해 들어오는 모든 연결 시도가 거부됩니다 teamspeak.site.com
.
사전에 도메인 IP 주소를 확인해야 합니다.