LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


LinkBack Search this Thread
Old 10-02-2004, 01:29 PM   #1
Registered: Oct 2004
Location: Chicago, IL
Distribution: Fedora Core 2
Posts: 101

Rep: Reputation: 15
how to open ports with iptables


I have a machine running fedora core2 and i am planning on installing qmail...part of the qmail installation requires to have certian ports open:

Outbound ports (tcp)

25 - SMTP
110 - POP services
143 - IMAP
783 - Spamassassin
993 - IMAPS

Inbound Ports (tcp)

25 - SMTP
80 - HTTP
110 - POP services
143 - IMAP
443 - HTTPS
783 - Spamassassin
993 - IMAPS

I ran nmap on my ip and got these results:

Starting nmap 3.50 at 2004-10-03 02:20 CDT
sendto in send_tcp_raw: sendto(3, packet, 40, 0,, 16) => Operation not permitted
Interesting ports on (
(The 1654 ports scanned but not shown below are in state: closed)
20/tcp filtered ftp-data
21/tcp open ftp
22/tcp open ssh
53/tcp open domain
80/tcp open http

FIrst of all what does this mean:
sendto in send_tcp_raw: sendto(3, packet, 40, 0,, 16) => Operation not permitted

its repeats about 30 times and then finally displays the open ports....

I tried to run the follow command:

iptables -A INPUT -p tcp --dport 25 -j ACCEPT

and ran service iptables save

then ran nmap again to see if port 25 would show but it doesnt..

and i missing something?


Old 10-02-2004, 01:46 PM   #2
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30

nmap only shown ports as "open" when (1) iptables allows traffic to that port and (2) some server program is actually listening on that port -- so to see if port 25 is reachable you should first run the qmail server and only then run nmap to see if it can reach the port. Then it will show either "open" or "filtered".


P.S. those sendto errors -- I get them too sometimes, don't know exectly what triggers them though.
Old 10-19-2004, 08:52 AM   #3
Josep Lladonosa
LQ Newbie
Registered: Oct 2004
Distribution: debian
Posts: 1

Rep: Reputation: 1
In a working environment with iptables, it is supposed that
there are rules to accept traffic, and last rule to deny all.
If that is your case, by adding a new rule with -A,
what you do is to put the new rule AFTER the 'denyying all' rule, so it is never checked.

iptables -I INPUT -p tcp --dport 25 -j ACCEPT

Then, you can save rules as the new rule is in the correct place.

Another problem appears if the firewalling machine is also doing NAT. Then, to make ftp work, an iptables module must be loaded, as ftp (active) is an stateful protocol.
If not, make clients to use passive ftp.
1 members found this post helpful.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
open ports with iptables? tykkea811 Linux - Networking 2 12-12-2004 01:43 AM
Iptables: Open some ports! Abomm Linux - Networking 2 05-31-2002 01:49 AM

All times are GMT -5. The time now is 11:58 AM.

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 @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration