Changes

Jump to: navigation, search

OPS235 Lab 6 - CentOS7 - SSD

13 bytes removed, 06:52, 16 June 2016
no edit summary
Since Linux servers may be connected to the Internet, it is very important to run a firewall to control what comes into the computer system, what goes out of the computer system, and what may be forwarded to another computer. A utility called '''iptables''' can be used to set the firewall rules on a Linux server.
Basically, there is a list ('''chain''') of policy rules that packets must pass-through in order to handle packets. If a packet matches a rule, then an action is taken (some examples include: '''ACCEPT''', '''DROP''', '''REJECT''', or '''LOG'''). If the packet passes through the chain of rules without a match, then the packet is directed to the default policy chain (for example: ''ACCEPT'' , ''REJECT'', or ''REJECTDROP'').
You can create your own customized chains (which you will learn in OPS335 course) but to keep thing simple, we only deal with 3 common predefined chains:
==== Setting Default Policy and Policy Exceptions with iptables ====
Usually when setting policy rules with iptables, a general "overall" policy is set (default policy chain), and then set policy rules in other chains which act as exceptions to the default policy. Usually, a general policy would apply to ALL types of packets (tcp, udp, icmp) and all communication port numbers (80, 22, etc).
+++ Show iptables command to set default policy +++Examples:
One example would be to set a overall default policy to reject all incoming and outgoing policies for all packet types (tcp, udp, icmp) for all communication ports. '''iptables -P INPUT DROPiptables -P OUTPUT DROP''' After the overall default policy is set, then append create exception policy rules.
+++ Show iptables command to create policy exceptions +++
13,420
edits

Navigation menu