Networking Forums

Networking Forums > Computer Networking > Linux Networking > cannot ftp client accessing linux router

Reply
Thread Tools Display Modes

cannot ftp client accessing linux router

 
 
Norbert Liew
Guest
Posts: n/a

 
      10-04-2003, 10:20 AM
Most likely this has been asked many times but I am just getting more
confuse after reading so many other threads. The problem is how to enable
my windows client to ftp via a linux box running iptables as ip_masquerade.
The ftp error from my windows client as,

Host type (2): UNIX (standard)
PORT 192,168,0,2,13,241
200 PORT command successful
LIST
425 Unable to build data connection: Network is unreachable
DoDirList returned 0

My iptables script is so simple in rc.local (slackware). I do not have any
other rules set, a very plain gateway that's all.

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

My ip for windows box is 192.168.0.2 and the linux box is 198.168.0.1.

I can browse the net but not ftp. Appreciate som help what to add to the
existing rules.

Thanks.

Regards,
Bert.




 
Reply With Quote
 
 
 
 
Horst Knobloch
Guest
Posts: n/a

 
      10-04-2003, 01:19 PM
Norbert Liew <(E-Mail Removed)> wrote:

> [...] The problem is how to
> enable my windows client to ftp via a linux box running iptables as
> ip_masquerade. The ftp error from my windows client as,
>
> Host type (2): UNIX (standard)
> PORT 192,168,0,2,13,241
> 200 PORT command successful
> LIST
> 425 Unable to build data connection: Network is unreachable
> DoDirList returned 0
>
> My iptables script is so simple in rc.local (slackware). I do not have
> any other rules set, a very plain gateway that's all.
>
> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
> echo 1 > /proc/sys/net/ipv4/ip_forward


Try the following instead:

modprobe ip_nat_ftp
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o <EXT_IF> \
-j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

The modprobe line should make it work. The "-o <EXT_IF>"
addition, where <EXT_IF> is the external interface name, is
only an enhancement.

Instead, you could also try to force your ftp client to use
passive ftp mode. Some related information about this:
http://slacksite.com/other/ftp.html


HTH

Ciao, Horst
--
»When pings go wrong (It hurts me too)« E.Clapton/E.James/P.Tscharn
 
Reply With Quote
 
Norbert Liew
Guest
Posts: n/a

 
      10-04-2003, 02:02 PM
Oki doki, the modprobe ip_nat_ftp did the trick. Thanks a lot man !

Regards,
Bert.


 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Router cannot get hostname of Linux client PC Daniel =?ISO-8859-1?Q?B=F6hmer?= Linux Networking 3 03-07-2006 08:55 AM
Trouble Installing Linux/Cisco VPN Client Has anyone had trouble compiling the linux cisco vpn client? Here is the output of the install script: # uname -rviosm Linux 2.4.22-1.2188.nptl #1 Wed Apr 21 20:19:18 EDT 2004 x86_64 x86_64 GNU/Linux JSH Linux Networking 4 07-02-2004 12:48 PM
VPN client behind Debian Linux router kaczmar2 Linux Networking 1 06-12-2004 09:04 AM
Accessing second level network via linksys router and linux box Dave Linux Networking 1 09-14-2003 02:31 AM
Linux Router/Firewall - Linux Client problem Fry Linux Networking 6 09-06-2003 02:25 AM



1 2 3 4 5 6 7 8 9 10 11