Solved

iptable REDIRECT problem

Posted on 2006-11-28
3
539 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

911 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

20 Experts available now in Live!

Get 1:1 Help Now