Solved

iptable REDIRECT problem

Posted on 2006-11-28
3
547 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
ID: 18026951
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
ID: 18027098
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
ID: 18027132
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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