LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-05-2003, 12:10 PM   #1
zovres
Member
 
Registered: Sep 2002
Posts: 184

Rep: Reputation: 30
forwarding a specific port from eth0 to eth1


how can I do such a thing?

I have two network cards on a redhat9 computer and I want to forward ssh requests that comes to eth0 to a computer connected with eth1


PC1----ssh---->eth0,PC2,eth1-----ssh---->PC3


so that I can ssh from PC1 to PC3



thx for any help
 
Old 08-05-2003, 12:47 PM   #2
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
I think iptables can provide this type of redirecting
 
Old 05-02-2006, 10:01 PM   #3
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 36
Hello zovres,

You can do port forwarding using the NAT function in iptables. For this you need the 'iptables_nat' and 'ip_conntrack' modules loaded.

# iptables -t nat -A PREROUTING -d 'IP of eth0' -p tcp --dport 22 -j DNAT --to 'IP of eth1'.

After issuiong this command please restart iptables. I hope this simple redirection would work for you. Please reply if anything comes up.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
x86 board PCM 6892 with dual ethernet port.eth1 doesnt ping if eth0 cable removed rani_162 Linux - Newbie 0 07-23-2005 12:29 PM
port forwarding from eth0 to eth1 ? overproof Linux - Networking 7 05-16-2005 02:48 AM
port forward from eth0 to eth1 ryanzietlow Linux - Networking 8 03-01-2005 10:08 AM
iptables: forwarding SSH connection: eth0 to eth1 hamish Linux - Networking 12 01-14-2005 03:07 PM
IP forwarding from eth0 to eth1 musicman_ace Linux - Networking 5 08-01-2004 04:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration