OpenVPN show the DNS server in clear when you connect but i want to hide that from public. ( It shows that in logs and network adapter in Windows for example )
DNS server alreadly have rules to receive DNS request only from the VPN IP address. ( i alreadly protect the DNS server with IP Tables to receive request from the verified VPNs IP Address ) now i want to hide the IP from DDoS or other type of malicious attack.
Why?
Because all VPN server have only 2 server but if those two goes down, VPNs stop working.
I alreadly try to do a route, but without success.
That's my actual iptables rules.
iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -s cc.cc.cc.cc -j ACCEPT
iptables -A INPUT -p udp --dport 22 -s cc.cc.cc.cc -j ACCEPT
iptables -A INPUT -p udp --dport 53 -s xx.xx.xx.81 -j ACCEPT
iptables -A INPUT -p udp --dport 53 -s xx.xx.xx.81 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j DROP
iptables -A INPUT -p udp --dport 22 -j DROP
iptables -A INPUT -p udp --dport 53 -s xx.xx.xx.81 -j ACCEPT
iptables -A INPUT -p udp --dport 53 -s xx.xx.xx.81 -j ACCEPT
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to yy.yy.yy.120:53
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to yy.yy.yy.120:53
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.9.0.0/24 -o eth0 -j MASQUERADE
iptables -A PREROUTING -t nat -i eth0 -p udp --dport 443 -j REDIRECT --to-port 20303
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 13019
OpenVPN server.conf
server 10.8.0.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS yy.yy.yy.120"
NB: xx.81 is the VPN server and yy.120 is the DNS Server.