Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-07-2014, 10:05 AM
|
#1
|
LQ Newbie
Registered: Aug 2014
Distribution: Slackware
Posts: 25
Rep:
|
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.
|
|
|
08-07-2014, 10:33 AM
|
#2
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,209
|
You can get a count of how many times each rule is triggered. Run it before and after your browse attempt:
iptables -v -L
|
|
|
08-07-2014, 02:55 PM
|
#3
|
LQ Newbie
Registered: Aug 2014
Distribution: Slackware
Posts: 25
Original Poster
Rep:
|
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.
|
|
|
08-07-2014, 03:40 PM
|
#4
|
LQ Newbie
Registered: Aug 2014
Distribution: Slackware
Posts: 25
Original Poster
Rep:
|
lol solved the problem
Last edited by Colatra; 08-07-2014 at 03:47 PM.
|
|
|
All times are GMT -5. The time now is 09:25 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|