correct way of blocking an IP using Bastille Firewall

Discussion in 'General' started by florix.net, Jan 25, 2011.

  1. florix.net

    florix.net Member

    How can I block an IP or range of IP address using Bastille Firewall?

    I am using ISPConfig 3 on centos 5.5

    Richard
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. mini14

    mini14 New Member

    Hi Till,

    Using "man route" in Centos shows
    Code:
    reject install a blocking route, which will force a route lookup to fail.  This is for example used to mask out net-
                  works before using the default route.  This is NOT for firewalling.
    Why they say "not for firewalling" I'm not sure...but instead of that, I've been adding IP's to block to my pre-chain-split.sh file in the /etc/Bastille/firewall.d directory (ISPConfig2) and it works great.

    For example to block a class C add the following:

    iptables -A INPUT -s 123.456.789.0/24 -j DROP

    and then restart Bastille: /etc/init.d/bastille-firewall restart

    Hope this helps!
     
    biforme likes this.
  4. florix.net

    florix.net Member

    Hi,


    I do not see that file under ISPConfig 3 .. please let me know.

    If I add the rules using command line, and if server restarts, will those rules be applicable?

    Richard
     
  5. 8omas

    8omas Member HowtoForge Supporter

    If we want to use iptables, how can we add our own rules after the bastille rules applied?

    Is there any file that we can paste our 'after' rules?
    My solution so far is to use /etc/rc.local but is it ok?

    I am using debian 6, Ispconfig 3.0.3.2
     

Share This Page