own FTP server behind linux firewall

own FTP server behind linux firewall

Post by Twiligh » Tue, 21 Mar 2000 04:00:00



Hello all

I am new to this group and my question maybe already discussed, if so
excuse me.

I've a linux firewall, and a P2 win2000 behind it, ipchains is setup
so both pc's can connect the internet.
How can someone on the internet find the P2 were an FTP server is
running on IP 192.168.0.X
ipmasqadm is already installed / updated
but i cant figure out wich rules must be added to redirect te port 21
calls, and if those rules must come for or after de rules that setup
masquarading

Thx in advance
Greetz Twilight

 
 
 

own FTP server behind linux firewall

Post by Hans Dumbraj » Tue, 21 Mar 2000 04:00:00



> Hello all

> I am new to this group and my question maybe already discussed, if so
> excuse me.

> I've a linux firewall, and a P2 win2000 behind it, ipchains is setup
> so both pc's can connect the internet.
> How can someone on the internet find the P2 were an FTP server is
> running on IP 192.168.0.X
> ipmasqadm is already installed / updated

Use something like this:
/usr/sbin/ipmasqadm portfw -a -P tcp -L <your external ip> 21 -R
192.168.0.X 21
/usr/sbin/ipmasqadm portfw -a -P tcp -L <your external ip> 20 -R
192.168.0.X 20

Port 20 is for ftp-data.. check you /etc/services file to see what ports
ftp uses. I don't really know if ftp uses udp.. I don't
think so, but if it doesn't work try to add these lines:

/usr/sbin/ipmasqadm portfw -a -P udp -L <your external ip> 21 -R
192.168.0.X 21
/usr/sbin/ipmasqadm portfw -a -P udp -L <your external ip> 20 -R
192.168.0.X 20

Of course your firewall needs to accpet connections on port 20 and 21..
If you're getting a dynamic IP address every time you connect to the net
it can be difficult to set the external ip address using
ipmasqadm.. You can use the following command to get your external IP
address:
(This is if ppp0 is your external interface)

ifconfig ppp0 | grep inet | cut -d : -f 2 | cut -d \  -f 1

You can then add something like this to your /etc/ip-up script to
automate the whole thing:
-----------------------------------------------------------
ip=`ifconfig ppp0 | grep inet | cut -d : -f 2 | cut -d \  -f 1`
/usr/sbin/ipmasqadm portfw -a -P tcp -L $ip 21 -R 192.168.0.X 21
/usr/sbin/ipmasqadm portfw -a -P tcp -L $ip 20 -R 192.168.0.X 20
------------------------------------------------------------

Quote:

> but i cant figure out wich rules must be added to redirect te port 21
> calls, and if those rules must come for or after de rules that setup
> masquarading

The rules should be entered after you set the IPMASQ rules I guess..
Actually I don't think it matters at all if they come before or after.

Quote:

> Thx in advance
> Greetz Twilight

--


 
 
 

1. FTP server behind linux firewall communicating w/ FTP behind linux firewall

I have a Windows-based FTP server (G6) behind a linux firewall box
running ipchain and ipmasqadm portfw rules to enable communication
with the out side world. I can connect to this server from the
outside, but PASV doesn't work. I have rules that allow ports above
1023 for the PASV traffic and I also had put the FTP server on a
haigher port other than 21.  I portfw'd the same port through to the
internal Windows machine running the ftp server as well as forwarding
the ftp-data. I have the ip_masq_ftp module loaded. I'm not sure why
PASV doesn't work.

Also, the other thing I'm trying to get working is communicating with
this same FTP server from a client within another linux-firewalled
(also using ipchains and portfw rules) LAN. I can connect, but can't
get any data transfers going, including directory listings, using
either PASV or regular FTP. I'm not sure if I should be forwarding
ftp-data to the internal machine running the ftp client.

What I ultimately want to do is be able to connect from a client
within on linux firewalled LAN to an ftp server inside another linux
firewalled LAN on a non-standard port and using PASV if possible. Any
help would be appreciated.

2. Can BSD use CNet Pro120 ?

3. FTP server behind on firewall FTP client behind another

4. Rocks and Linvocates...

5. FTP - Client and FTP server behind firewalls

6. Good Backup Tools

7. FTP client inside linux firewall communicating with FTP server inside another linux firewall

8. serial communication in redhat

9. IIS-ftp-server behind linux firewall

10. FTP server behind linux firewall

11. Setting up an FTP server from behind an ISP's firewall

12. Accesing FTP server behind firewall

13. FTP Server Behind Firewall