LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-17-2008, 07:20 AM   #1
ajayan
Member
 
Registered: Dec 2007
Posts: 89

Rep: Reputation: 16
SSH Redirection in Intranet


Dear All i am new to iptables.i have a network starting from (192.168.0.1-192.168.0.10).Now i want to redirect ssh requests from all local machines to 192.168.0.6, to machine 192.168.0.7.ie
when i execute command (ssh 192.168.0.6) will lead me to 192.168.0.7.pls give me a reply
 
Old 09-18-2008, 02:05 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
On 192.168.0.6 you need these rules

Code:
iptables -t nat -I PREROUTING -p tcp --dport 22 -d 192.168.0.6 -j DNAT --to-destination 192.168.0.7
iptables -t nat -I POSTROUTING -p tcp --dport 22 -d 192.168.0.7 -j SNAT --to-source 192.168.0.6
 
Old 09-18-2008, 05:35 AM   #3
ajayan
Member
 
Registered: Dec 2007
Posts: 89

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by datopdog View Post
On 192.168.0.6 you need these rules

Code:
iptables -t nat -I PREROUTING -p tcp --dport 22 -d 192.168.0.6 -j DNAT --to-destination 192.168.0.7
iptables -t nat -I POSTROUTING -p tcp --dport 22 -d 192.168.0.7 -j SNAT --to-source 192.168.0.6
Ok very very thanks.That's Working !!!!!!!!!!!!!!!.That helped me lot
 
  


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
SSH Redirection manuelafl Linux - Newbie 1 02-28-2008 01:28 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM
Intranet traffic restriction/redirection pircio Linux - Networking 2 02-17-2005 09:24 AM
Internet working, but intranet is not? (telnet/ssh issues) R00ts Linux - Software 2 02-11-2005 05:11 PM
What makes an intranet an intranet? pembo13 Linux - Networking 3 06-21-2004 08:20 PM

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

All times are GMT -5. The time now is 04:10 AM.

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