PDA

View Full Version : How to enable telnet or ssh into router from WAN ?



BigOooze
13-12-2004, 12:55
The title says it all. How can I do this ?

Caveat: my ISP only allows ports above 1024.
Is it enough to add an iptables rule, redirecting e.G; port 2323 to the router's internal IP port 23 ?

eg:


iptables -t nat -A PREROUTING -d \$2 -p tcp --dport 2323 -j DNAT --to-destination 100.100.100.1:23

All tips welcome,

BigOoze

erik_bies
13-12-2004, 22:42
Same here.
What I did was to start dropbear ssh on a second port.
Just add to the dropbear line -p 22 -p 2222 or something

This is what I have in my post-boot
/usr/sbin/dropbear -b /mnt/ramfs/local/welcome.msg -p 22 -p 55909
and in post-firewall
iptables -A INPUT -p tcp --syn --dport 2222 -j ACCEPT

If you use firm 1.8xx
the command should be something like
iptables -I INPUT 2 -p tcp --syn --dport 2222 -j ACCEPT
to avoid the last drop