Question

Port Forwarding On Linux to Windows

Asked by: julianthompson

This 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2001-02-23 at 07:58:07ID20082660
Tags

ftp

,

server

Topic

Linux Networking

Participating Experts
5
Points
30
Comments
10

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. "Bridge" eth0 to eth1
    The problem is as follows: I have two computers. In the first computer there are two ethernet-cards (A:eth0 and A:eth1). In the second computer ther is one ethernet-card (B:eth0). Interface A:eth1 is connected two a LAN, A:eth0 is connected to B:eth0. Each of these interfaces...
  2. eth0
    Hi folks, I've set up a small network at home with RedHat 7.1 as a dhcp server. The problem is I can't get the eth0 to be recognised by the system at all. I have checked the setup before boot, but found nothing that would help. I have tried around six different nics, and k...
  3. eth0 and eth1 configuration
    ZT7101 (Chassis management module) runs Bluecat embedded Linux. It has 2 interfaces eth0(internal) and eth1(external). It is housed in a chassis (ZT5090). The chassis also contains an Ethernet switch and Single board computers(SBCs) running Win2K. I have configured the switch...
  4. A Hard one.. Linux box directly hooked to WiFi Hotspot o…
    Ok, i've got a hard one for you guys, that's why i'm awarding 500 points. This is my situation, I have a linux box (redhat 9.0) with ETH1 connected directly to a Wifi hotspot, thru that hotspot i want 3 users to connect to the interanet (a exchange server) and all the other...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

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

 

by: julianthompsonPosted on 2001-02-23 at 15:09:40ID: 5873174

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.



 

by: ekestesPosted on 2001-02-23 at 19:45:11ID: 5873555

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.com/documentation/HOWTO/IP-Masquerade-HOWTO.php3

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

 

by: pintooPosted on 2001-02-23 at 21:39:03ID: 5873732

hi,
  ekestes is right on the way u have to proceed.
No u dont need to install ftp server on linux machine.
The work of penguin box here is just to masquerade and
to do forwarding stuff.
ftp server on win machine would suffice.


u can take some idea from the port forwarding question too

best wishes

 

by: garisoainPosted on 2001-02-25 at 00:55:07ID: 5875888

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...

 

by: sevenjPosted on 2001-02-25 at 11:44:18ID: 5876840

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.

 

by: julianthompsonPosted on 2001-02-26 at 05:19:27ID: 5879071

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.

 

by: garisoainPosted on 2001-02-26 at 10:09:13ID: 5880200

Jules, i posted linux commands above... now, you got a cablemodem, so, are you sure your ISP let you put up services? some ISP's firewalls deny incoming connections to their clients in some ports...

 

by: julianthompsonPosted on 2001-02-26 at 12:38:05ID: 5880724

garisoain,

they don't exactly encourage it but the services are not denied or blocked.

Yours is the answer I think I am looking for, i just have to recompile the kernel to be sure.. bare with me I will get back too you

thanks all for the help.

Jules™

 

by: SynginPosted on 2001-09-18 at 07:33:30ID: 6490738

For the record, hunting down ipmasqadm was a royal pain but I finally found it on TuCows of all places.

(For anyone who didn't have it included on their cd)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...