Content deleted Content added
m →General: hlist |
m {{mono}} |
||
Line 154:
[[iptables]] is the current user interface for interacting with [[Linux]] kernel [[netfilter]] functionality. It replaced [[ipchains]]. Other [[Unix]] like operating systems may provide their own native functionality and other [[open source]] firewall products exist. More detailed information about iptables is contained elsewhere. A brief discussion is contained here in order to describe how iptables may be used to configure a Linux firewall.
[[netfilter]] provides a state-full packet filter which can be configured according to [[Network card|network interface]], [[Internet Protocol|protocol]], [[IP address|source and/or destination address]], [[IP port|source and/or destination port]] and the state of the packet. A network packet traverses several ''chains'' between the time it is received by a network interface and the time it is accepted by the host or forwarded to another host. The common chains are
Each of the built-in chains has a default ''policy'' which defines what action is taken for a packet which reaches the end of the chain. Packet traversal ends when a ''rule'' matches the packet and has an action of
The simplest [[iptables]] firewall consists of ''rules'' for each desired service, followed by a rule which indicates that any packets which reach this rule are dropped. A system which only permitted, for example, incoming email traffic would have a rule which accepted connections on the [[Simple Mail Transfer Protocol|SMTP]] port, and then dropped others. A rule would be required which indicated that all established connections were also permitted so that outgoing connections would receive responses from other systems.
====INPUT chain====
The following example shows a simple packet filter for the
Chain INPUT (policy DROP 0 packets, 0 bytes)
Line 170:
0 0 DROP all—any any anywhere anywhere
The addition of an explicit
====OUTPUT chain====
There is less need for an
Chain OUTPUT (policy ACCEPT)
Line 179:
0 0 DROP tcp—any any !server anywhere tcp dpt:smtp
There is no need to include any other rules in this example as the default policy for the
A more restrictive
==General==
|