Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a Plusserver Firewall and need to add two rules to allow me to access an http and https website.

iptables -A OUTPUT -p tcp --dport 80 -d 00.00.00.00 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -d 00.00.00.00 -m state --state NEW -j ACCEPT

If i use only one line will work, any of each these but not both in same time.

I restarted the firewall. and nothing.

Thanks.

Later edit: I found the problem. At the end of each line should have an ; close line.

share|improve this question

migrated from stackoverflow.com Sep 13 '12 at 19:12

This question came from our site for professional and enthusiast programmers.

1 Answer 1

Thought the fault could be in the --state, can your try this example

iptables -A OUTPUT -p tcp --dport 80 -d 00.00.00.00 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p tcp --dport 443 -d 00.00.00.00 -m state --state NEW,ESTABLISHED -j ACCEPT

When it doesn't success, you can take a look at this article http://www.cyberciti.biz/tips/linux-iptables-11-how-to-block-or-open-httpweb-service.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.