IPTables: Filtering

From Define Wiki
Jump to navigation Jump to search

Filtering Rules

The Filter rules filter packets based on the admin information. The rules can be edited uusing the iptables command.

There are four basic actions that can be passed:

iptables -A  #Append A rule
iptables -D # Delete A Rule
itables -L #List All Rules
iptables -F #Flush the Rules

List the Rules

To see the rules that are currently in place use the '-L' flag. The rules are shown in three tables based on the direction of the packet.

iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Flush the Rules

Append / Delete A Rule

= Direction (-a)

Filter Rules Apply in three Directions: Outgoing, Incoming and Forwarding.