What i want to do is this....
Set up an ftp server on a windows machine behind the linux box.
I want people to be able to acces this windows ftp server from the internet.
Main Topics
Browse All TopicsThis has been asked recently, but here goes anyway.
I have RedHat 7, 2 nic cards ip eth0 (external)= 24.x.x.x ip eth1 (10.0.0.1). Ip of windows machine running servu ftp 10.0.0.128. on port 666.
How can I forward requests that go to 24.x.x.x to the windows ftp servu server on 10.0.0.128 on port 666 ??
And do I need ftp services running on the linux box ? They are off right now ..but turning them on is no biggie.
Thansk for your time
Jules™
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I did the same thing with my home network, but I used FreeBSD (unix variant) instead of RedHat Linux. Anyway, the concepts are the same. Generally speaking, what you want to do is called IP masquerading. This means that you will only have one IP address visible to the outside world (24.x.x.x), and all machines on the internal network (including the FTP server) will be translated by the linux box. This will make all traffic appear as if it is coming from 24.x.x.x. So actually, there are two distinct steps involved:
1. Make sure that your linux box is masquerading IP addresses properly for regular internet traffic (which it sounds like it is.) In other words, verify that you have internet connectivity on the windows box. For mucho details on this, check out the IP Masq how to:
http://www.europe.redhat.c
2. a. Allow FTP traffic to the windows ftp server in your firewall commands (if you even have a firewall - I can't really tell from your original post)
b. Redirect FTP traffic arriving at 24.x.x.x to 10.0.0.1.
For part 2 a., I started out by simply allowing all tcp traffic to the windows box. This involved a command in my ipfw rules stating:
$fwcmd add allow tcp from any to 10.0.0.1
After you verify connectivity and complete part b., you can come back and tighten this rule to only allow traffic destined for the specific ftp ports (20 and 21).
For part 2 b., I had to put a "redirect_port" command in my NATD rules. I basically am telling the FreeBSD box to forward all ftp traffic to my windows ftp server, so that machines on the internet 'feel like' they are communicating directly with the ftp server.
Again, my case was for FreeBSD, and that's why you see the examples with IPFW and NATD. But the concepts behind Linux will be the same; the software packages are just a little different. The RedHat site is loaded with How-To's and FAQ's on this subject. I bet you can find the specifics there.
Cheers,
-E
I got a little script doing that...
#!/bin/sh
extip="`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"
/usr/sbin/ipmasqadm portfw -f
/usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 21 -R 10.0.0.128 666
/usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 20 -R 10.0.0.128 <ftp-data_port_on_windows>
the only thing is that you must re-run this script if you got a dynamic IP, every time your IP changes... but dhcpcd got a way to do it automagically.
hope this helps...
you need some options in your kernel to allow portfw...
try "man ipmasqadm"...
=) Hope this helps...
I'm confused a little about your question. Let's say in this way.
You have a network. Let's assume you have 2 boxes. Machine A contains Linux, 2 network cards (one for internal LAN-> NIC 1, another for external/ ADSL-> NIC2)... Machine B connects to LAN as Machine A's NIC1 does. You can't ping...
Here is my suggestion.
1. You should assign different segment IPs on NIC1 and NIC2 in machine A, such as 192.168.x.x and 10.1.x.x with netmask 255.255.255.0. Because within same IP segment, 2 NICs could NOT forward data.
2. eg. In machine A, NIC1 is 192.168.1.1, NIC2 is 10.1.1.1 - on your second machine you can assign 192.168.1.2 (all netmask is 255.255.255.0). Trust me, if all network cards are configured well, you can ping between 192.168.x.x with 2 machines.
3. When you configure NIC2 connecting to ADSL, you have to install ADSL PPPoE driver for high speed modem. Most PPPoE setup includes the step to configure firewall/ IPMASQ. You should select and enable IPMASQ.
If this didn't work in your situation, let me know. I can help you. I have a workable network sharing internet connection thru ADSL with 4 computers at home. I believe this will work in your network too.
Have fun in Linux.
The Question has been a least partially answered .. I don't know how simple question gets so misleading ..to recap ---
I have a linux machine at home connected to a cabel modem. I use it as a gateway (MASQ 'ing) .It allows me to conenct another 5 windows machines to the internet with the one IP. With me so far? good. ok now...
the linux machine doesn't have much space
the widows machine does have space.
i want to be able to setup an ftp server on a windows machine BEHIND (obviously) the linux machine (the one box with a real IP address) and I want to be able to connect to the windows machines ftp server fromsomewhere other than my own damn network !! I can ping transfer files hell i can adminsiter the box from anywhere with webmin. This is a Question about PORT FORWARDING. Some of the stuff above is helpful, (Woudl eb more helpful if someone coudl translate the freebsd stuff to linux cmds.
Thanks for your efoorts so far.
Business Accounts
Answer for Membership
by: sevenjPosted on 2001-02-23 at 14:02:31ID: 5872988
Do you need specified port? If I'm not wrong, your question is that you wish to access IP on eth0 from your windows box. To do that, you need to add your eth1's IP in route table on Windows.
Per FTP, check if you have installed FTP rpm.
#rpm -qa | grep ftp
If you don't have, install it from RedHat install cd /RedHat/RPMS. After install, you need to restart inetd daemon.
If you have it installed, check files
/etc/services -> all FTP is not commented.
/etc/inetd.conf -> ftp is not commented. Usually it's not.
Have fun