Virtuozzo iptables firewall

Recently I got chance to play with Virtuozzo VPS. Good news is they are good to reduced cost and bad news (as of Dec-04, 2004) they do not support full iptables rule set like –state and –log etc. After spending more than 4+ hrs I was able to setup simple but effective firewall on Red hat enterprise linux Virtuozzo VPS. Here is script. Make sure you customize it for your environment.

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
26 comments… add one
  • Jigme Jan 23, 2010 @ 9:02

    Hi,

    Thanks so much for sharing!

    Would your script work with Debian Etch Virtuozzo VPS?

    Thanks so much again,

  • Ashraf Jul 28, 2009 @ 0:09

    Hello,

    When I add a IP to reject the connection, it does not work. And website is working for few minutes when I restart the VPS service. Again it does not load page or very slow. Is this something to do with the default firewall on virtuazzo?

  • ecoagora Jan 5, 2008 @ 21:43

    Sorry for the late post, hopefully I’m not opening a can of worms…

    Am I missing something, or should the following be part of the script (@ the bottom)? (first time using iptables)

    service iptables save
    service iptables restart

  • Anderson Oct 15, 2007 @ 21:53

    Hello
    I’m really new in linux and vps server
    and under ddos attack

    Can i know what are the most important rules ?

    I already added mod_evasive for virtuozzo vps but don-t seems to be ok coz my httpd conf change after the first 10 second of the attack.

    How can i find the complete tutorial to add thisfirewall rules ?

    thank you.

  • Anderson Oct 2, 2007 @ 1:56

    Hello
    I’m really new in linux and vps server
    and under ddos attack

    Can i know what are the most important rules ?

    I already added mod_evasive for virtuozzo vps but don-t seems to be ok coz my httpd conf change after the first 10 second of the attack.

    How can i find the complete tutorial to add thisfirewall rules ?

    thank you.

  • 🐧 nixcraft Mar 13, 2006 @ 21:22

    Ok, I found file in old backup and i had uploaded it here

    Test it and let me know. it is same file which was removed by me

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.