LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-07-2014, 10:05 AM   #1
Colatra
LQ Newbie
 
Registered: Aug 2014
Distribution: Slackware
Posts: 25

Rep: Reputation: Disabled
iptables http problem


hey guys
i can't access any http website.
my iptables config. what i'm doing wrong?
Quote:
# Rules
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

# 1.ssh incoming
iptables -A INPUT -p tcp --dport 5678 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 5678 -m state --state ESTABLISHED -j ACCEPT
# 1.ssh outgoing
iptables -A OUTPUT -p tcp --dport 5678 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 5678 -m state --state ESTABLISHED -j ACCEPT

# 2.HTTP incoming
iptables -A INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT

# 2.HHTP Outgoing
iptables -A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT

Last edited by Colatra; 08-07-2014 at 03:41 PM.
 
Old 08-07-2014, 10:33 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,209

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
You can get a count of how many times each rule is triggered. Run it before and after your browse attempt:

iptables -v -L
 
Old 08-07-2014, 02:55 PM   #3
Colatra
LQ Newbie
 
Registered: Aug 2014
Distribution: Slackware
Posts: 25

Original Poster
Rep: Reputation: Disabled
i want to block all communications except ssh and http, but i can't do that. I'm searching on google and i read a lot and i can't understand where i'm failing.
 
Old 08-07-2014, 03:40 PM   #4
Colatra
LQ Newbie
 
Registered: Aug 2014
Distribution: Slackware
Posts: 25

Original Poster
Rep: Reputation: Disabled
lol solved the problem

Last edited by Colatra; 08-07-2014 at 03:47 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables & MSN over HTTP Ammad Linux - Networking 1 11-04-2009 02:38 PM
iptables open http 80 mad_penguin Linux - Newbie 16 09-14-2009 08:08 AM
iptables, no access through http Israfel2000 Linux - Security 5 10-14-2005 06:01 PM
iptables and http alaios Linux - Security 5 06-09-2004 02:31 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration