Fedora Linux Support Community & Resources Center
  #1  
Old 15th April 2004, 01:44 PM
faischue Offline
Registered User
 
Join Date: Apr 2004
Posts: 2
Unhappy HowTo redirect Port ?

hi all,
i use fedora with Firebird FW Software.
Firewall is only to secure this Box.
on this Box (only 1 Interface) i would do a port forwarding..

eth0 port:1234 forward to ipadress x.x.x.x port:6222

i would like to use this pc as a gateway to
connect to another Server (FTP-Server)

in Firebird SW i can't do Port forwarding because i have
only 1 Interface eth0.

thanks
Reply With Quote
  #2  
Old 15th April 2004, 10:11 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909
You can try using device aliases. Fire up the Red Hat network configution tool: Main Menu > System Settings > Network. At the Devices tab, click new, Ethernet, and then select the card you currently have. Configure a static ip and you're set. The alias will be eth0:1. Note that you can't use DHCP for either device.

See the help page, Device Aliases for more information.
Reply With Quote
  #3  
Old 16th April 2004, 06:47 AM
ieatlint Offline
Registered User
 
Join Date: Mar 2004
Location: Northern California
Posts: 31
What you're asking can be done with iptables.

Note that your firewall software almost undoubtedly uses iptables as well, and rules you enter may conflict with the firewall's rules.

Also note that most ftp clients these days work using passive mode. This requires the server have a control port open (default 21) and then a series of other ports for data transfers.
In other words, to support passive mode on your server, you'll need to forward a lot more than port 1234. more like 1234 and then an additional ~5 ports per connected client.
If you don't, then the people connecting cannot use passive mode.
Thoroughly confused? ftp's and firewalls are confusing enough, throwing in the port forwarding will just complicate matters.

I suggest reading your ftp servers manual about passive mode (since you'll almost surely want to support it). Then head over to www.tldp.org and get a guide to make your own firewall. Refer to the creating a gateway how-to's for port forwarding. www.netfilter.org can also be of help.

If you don't know a little bit about linux already, you'd best be able to learn fast or it'll be a lost cause.

godspeed...
Reply With Quote
  #4  
Old 16th April 2004, 03:09 PM
faischue Offline
Registered User
 
Join Date: Apr 2004
Posts: 2
hi Jman,
i tried your idea with a alias network device. Booth
interfaces (eth0 & eth0:1) are up and running.
BUT i still don't have the configuration option "Forwarded ports" in the Rules of Firestarter.

hmm..
Reply With Quote
  #5  
Old 16th April 2004, 10:42 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909
Oh, we're using Firestarter. With all this Fire-software (Firefox, formerly Firebird) it is easy to get confused.

Now I see, you need another network card if you are going to do forwarding. I'm guessing it's like a bridge: one is connected to the internet and one is to the LAN.

Or you could get a broadband router with port forwarding.

Moved to Networking.
Reply With Quote
  #6  
Old 25th June 2008, 06:59 AM
piju's Avatar
piju Offline
Registered User
 
Join Date: May 2008
Age: 29
Posts: 2
Quote:
Originally Posted by faischue
hi Jman,
i tried your idea with a alias network device. Booth
interfaces (eth0 & eth0:1) are up and running.
BUT i still don't have the configuration option "Forwarded ports" in the Rules of Firestarter.

hmm..
maybe u need to make a simple script to redirect your wanted ports
and put it on /etc/rc.local
make it auto executed on boot
Reply With Quote
  #7  
Old 25th June 2008, 07:31 AM
savage's Avatar
savage Offline
Registered User
 
Join Date: Jun 2005
Location: Mission Control
Posts: 1,229
As ieatlint said, iptables will do this, but the question is whether Firestarter is advanced enough to get along with it. By doing the following, you may need to manage your firewall from the command line in future, or Firestarter may mess up the port forwarding:
Code:
iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport port -j DNAT --to-destination x.x.x.x:port
Items in blue you will need to amend for what you want, '-p tcp -m tcp' obviously change to '-p udp etc.' if you need udp.

--

Edit: Once you've done this, you need to do 'iptables-save > /etc/sysconfig/iptables', or 'service iptables save', it might be a good idea to backup /etc/sysconfig/iptables before going ahead, that way you can just restore it if it does get too complicated with Firestarter.

Last edited by savage; 25th June 2008 at 07:34 AM.
Reply With Quote
Reply

Tags
howto, port, redirect

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect traffic to a port to an interface/ip pyutor Security and Privacy 1 7th August 2006 03:15 PM
help! redirect tcp port tcp/4000 to tcp/22 using iptables ikkubus Servers & Networking 0 2nd June 2006 07:59 AM
redirect parallel port to usb fedoracorebeast Using Fedora 0 9th August 2005 11:57 PM
redirect parallel port to usb fedoracorebeast Using Fedora 0 9th August 2005 11:56 PM


Current GMT-time: 14:31 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat