[Ilugc] Need iptables port forwarding

  • From: knura9@xxxxxxxxx (Arun Khan)
  • Date: Wed Jun 9 21:09:15 2010

On Wed, Jun 9, 2010 at 4:17 PM, vellingiri <vellingiri@xxxxxxxxxxxxxxx> wrote:

? I need port forwarding from one host to another host. Please anyone help
me.

Example:
? client ip : 192.168.6.82
? server1 : 192.168.1.142
? server2: 192.168.1.12

? When I do ssh from 192.168.6.82 to root@192.168.1.142, it has to redirect
to 192.168.1.12. Is it possible? Really I confused a lot while googling. I
am new for networking. any one help me.

I would urge you to get your networking fundae in place if this is
your bread/butter job.   Once your networking fundae are clear, you
will be able to Google search with better precision.   Claiming "new
to networking" may work one or two times only IMO.

Yes what you want to be done is possible with iptables but it will be
for all users, not just root, because iptables works at the IP layer
and not the application layer.  Before you delve into iptables you
need to draw a network diagram and visualize the packet flow.  Then
you need to understand the functionality of the "tables" built into
iptables, then chalk out rules and implement them.

Post your iptables rules, tell us what errors you are encountering.
Perhaps, then list members can help you.

While you are doing it, also invest in O'Reilly's the  "Linux
Networking Cookbook" by Carla Schroder.   At Rs. 500 (minus15%
discount at most book shops) it is a steal, given that it covers
solutions for a lot of networking scenarios.

-- Arun Khan

Other related posts: