FTP behind Linux Firewall

FTP behind Linux Firewall

Post by Tho » Thu, 25 Nov 1999 04:00:00



I am currently using ipchains with RedHat 6.0 to allow machines behind
the firewall to access the internet.  the rc.firewall script that i
used is shown below.  i have an ftp server running on port 21 on the
firewall machine and would also like to have access to the ftp server
on one of the maches behind the firewall.  How can I do this using
ipchains?  is it possible?  

Thanks, JP

#! /bin/sh
# rc.firewall - Initial SIMPLE IP Masquerade test for 2.1.x and 2.2.x
kernels using IPCHAINS
#
# Load all required IP MASQ modules
#
#   NOTE:  Only load the IP MASQ modules you need.  All current IP
MASQ modules
#          are shown below but are commented out from loading.

# Needed to initially load modules
#
/sbin/depmod -a

# Supports the proper masquerading of FTP file transfers using the
PORT method
#
/sbin/modprobe ip_masq_ftp

# Supports the masquerading of RealAudio over UDP.  Without this
module,
#       RealAudio WILL function but in TCP mode.  This can cause a
reduction
#       in sound quality
#
/sbin/modprobe ip_masq_raudio

#CRITICAL:  Enable IP forwarding since it is disabled by default since
#
#           Redhat Users:  you may try changing the options in
/etc/sysconfig/network from:
#
#                       FORWARD_IPV4=false
#                             to
#                       FORWARD_IPV4=true
#
echo "1" > /proc/sys/net/ipv4/ip_forward

# MASQ timeouts
#
#   2 hrs timeout for TCP session timeouts
#  10 sec timeout for traffic after the TCP/IP "FIN" packet is
received
#  160 sec timeout for UDP traffic (Important for MASQ'ed ICQ users)
#
/sbin/ipchains -M -S 7200 10 160

# Enable simple IP forwarding and Masquerading
#
#  NOTE:  The following is an example for an internal LAN address in
the 192.168.0.x
#         network with a 255.255.255.0 or a "24" bit subnet mask.
#
#         Please change this network number and subnet mask to match
your internal LAN setup
#
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 10.1.1.0/24 -j MASQ

 
 
 

FTP behind Linux Firewall

Post by Tho » Thu, 25 Nov 1999 04:00:00


I have currently configured my linux (RedHat 6.0) firewall using the
rc.firewall script below.  Currently, all hosts behind the firewall
have access to the internet.  I have an ftp server running on the
firewall machine (port 21).  I would like to access an ftp server on
one of the machines behind the firewall using ipchains.  If the host I
want ftp access to is 10.1.1.5 port 999, how do i configure ipchains
so that I can access this ftp server from beyond the firewall?

#! /bin/sh
# rc.firewall - Initial SIMPLE IP Masquerade test for 2.1.x and 2.2.x
kernels using IPCHAINS
#
# Load all required IP MASQ modules
#
#   NOTE:  Only load the IP MASQ modules you need.  All current IP
MASQ modules
#          are shown below but are commented out from loading.

# Needed to initially load modules
#
/sbin/depmod -a

# Supports the proper masquerading of FTP file transfers using the
PORT method
#
/sbin/modprobe ip_masq_ftp

#CRITICAL:  Enable IP forwarding since it is disabled by default since
#
#           Redhat Users:  you may try changing the options in
/etc/sysconfig/network from:
#
#                       FORWARD_IPV4=false
#                             to
#                       FORWARD_IPV4=true
#
echo "1" > /proc/sys/net/ipv4/ip_forward

# MASQ timeouts
#
#   2 hrs timeout for TCP session timeouts
#  10 sec timeout for traffic after the TCP/IP "FIN" packet is
received
#  160 sec timeout for UDP traffic (Important for MASQ'ed ICQ users)
#
/sbin/ipchains -M -S 7200 10 160

