Hello guys, i have bought cloudflare security, and i have noticed my IP address is still can be accessed from IP address. and i have noticed a little DDoS attack at my server today again. i want to make it like if someone try to access my IP address then it will redirect directly to my domain name(example.com). maybe it is can stop direct access to my IP address? well i am not sure i just think maybe it is also one way to stop the direct access on IP address. and one more quest does cloudflare stop all access to our Server or just port 80 and 443? and DDoS attack can be on any port or just 80?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
CloudFlare has a list of IP addresses which can be allowed with iptables, the rest can be dropped.
iptables -A INPUT -p tcp -m multiport --dports 80,443 --src 199.27.128.0/21 -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 80,443 --src 173.245.48.0/20 -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 80,443 --src 103.21.244.0/22 -j ACCEPT
[...]
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j DROP
Add all the IP addresses in that list before the DROP statement. Now no one can directly connect to your Droplet via HTTP/HTTPS. Also check CloudFlare frequently to ensure you do not miss IP address changes.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.