nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

iptables rules blocking ftp

This is a discussion on iptables rules blocking ftp within the Linux software forums, part of the Linux Getting Started category; Hi, I followed this article to configure my ftp server: http://www.cyberciti.biz/faq/iptables-open-ftp-port-21/ with my ftp client i have this: -------------------------------------------------------------------------- 220-=(<*>)=-.:. ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 09-19-2006, 05:40 PM
Junior Member
User
 
Join Date: Sep 2006
Posts: 5
Rep Power: 0
hammooda
Default iptables rules blocking ftp

Hi,
I followed this article to configure my ftp server:
http://www.cyberciti.biz/faq/iptables-open-ftp-port-21/

with my ftp client i have this:
--------------------------------------------------------------------------
220-=(<*>)=-.:. (( Welcome to PureFTPd 1.1.0 )) .:.-=(<*>)=-
220-You are user number 1 of 50 allowed
220-Local time is now 10:57 and the load is 0.00. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.

USER toto


331 User toto OK. Password required

PASS ******


230-User toto has group access to: 502
230 OK. Current directory is /

SYST


215 UNIX Type: L8


PWD

257 "/" is your current location

TYPE A


200 TYPE is now ASCII

PORT 172,19,45,229,13,67


200 PORT command successful

LIST

425 Could not open data connection to port 14592: Connection timed out
-------------------------------------------------------------------

is there any rule that i have to add or should i change one?
do you have any idea?
please help me
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-19-2006, 07:57 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Hi,

Before adding those iptables rules add following two command:
Code:
modprobe ip_conntrack
modprobe ip_conntrack_ftp
Next load the iptables rules and try out ftp. It should work now. Let me know if you need more help.
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #3 (permalink)  
Old 09-19-2006, 09:21 PM
Junior Member
User
 
Join Date: Sep 2006
Posts: 5
Rep Power: 0
hammooda
Default

Yes it's working now
tanx for your help!
what's these commands mean?
Reply With Quote
  #4 (permalink)  
Old 09-19-2006, 11:21 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

FTP is a complex protocol when you use iptables (or nat via iptable you need to use ip_conntrack_ftp. It does help or it is ftp connection tracking helper. In short if you want to use passive ftp you need to use this kernel module.

Above two modules enables connection tracking. Please read my previous tutorial for more info:

http://www.cyberciti.biz/nixcraft/vi...onnection.html
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #5 (permalink)  
Old 09-20-2006, 04:57 PM
Junior Member
User
 
Join Date: Sep 2006
Posts: 5
Rep Power: 0
hammooda
Default

ok thanx!
Reply With Quote
  #6 (permalink)  
Old 09-23-2006, 02:18 AM
Junior Member
User
 
Join Date: Sep 2006
Posts: 5
Rep Power: 0
hammooda
Default

by the way, i'm trying to set up an smtp relay to my exchange server on this machine, I tried sendmail but it's too difficult to configure , so i think i will use postfix

do you know any site talking about such config?
Reply With Quote
  #7 (permalink)  
Old 09-23-2006, 06:03 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,061
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Edit /etc/postfix/main.cf and add/append line

Code:
relayhost = smtp.isp.com
Restart postfix. Here are few tutorils:
http://www.postfix.org/docs.html

If you want a book try - Setup and Run a Small Office Email Server Using Postfix, Courier, Procmail, Squirrelmail, Clamav and Spamassassin, see my review:
http://www.cyberciti.biz/tips/book-l...ce-server.html
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #8 (permalink)  
Old 09-23-2006, 05:24 PM
Junior Member
User
 
Join Date: Sep 2006
Posts: 5
Rep Power: 0
hammooda
Default

thanx for the tips, but I have a permanent access to internet and a domain name, I don' t need (and i don't want) to pass by my isp's smtp,

what i want is to realy all the mail coming from my mail server to this machine (where i run postfix) and it will send it trough internet,

and vice versa, all the mail coming from internet will be rerouted to my mail server

is it possible with postfix? what can i do?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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 On

Similar Threads

Thread Thread Starter Forum Replies Last Post
blocking streaming zafar466 CentOS / RHEL / Fedora 0 04-12-2008 04:37 AM
MSN and yahoo messanger blocking through IPTABLES surmandal Linux software 1 03-31-2007 01:04 AM
Blocking port in iptables asim.mcp Linux software 3 07-17-2006 11:00 PM
iptables rules for three ethernet brijeshchougule Linux software 2 06-16-2005 03:42 PM
Forum rules vivek Feedback & Site News 0 02-01-2005 12:04 PM


All times are GMT +5.5. The time now is 01:21 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36