# Enable simple IP forwarding and Masquerading
#
#  NOTE:  The following is an example for an internal LAN address in
the 192.168.0.x
#         network with a 255.255.255.0 or a "24" bit subnet mask.
#
#         Please change this network number and subnet mask to match
your internal LAN setup
#
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 10.1.1.0/24 -j MASQ

 
 
 

FTP behind Linux Firewall

Post by Josep M » Fri, 10 Dec 1999 04:00:00



> I have currently configured my linux (RedHat 6.0) firewall using the
> rc.firewall script below.  Currently, all hosts behind the firewall
> have access to the internet.  I have an ftp server running on the
> firewall machine (port 21).  I would like to access an ftp server on
> one of the machines behind the firewall using ipchains.  If the host I
> want ftp access to is 10.1.1.5 port 999, how do i configure ipchains
> so that I can access this ftp server from beyond the firewall?

> #! /bin/sh
> # rc.firewall - Initial SIMPLE IP Masquerade test for 2.1.x and 2.2.x
> kernels using IPCHAINS
> #
> # Load all required IP MASQ modules
> #
> #   NOTE:  Only load the IP MASQ modules you need.  All current IP
> MASQ modules
> #          are shown below but are commented out from loading.

> # Needed to initially load modules
> #
> /sbin/depmod -a

> # Supports the proper masquerading of FTP file transfers using the
> PORT method
> #
> /sbin/modprobe ip_masq_ftp

> #CRITICAL:  Enable IP forwarding since it is disabled by default since
> #
> #           Redhat Users:  you may try changing the options in
> /etc/sysconfig/network from:
> #
> #                       FORWARD_IPV4=false
> #                             to
> #                       FORWARD_IPV4=true
> #
> echo "1" > /proc/sys/net/ipv4/ip_forward

> # MASQ timeouts
> #
> #   2 hrs timeout for TCP session timeouts
> #  10 sec timeout for traffic after the TCP/IP "FIN" packet is
> received
> #  160 sec timeout for UDP traffic (Important for MASQ'ed ICQ users)
> #
> /sbin/ipchains -M -S 7200 10 160

> # Enable simple IP forwarding and Masquerading
> #
> #  NOTE:  The following is an example for an internal LAN address in
> the 192.168.0.x
> #         network with a 255.255.255.0 or a "24" bit subnet mask.
> #
> #         Please change this network number and subnet mask to match
> your internal LAN setup
> #
> /sbin/ipchains -P forward DENY
> /sbin/ipchains -A forward -s 10.1.1.0/24 -j MASQ

Do you read http://metalab.unc.edu/LDP/HOWTO/IPCHAINS-HOWTO.html ?
I have a firewall mounted and runs fine following the instructions in this
document.

------------------  Posted via CNET Linux Help  ------------------
                    http://www.searchlinux.com

 
 
 

FTP behind Linux Firewall

Post by John I Wan » Fri, 10 Dec 1999 04:00:00


Hello Thor

Providing a service from behind a ipmasquerade is quite different from
allowing outgoing sessions through the masquerade. Basically, you'll need
some form of proxy. Checkout socks for a set of suitable proxies.
Remember the outside world has no way of directly addressing the
ipaddresses behind the firewall and can only address a port on your
firewall so that port must start a proxy to relay the connection to your
designated server.

Regards,
John


> I am currently using ipchains with RedHat 6.0 to allow machines behind
> the firewall to access the internet.  the rc.firewall script that i
> used is shown below.  i have an ftp server running on port 21 on the
> firewall machine and would also like to have access to the ftp server
> on one of the maches behind the firewall.  How can I do this using
> ipchains?  is it possible?

> Thanks, JP

> #! /bin/sh
> # rc.firewall - Initial SIMPLE IP Masquerade test for 2.1.x and 2.2.x
> kernels using IPCHAINS
> #
> # Load all required IP MASQ modules
> #
> #   NOTE:  Only load the IP MASQ modules you need.  All current IP
> MASQ modules
> #          are shown below but are commented out from loading.

> # Needed to initially load modules
> #
> /sbin/depmod -a

> # Supports the proper masquerading of FTP file transfers using the
> PORT method
> #
> /sbin/modprobe ip_masq_ftp

> # Supports the masquerading of RealAudio over UDP.  Without this
> module,
> #       RealAudio WILL function but in TCP mode.  This can cause a
> reduction
> #       in sound quality
> #
> /sbin/modprobe ip_masq_raudio

> #CRITICAL:  Enable IP forwarding since it is disabled by default since
> #
> #           Redhat Users:  you may try changing the options in
> /etc/sysconfig/network from:
> #
> #                       FORWARD_IPV4=false
> #                             to
> #                       FORWARD_IPV4=true
> #
> echo "1" > /proc/sys/net/ipv4/ip_forward

> # MASQ timeouts
> #
> #   2 hrs timeout for TCP session timeouts
> #  10 sec timeout for traffic after the TCP/IP "FIN" packet is
> received
> #  160 sec timeout for UDP traffic (Important for MASQ'ed ICQ users)
> #
> /sbin/ipchains -M -S 7200 10 160

> # Enable simple IP forwarding and Masquerading
> #
> #  NOTE:  The following is an example for an internal LAN address in
> the 192.168.0.x
> #         network with a 255.255.255.0 or a "24" bit subnet mask.
> #
> #         Please change this network number and subnet mask to match
> your internal LAN setup
> #
> /sbin/ipchains -P forward DENY
> /sbin/ipchains -A forward -s 10.1.1.0/24 -j MASQ

 
 
 

FTP behind Linux Firewall

Post by Scott Simpso » Fri, 10 Dec 1999 04:00:00



> Providing a service from behind a ipmasquerade is quite different from
> allowing outgoing sessions through the masquerade. Basically, you'll need
> some form of proxy. Checkout socks for a set of suitable proxies.

No, you only need to port forward. See http://home.earthlink.net/~simpson3 .
You could use a redirector (a reverse proxy) but this is at the user rather
than kernel level. I like the kernel level better.
 
 
 

FTP behind Linux Firewall

Post by John I Wan » Sun, 12 Dec 1999 04:00:00


Hello Scott

Regardless, something is needed in addition to the base installed kernel and
ipchains, which is the point that I made. Proxies with socks has been the way
to deal with these situations since the late 80's (of course, back then we had
to live with commercial vendor handouts more often than not).

I don't think your comments contradicted mine at all, the distinction was just
the difference between doing it in or out of the kernel. To be frank, the
leading "No" is a little bit uncalled for.

However, I am quite intrigued by your mention of such features having already
been integrated into the kernel albeit not canonized as yet. It is a logical
extention of the ipchains redirect command and one would hope that such
functionality would be integrated into the distribution soon, saves us from
struggling with poor english documentation.

Thanks for the pointer to your web page. Your comments about virus
vulnerability shows an insight that many people seem to miss with computers
however I do have something to add which I'll post in another posting/email.

Regards,
John



> > Providing a service from behind a ipmasquerade is quite different from
> > allowing outgoing sessions through the masquerade. Basically, you'll need
> > some form of proxy. Checkout socks for a set of suitable proxies.

> No, you only need to port forward. See http://home.earthlink.net/~simpson3 .
> You could use a redirector (a reverse proxy) but this is at the user rather
> than kernel level. I like the kernel level better.

 
 
 

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. getty_ps 2.0.7d setup

3. FTP server behind on firewall FTP client behind another

4. ppp_deflate.o taints the kernel?

5. FreeBSD and natd - routing from behind firewall to behind firewall.

6. Arrhhhh....What is this?

7. FTP - Client and FTP server behind firewalls

8. Interpretation of vmmeter-structure in HP-UX

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

10. problem with ftp behind a linux firewall

11. own FTP server behind linux firewall

12. USING LINUX FTP BEHIND A FIREWALL

13. ftp'ing from a linux box behind the firewall