Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepend Spamhaus chain at top #1

Open
andreaspollak opened this issue Apr 14, 2013 · 2 comments
Open

Prepend Spamhaus chain at top #1

andreaspollak opened this issue Apr 14, 2013 · 2 comments

Comments

@andreaspollak
Copy link

Hi, i prefer to prepend the Spamhaus chain at the top (like fail2ban,...) of iptables, instead of appending it at the bottom.

Line 35-39:

# tie chain to input rules so it runs
$IPTABLES -I INPUT 1 -j $CHAIN

# don't allow this traffic through
$IPTABLES -I FORWARD 1 -j $CHAIN
@mwgentile
Copy link

Agreed. It doesn't do much good to have the rule placed below my explicit deny. Having a "place at top-of-ruleset" option would save the user a step.

@volkan-k
Copy link

you dont need to write rule number (1), it is default if you use "-I" instead of "-A"

-I, --insert chain [rulenum] rule-specification
Insert one or more rules in the selected chain as the given rule number. So, if the rule number is 1, the rule or rules are inserted at the head of the chain. This is also the default if no rule number is specified.

script is open-source, and it allows you to "place at top-of-ruleset" by simply changing two "-A" characters to "-I"
but feel free to fork it on github, amend it to your heart's content, so that it does exactly what you would have it to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants