Networking Forums

Networking Forums > Computer Networking > Linux Networking > Re: Opening ports in an IPtables firewall

Reply
Thread Tools Display Modes

Re: Opening ports in an IPtables firewall

 
 
Timo Voipio
Guest
Posts: n/a

 
      08-04-2003, 09:19 PM
Morgan Sales wrote:

> iptables -N block


Here you might add:

iptables -A block -m state --state INVALID -j LOG --log-prefix "Invalid
packet: "

> iptables -A block -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A block -m state --state NEW -i ! eth0 -j ACCEPT
> iptables -A block -j DROP
> iptables -A INPUT -j block
> iptables -A FORWARD -j block
> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


> I'm trying to open TCP port 4662(inbound) to any IP address. Can anyone
> tell how I might do this.


iptables -I 2 block -p tcp --dport 4662 -j ACCEPT

(which inserts the rule at the second position of the block chain, thus the
packets are let through after they are subjected to cursory inspection
(invalid packets are dropped)).

HTH. If not the RTFM:
http://www.netfilter.org/documentation/index.html#HOWTO (recommended in any
case)

-Timo

PS. If you are interested, I can mail you my firewall script which I wrote
for the firm I work for... nobody has complained and the router has not been
0wn3d/h4x0r3d/r00ted/whatever. I wonder what would happen if I started using
the user account r00t... ;-)

--
Timo Voipio | Helsinki, Finland | ICBM at: 60 11.800 N 024 52.760 E
GeekCode ver 3: GU>CC d s-: a--- C++ UL(+)$>+++$ P+>+++ L++(+) E- W++ N++
o? K? w O M- V- PS PE Y+ PGP+ t 5++ X R tv- b++(++++) DI+ D G e- h! r !y
Remove +newsharvested to e-mail me | Poista +newsharvested jos meilaat

 
Reply With Quote
 
 
 
 
Morgan Sales
Guest
Posts: n/a

 
      08-05-2003, 12:06 AM
Timo Voipio wrote:
> Morgan Sales wrote:


> iptables -I 2 block -p tcp --dport 4662 -j ACCEPT


Many thanks, that sorted it.

> HTH. If not the RTFM:
> http://www.netfilter.org/documentation/index.html#HOWTO (recommended
> in any case)
>
> -Timo
>
> PS. If you are interested, I can mail you my firewall script which I
> wrote for the firm I work for... nobody has complained and the router
> has not been 0wn3d/h4x0r3d/r00ted/whatever. I wonder what would
> happen if I started using the user account r00t... ;-)


if it's not to much trouble I'd be interested in taking a look , my e-mail's
in my sig.

Thanks again.
--
Morgan.
----
* It's too bad she wont live, But then again who does.

Mail: (E-Mail Removed)
Webpage: http://homepage.ntlworld.com/msales


 
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
opening ports S Reugebrink Windows Networking 2 11-12-2007 08:07 PM
Opening NT4 Ports... Art Windows Networking 11 05-26-2006 10:07 PM
Opening Ports Kim Windows Networking 1 12-01-2005 08:59 PM
Opening ports with iptables bazfum@gmail.com Linux Networking 3 12-07-2004 06:54 PM
opening firewall ports on multiple IP mail server Dana Netz Windows Networking 8 08-10-2004 03:34 PM



1 2 3 4 5 6 7 8 9 10 11