LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-16-2006, 01:44 PM   #1
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Rep: Reputation: 30
Shorewall and Internal FTP Server Problem


Hello All,

I'm not too keen on posting an application question here, but I've attempted to get help via the Shorewall mailing list to no avail. Also, since Shorewall is really just a GUI for iptables, I feel kind of justified

I know that this should be a trivial issue, but I'm stuck. I'm totally new to Shorewall and although I've read all about the zones, they're still a bit confusing for me.

What I'm attempting to do is run an FTP server on an internal machine. I've read the example guide and troubleshooting guide, but I can't figure it out.

My setup:

'net' zone is on an extrenal NIC with a routable IP. I can connect to other services on the box from the inside and outside so network connectivity is good.

My FTP server is running on 10.0.50.10 inside.

LAN clients can connect to the FTP server therefore the FTP server itself is set up correctly.

When I run 'shorewall clear', I can connect to the FTP server from the outside so it seems to be a Shorewall configuration issue for sure.

My Rules:

I feel pretty confident that I fall into example #3 of the Shorewall FTP guide:

Quote:
Example 3. Server running behind a Masquerading Gateway
Suppose that you run an FTP server on 192.168.1.5 in your local zone using the standard port (21). You need this rule:
#ACTION SOURCE DESTINATION PROTO PORT(S) SOURCE ORIGINAL
# PORT(S) DESTINATION
FTP/DNAT net loc:192.168.1.5
However, after changing the IP to 10.0.50.10, no go.

A typical log entry when trying to connect looks like this:

Quote:
Dec 15 10:36:29 munged kernel: Shorewall:net2all: DROP:IN=eth0 OUT= MAC=00:11:95:c5:29:43:00:90:1a:40:df:45:08:00 SRC=209.5.161.208 DST=10.0.50.10 LEN=60 TOS=0x00 PREC=0x00 TTL=57 ID=52574 DF PROTO=TCP SPT=34883 DPT=21 WINDOW=5840 RES=0x00 SYN URGP=0
From this I can see that it is the net2all policy that's dropping the packet. That seems to indicate that my FTP/DNAT rule isn't firing when incoming TCP packets hit the external NIC on port 21. I'm pretty sure this will boil down to me not understanding the zones as well as I should, but I'm kind of confused why a very straightforward cut and paste example from the Shorewall guide doesn't work.

Links, tips, everything appreciated.

Thanks!

Jon
 
Old 12-22-2006, 01:55 PM   #2
tellef
LQ Newbie
 
Registered: Aug 2005
Location: Norway
Distribution: Slackware & Debian.
Posts: 23

Rep: Reputation: 15
From your log s it appears that you have done it right when it comes to forwarding packets to the proper internal address.
However, this is not enough. You must also allow traffic from the same net to sour ftp box like this on the line following your fwd-rule:


FTP/DNAT net loc:192.168.1.5
FTP/ACCEPT net loc:192.168.1.5

Change IP`s as appropriate of course.
 
Old 12-22-2006, 03:33 PM   #3
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
You're right. I should have come back and updated this post. I did indeed need the FTP/ACCEPT rule. I was wrong in thinking that I fell into example #3 as I do not need the DNAT rule.

Thanks!

Last edited by jonwatson; 12-22-2006 at 03:34 PM.
 
  


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
ftp from LInux to Serv-U ftp server problem csross Linux - General 2 11-07-2005 04:35 PM
internal X Server problem w0lv3rin3 Linux - Software 1 04-18-2004 11:42 PM
routing ftp connections to internal server? steepcreep Linux - Networking 1 02-18-2004 02:29 AM
FTP getting through shorewall need help RcK1 Linux - Networking 2 08-12-2003 06:46 AM
Accessing LOCAL FTP Server from Internal fails kofi Linux - Security 1 10-29-2002 01:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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