Solved

iptable REDIRECT problem

Posted on 2006-11-28
3
532 Views
Last Modified: 2007-12-19
hi expets;

i have two linux box

i use first computer on office , but second linux box is on the net
i need redirect my office computer (port 1232) to remote server ssh 88.88.88.88:22

i want to use ssh connection command line like `ssh localhost -p 88` to connect remote server sshd

im using this iptables line

iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 1232 -j REDIRECT --to 88.88.88.88:22


[Note: my computer connected via adsl modem on net my gateway 10.0.0.2 ]

but doesnt's work

wherei s wrong

Thanks ..
0
Comment
Question by:nedimk
3 Comments
 
LVL 2

Expert Comment

by:sudev_shetty
Comment Utility
iptables -t nat -A PREROUTING -p tcp -s 0/0 --dport 1232 -j DNAT --to-destination 88.88.88.88:22
iptables -t nat -A OUTPUT -p tcp -s 0/0 --dport 1232 -j DNAT --to-destination 88.88.88.88:22

try this
0
 

Author Comment

by:nedimk
Comment Utility
ok i try this but doesnt work

iptables -t nat -L output ;

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DNAT       tcp  --  anywhere             anywhere            tcp dpt:1232 to:88.88.88.88:22

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
DNAT       tcp  --  anywhere             anywhere            tcp dpt:1232 to:88.88.88.88:22

Thanks ..
0
 
LVL 26

Accepted Solution

by:
jar3817 earned 250 total points
Comment Utility
Just so you know, iptables REDIRECT is for internal redirection, to different ports on the same machine, you can't redirect to a different machine.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now