Skip to content

How To Allow Or Drop Incoming,Outgoing Or Server Packet In IP Base Security | Firewall

Our Score
Click to rate this post!
[Total: 0 Average: 0]

In This Tutorial We Are Going To Learn How To Allow Or Drop Incoming,Outgoing Or Any Server Packet In IP Base Security In Firewall {Iptables}

This Is Very Easy To Configure And Very Simple Also just Follow This

Firstly Login With The Root In Linux

In This First I Will Tell You How To Disable The Services Of SSH Server For Network 1.0.0.0

Here Is The Command How To Disable The Services Of SSH Server For Network 1.0.0.0 In Linux

#iptables -t filter -A INPUT -s 1.0.0.0/8 -p 22 -j DROP
 

Now I Will Tell You How To Allow The Services Of SSH Server For Network 1.0.0.0

#iptables -t filter -A INPUT -s 1.0.0.0/8 -p 22 -j ACCEPT
 p 22 Is The Posts Of SSH Server

Now How To Allow The Services Of FTP Server For Network 2.0.0.0

#iptables -t filter -A INPUT -s 2.0.0.0/8 -p 20 -j ACCEPT
#iptables -t filter -A INPUT -s 2.0.0.0/8 -p 21 -j ACCEPT

Now How To Allow The Services Of FTP Server For Network 1.0.0.0

#iptables -t filter -A INPUT -s 2.0.0.0/8 -p 20 -j DROP

#iptables -t filter -A INPUT -s 2.0.0.0/8 -p 21 -j DROP

 
 
p 20 And p 21 Is The Posts Of FTP Server 
 
 

Now I Am Going To Tell You If I Have To Drop All The Packages But I Have To Allow All Outgoing Traffic So How Can I Do 


Here Is The Command To Configure This 

#iptables -t filter -A INPUT -p -j DROP

#iptables -t filter -A OUTPUT -p -j DROP

#iptables -t filter -A FORWARDING -p -j DROP

Now How To Allow Or Block TCP Services

Here Is The Command You Can See 
 
#iptables -t filter -A INPUT -p tcp -j DROP
 
#iptables -t filter -A INPUT -p tcp -j ACCEPT
 

Now How To Block Any Particular Interface Or Particular Ip So How Can I Do 

Here Is The Command

For Particular Interface 

#iptables -t filter -i ETH0 -s 1.0.0.0/8 -j DROP

For Particular IP

#iptables -t filter -i ETH0 -s 1.0.0.100 -j DROP
 
 
Thi IS All How Allow Or Drop Incoming,Outgoing Or Server Packet In IP Base Security | Firewall {iptables}

Leave a Reply

Discount Offer

Now Get 67% Discount

On Cyber Security Training                                                       Notes  

Click here  To Purchase

%d bloggers like this: