Help answer threads with 0 replies.
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 12-12-2004, 01:23 AM   #1
LQ Newbie
Registered: Nov 2004
Location: Atlanta, GA
Distribution: Slackware 10
Posts: 25

Rep: Reputation: 15
open ports with iptables?

How is this accomplished? I want to open ports 6881-6889 for an azureus java bittorrent client i downloaded. I have looked through the manpage for iptables, but honestly, it makes very little sense to me. I'm running slackware 10.0, ide kernel 2.4.26. I haven't recompiled the kernel or messed with system files at all.
I googled (both google and google/linux) for:
opening ports with iptables
understanding iptables
opening closing ports linux
...and have searched the forums here for about 30 minutes, give or take, without success.
I'm just not looking in the right places, or overlooked my answer somewhere. :-)
Maybe nmap could shed light on my lack of knowledge:
root@slack811:/home/tykkea# nmap -O -v -sT

Starting nmap 3.50 ( ) at 2004-12-11 02:25 EST
Host localhost ( appears to be up ... good.
Initiating Connect() Scan against localhost ( at 02:25
Adding open port 111/tcp
Adding open port 6000/tcp
Adding open port 37/tcp
Adding open port 113/tcp
Adding open port 6969/tcp
The Connect() Scan took 0 seconds to scan 1659 ports.
For OSScan assuming that port 37 is open and port 1 is closed and neither are firewalled
Interesting ports on localhost (
(The 1653 ports scanned but not shown below are in state: closed)
37/tcp   open  time
111/tcp  open  rpcbind
113/tcp  open  auth
6000/tcp open  X11
6969/tcp open  acmsoda
Device type: general purpose
Running: Linux 2.4.X|2.5.X
OS details: Linux Kernel 2.4.0 - 2.5.20
Uptime 0.316 days (since Fri Dec 10 18:50:24 2004)
TCP Sequence Prediction: Class=random positive increments
                         Difficulty=5128201 (Good luck!)
IPID Sequence Generation: All zeros

Nmap run completed -- 1 IP address (1 host up) scanned in 4.878 seconds
Do I need to add the ports to /etc/services, then edit /etc/inetd.conf? The ports are not listed in /etc/services.

Thanks in advance.
Old 12-12-2004, 01:32 AM   #2
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
You need to add following iptables rules to your file:

iptables -A INPUT -p tcp --dport 6881:6889  -j ACCEPT
iptables -A OUTPUT -p tcp --dport 6881:6889  -j ACCEPT
Make sure you add this rule before your last line of script which reads something like
iptables -A INPUT -s 0/0 -j DROP
Old 12-12-2004, 01:43 AM   #3
LQ Newbie
Registered: Nov 2004
Location: Atlanta, GA
Distribution: Slackware 10
Posts: 25

Original Poster
Rep: Reputation: 15
Thank you, nixcraft.


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
how to open ports with iptables lsimon4180 Linux - Security 7 07-07-2014 02:06 PM
How can I open up ports in iptables? ekerik Linux - Networking 13 10-07-2009 11:00 AM
Open All Ports - iptables Artik Linux - Networking 2 06-21-2005 03:17 PM
ports open with iptables saugato Linux - Security 3 04-19-2005 01:31 AM
Iptables: Open some ports! Abomm Linux - Networking 2 05-31-2002 01:49 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:59 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