LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 12-12-2004, 01:23 AM   #1
tykkea811
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:
Code:
root@slack811:/home/tykkea# nmap -O -v -sT 127.0.0.1

Starting nmap 3.50 ( http://www.insecure.org/nmap/ ) at 2004-12-11 02:25 EST
Host localhost (127.0.0.1) appears to be up ... good.
Initiating Connect() Scan against localhost (127.0.0.1) 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 (127.0.0.1):
(The 1653 ports scanned but not shown below are in state: closed)
PORT     STATE SERVICE
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
nixcraft
Member
 
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:

Code:
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
tykkea811
LQ Newbie
 
Registered: Nov 2004
Location: Atlanta, GA
Distribution: Slackware 10
Posts: 25

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:18 PM.

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
Open Source Consulting | Domain Registration