Link to home
Start Free TrialLog in
Avatar of nedimk
nedimk

asked on

iptable REDIRECT problem

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 ..
Avatar of sudev_shetty
sudev_shetty

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
Avatar of nedimk

ASKER

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 ..
ASKER CERTIFIED SOLUTION
Avatar of jar3817
jar3817

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial