Category: Iptables

Linux Ip Tables Configuration, Tutorials and tips

Centos / Redhat 7 Switching back to iptables

Centos / Redhat 7 Switching back to iptables

It may be frustrating to learn yet another firewall (firewalld) in Centos or RHEL 7 . Here is how  you can switch back to the favorite IPTABLES. Stop firewalld and disable it to start...

Writing Iptables rules by hand

Writing Iptables rules by hand

*nat :PREROUTING ACCEPT [92:7226] :POSTROUTING ACCEPT [62:3916] :OUTPUT ACCEPT [62:3916] COMMIT *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] COMMIT

Iptables tutorial and examples

Iptables tutorial and examples

Delete existing rules: iptables -F or iptables –flush Set Default Chain Policies: iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT DROP Block an IP Address: iptables -A INPUT -s a.b.c.d -j...

Securing Server with Iptables ( Block Except )

Securing Server with Iptables ( Block Except )

Securing Server with Iptables Iptables is a great firewall when configured properly but sometimes you can lock yourself out with what you didn’t mean to. When you are starting to work on your firewall,...

Block Ports in IPtables

Block Ports in IPtables

Blocking Ports in Iptables In order to block  a single port you can use the following statement : iptables -A INPUT -p <protocol – udp or tcp>  –dport <portno> -j REJECT In order to...

Redirect or forward ports in iptables

Redirect or forward ports in iptables

Redirect or Forward Ports using Iptables Port Redirection: iptables -t nat -A PREROUTING -i -p tcp –dport -j REDIRECT –to-port or iptables -t nat -I PREROUTING –src ip/mask –dst -p tcp –dport 80 -j...