Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-11-2004, 04:11 PM   #1
Registered: Aug 2004
Location: Maine
Distribution: Gentoo Linux
Posts: 239

Rep: Reputation: 30
Question about port blocking with Iptables

I am running an IPCop 1.3 firewall/router

it is set so that is my default administration for the webGUI

it also seems to be open for remote administration on 81 from outside my network

Anyways if I wanted to block outside access to 81
would this be Appropriate for doing so.....

iptables -A INPUT -s ! -p tcp --destination-port 81 -j DROP

Last edited by GUIPenguin; 10-11-2004 at 05:36 PM.
Old 10-11-2004, 06:14 PM   #2
Senior Member
Registered: Feb 2003
Location: The Real Washington
Distribution: Debian, Android
Posts: 1,819

Rep: Reputation: 46
While that would work, I would tighten it down a bit. If you manage the machine from only one other location try this

iptables -A INPUT -p tcp -s 192.168.0.X --destination-port 81 -j ACCEPT
iptables -A INPUT -p tcp -s 0/0 --destination-port 81 -j DROP

(replace the X in the ip address above with the address of the machine you want to use to manage it, or with a 0 if you want any internal ip to be allowed access.) The second line protects against weak general policies. Anything that doesn't match the first rule exactly, will go to the second rule and be dropped cold.
Old 10-11-2004, 06:25 PM   #3
Registered: Aug 2004
Location: Maine
Distribution: Gentoo Linux
Posts: 239

Original Poster
Rep: Reputation: 30
thanks alot

Last edited by GUIPenguin; 10-11-2004 at 06:33 PM.


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
Question about iptables port forwarding <Ol>Origy Linux - Networking 3 05-21-2005 04:29 PM
iptables forward port question lnx8 Linux - Security 3 05-06-2004 09:35 PM
Iptables port forwarding question Renfro Linux - Security 1 10-11-2003 07:42 AM
iptables PREROUTING and blocking question bakuretsu Linux - Security 3 09-12-2002 10:49 AM
iptables - advanced port blocking/stealth mode siymann Linux - Security 1 10-26-2001 05:21 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:39 PM.

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