How to add a rule in user define chain.
Hi,
I have created a new user define chain # iptanles -N blacklist Normally when we add a new rule it automatically insert in the default iptable but when we create a user define chain then how can I add my rules in this chain ? 2- How can i execute the user define chain ? thanks in advance garden |
Basically you give the name of the chain as first argument with -A, -I and -R after that the rule contents you want to add, insert or replace. See 'man iptables'.
|
Thanks unSpawn for the reply. well if you kindly write a simple example then it will be clear for me to understand. According to my understand i did as following
Code:
# iptables -t blacklist -A INPUT -s 192.168.1.10 -j drop please guide me , thanks in advance. |
If you read 'man iptables' like I suggested then you'd see "-t" is for tables (see `cat /proc/net/ip_tables_names`) and usually that'll be "filter". In the "filter" table "INPUT" refers to one of the default chains. So you rule would become 'iptables -t filter -A blacklist -s 192.168.1.10 -j DROP'.
|
All times are GMT -5. The time now is 09:45 AM. |