• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

slackware linux , block LAN on all port ,except port 80 ?

my Lan is 192.168.166.0/24 . how to block this LAN from accessing my slackware server on all port except port 80 only? I don't want to shut down other linux service like ssh because my other LAN is using it.

0
second_comet
Asked:
second_comet
2 Solutions
 
BlazCommented:
You can do this in iptables with some rules:

iptables -A INPUT -s 192.168.166.0/24 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -s 192.168.166.0/24 -m state --state NEW -j DROP

for more info on iptables rules see http://www.netfilter.org/documentation/HOWTO/packet-filtering-HOWTO.html
0
 
Gabriel OrozcoSolution ArchitectCommented:
another form

iptables -P INPUT DROP
iptables -A INPUT -s 192.168.166.0/24 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT  -m state --state ESTABLISHED,RELATED -j ACCEPT

this way you accept only port 80 and related connections.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now