LINUX Security with LINUX ..Firewalls are used to ensure that unauthorized access to enterprise through its externally facing access points are prevented. Firewalls technology is more than 10 years old. Using different methods and different technologies, we can configure firewalls to protect the networks and the servers from unauthorized access. Mainly there are two firewalls types. Those are Hardware firewall and Software firewalls.
To build a firewall(software)in LINUX we have to use IPTables
But Guys you do not worry...
it is very easy to than configuring Hardware firewall ...
We will start from basic IPtable
commands...Basic IPTables commands.To check existing IPTables in your server iptables -L
[chain] - Lists your current iptables configurationTo Making modification. iptables -A
[chain] - Append a rule to a desired chain in the current configurationiptables -D
[chain] - Delete a rule from a desired chain in the current configurationiptables -R
[chain] - Replace an existing rule from a desired chain in the current configurationiptables - I
[chain] - (that's a capital I as in Insert) Insert a new rule into a desired chain of the current configurationiptables -N
[chain] - Create a new chainiptables -X
[chain] - Delete a chainiptables -F
- Flush the table of all contentsiptables -p
- Match protocol. Types include, icmp, tcp,udp, alliptables –s
- Match source IP addressiptables –d
- Match destination IP addressiptables – i
- Match "input" interface on which the packet enters.Iptables- o
- Match "output"packet exits Ok. Guys now pls refer this example using above mention commands.iptables -A INPUT -s 0/0 -i eth0 -d 192.168.128.2 -p TCP -j ACCEPTThis command says …………… In this example, iptables is being configured to allow the firewall to accept TCP packets coming in on
interface eth0 from any IP address destined for the firewall's IP address of 192.168.128.2 The "0/0"
representation of an IP address means "any".