General question about chains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

While I have used iptables for a while, I have found that I needed to gain
more knowledge to push what I am doing with it to another level.

I have read through a few things on-line and in the readme stuff, but have
some confusion that I want to clear up.

I am thinking that a chain is a group of rules, and I can create multiple
chains to define rules for different things.
Lets say FTP-RULES, SPAM-RULES etc.

If I do this I can hopefully flush just one group or chain without effecting
the other rules is what I am thinking.

When I execute a rule I do this:
iptables -A INPUT -p tcp -s 118.242.0.0/16 -j LOG --log-prefix SPAM-BLOCK-
CIDR-ASIAN
iptables -A INPUT -p tcp -s 118.242.0.0/16 --dport 25 -j DROP


I wanted to change it to add it to a chain like so:
iptables CIDR-ASIAN -A INPUT -p tcp -s 118.242.0.0/16 -j LOG --log-prefix
SPAM-BLOCK-CIDR-ASIAN
iptables CIDR-ASIAN -A INPUT -p tcp -s 118.242.0.0/16 --dport 25 -j DROP

iptables -N CIDR-ASIAN -A INPUT -p tcp -s 118.242.0.0/16 -j LOG --log-prefix
SPAM-BLOCK-CIDR-ASIAN
iptables -N CIDR-ASIAN -A INPUT -p tcp -s 118.242.0.0/16 --dport 25 -j DROP

This didn't work for me and I have tried several varients with no luck.

So my first question is do I understand correcty how to utilize chains?

Will I be able to load and unload chains rather than flush everything end
reload everything? ( I have a lot of rules )

Sample syntax would be great because I have found a million sites without
seeing what I really want.

Finally when I go to save these chains like the docs say
iptables-save -t fail2ban-VSFTPD I get the following error:
iptables-save v1.2.11: Can't initialize: Table does not exist (do you need
to
insmod?)

This happens on different versions of Centos & on a RH as well.

Thanks! ( sorry for the long description ).


--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux