Skip to main content
The code can be embedded in the post; pastebin is unnecessary; edited title
Source Link
bwDraco
  • 46.2k
  • 43
  • 167
  • 209

Iptables just allow http iptables: Allow only HTTP access for web browsing

Have a linux box, want it locked down but just be able to surf internet on it. Why is this script blocking http too?

http://pastebin.com/LyBe1bJJ

Thanks for help.


#!/bin/sh
#
#
iptables -F
 
#
#Set default policies for INPUT, FORWARD and OUTPUT chains
#
iptables -P INPUT DROP                
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
 
#
# Allow TCP connections on tcp port 80
#
iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
 
#
# Set access for localhost
#
iptables -A INPUT -i lo -j ACCEPT
 
 
#
# List rules
#
iptables -L -v

Iptables just allow http access

Have a linux box, want it locked down but just be able to surf internet on it. Why is this script blocking http too?

http://pastebin.com/LyBe1bJJ

Thanks for help.

iptables: Allow only HTTP access for web browsing

Have a linux box, want it locked down but just be able to surf internet on it. Why is this script blocking http too?


#!/bin/sh
#
#
iptables -F
 
#
#Set default policies for INPUT, FORWARD and OUTPUT chains
#
iptables -P INPUT DROP                
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
 
#
# Allow TCP connections on tcp port 80
#
iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
 
#
# Set access for localhost
#
iptables -A INPUT -i lo -j ACCEPT
 
 
#
# List rules
#
iptables -L -v
Source Link
user1448260
  • 71
  • 1
  • 1
  • 3

Iptables just allow http access

Have a linux box, want it locked down but just be able to surf internet on it. Why is this script blocking http too?

http://pastebin.com/LyBe1bJJ

Thanks for help.