LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-11-2004, 05:11 PM   #1
GUIPenguin
Member
 
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 http://192.168.1.1:81 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 ! 192.168.0.0 -p tcp --destination-port 81 -j DROP

Last edited by GUIPenguin; 10-11-2004 at 06:36 PM.
 
Old 10-11-2004, 07:14 PM   #2
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Ubuntu, Debian, SuSE, UnSlung, 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, 07:25 PM   #3
GUIPenguin
Member
 
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 07:33 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
Question about iptables port forwarding <Ol>Origy Linux - Networking 3 05-21-2005 05:29 PM
iptables forward port question lnx8 Linux - Security 3 05-06-2004 10:35 PM
Iptables port forwarding question Renfro Linux - Security 1 10-11-2003 08:42 AM
iptables PREROUTING and blocking question bakuretsu Linux - Security 3 09-12-2002 11:49 AM
iptables - advanced port blocking/stealth mode siymann Linux - Security 1 10-26-2001 06:21 AM


All times are GMT -5. The time now is 04:18 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration