LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   iptables, block port 80? (https://www.linuxquestions.org/questions/linux-security-4/iptables-block-port-80-a-229641/)

frank2 09-12-2004 08:12 AM

iptables, block port 80?
 
Hi.

I want to block port 80 (outgoing) from all pc-s except frmo only one pc (my proxy-server). is this possible? and how is it done? i've read the documentation i could find.

ppuru 09-12-2004 08:20 AM

you can

iptables -A INPUT -p tcp -i <internal NIC> -s ! <your IP> --dport 80 -j REJECT
iptables -A INPUT -p tcp -i <internal NIC> -s <your IP> --dport 80 -j ACCEPT

OR

You can set rules on your proxy server to accept connections only from your pc

frank2 09-12-2004 08:30 AM

i dont't think i expressed my self good enough.

well.

i want to block it on my router running iptables.
proxy are on another server.

i do only want to accept outgoing frmo my proxy.

ppuru 09-12-2004 08:48 AM

iptables -A FORWARD -p tcp -i <internal NIC> -s ! <your IP> --dport 80 -j REJECT

frank2 09-12-2004 09:14 AM

ah, this works great forcing everybody use proxy, thanks guys :D


All times are GMT -5. The time now is 05:55 AM.