Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a linux box set up to do IP Masquerading using iptables and a pretty simple script I found on the net.
When I try and connect to an ftp host using either a computer behind the IP Masqurading box or the actual box that's doing the masquerading, I can connect and login, but when I try and list a directory it just waits for a long time.
I'm pretty sure this has something to do with the IP Masquerading, but what? And how do I fix it?
Distribution: Whatever I feel like at the time I install.
Posts: 284
Rep:
make sure that both port 21 and 20 are being forwarded correctly. from my understanding port 21 does part of the work in ftp (ie login) and 20 does some of the other.
Originally posted by JHuizingh When I try and connect to an ftp host using either a computer behind the IP Masqurading box or the actual box that's doing the masquerading, I can connect and login, but when I try and list a directory it just waits for a long time.
The fact that it is also a problem when connecting from the box doing the masquerading indicates it's a problem on the other side. The FTP server is behind a firewall and is not configured properly. This means you will have to use PASV (passive) mode.
Passive mode will make sure that any connections made for transfers are initiated by the ftp server and not by your box. Obviously if they are initiated by your box, they bounce off the firewall at the other end and do not reach the FTP server.
Sorry it took me so long to respond to your replies, I haven't had much time to work on the computer in the past week. Well, here is what my iptables script looks like:
modprobe ipt_MASQUERADE
modprobe iptable_filter
modprobe ipt_state
iptables -F
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
iptables -P INPUT DROP
it's pretty much an exact copy of one I found on the net. The modules that I load at the top are the only ones installed, so I'm not using the other ones. What do I have to do to use those too?
Distribution: Whatever I feel like at the time I install.
Posts: 284
Rep:
I am having somewhat of a similar problem. I am using passive mode and I can connect to the server and do anything I want from anywhere, but the router/firewall box itself. I would really like to be able to do this since I would like to be able to backup my scripts and stuff to my main system from the router.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.