Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My linksys wireless router is behind a linux router and I would like to access the linksys router's admin module remotely. How do I configure iptables so I can open the admin module?

iptables -t nat -A PREROUTING -p tcp -i $EXT_IF --dport $PORT -j DNAT --to-destination $IP

Am i missing something? Please help... Thanks in advance!

share|improve this question
2  
I'd highly recommend not exposing your linksys administrative interface to the Internet. If you want to admin remotely tunnel through over SSH (at the very least) or a IPSEC VPN. –  paxos1977 Dec 29 '09 at 6:01
    
@ceretullis - but is it possible? –  jrivera Dec 29 '09 at 6:04
    
Yes, it is possible via port forwarding (PAT) or static NAT... probably you want to search for port forwarding with iptables. –  paxos1977 Dec 29 '09 at 6:20
    
BTW, the linksys wireless router firmware has to be configured to listen on the WAN interface also ;) You can't do that from your iptables config, you need to modify the wireless router config too. –  paxos1977 Dec 29 '09 at 6:22
add comment

1 Answer

I'd suggest that you don't try to access the admin services directly from outside: you'll spend time trying some exotic forwarding to get it right and it likely won't be very secure. For my purposes, I usually ssh into a machine inside the router's network and use lynx from there to connect back into the router's admin services. The character interface is a bit rustic, but it works for me. It probably won't work for admin services that want to do fancy-schmancy javascript-based whizzies.

(added later:) For a little fancier work, you can use ssh -X to get Xwindow traffic forwarded to your desktop - this allows you to start your favorite graphical browser (e.g. Firefox) on the target machine to see the admin screens of the router.

share|improve this answer
1  
I do the same but use ssh tunneling so I can use a graphical browser. You simply tell your ssh client to create a tunnel over the ssh connection, that connects port 1234 on local to linksys:80 on remote (substitute the correct name or ip). Then you point your browser to localhost:1234 and there is your linksys GUI. See ssh.com/support/documentation/online/ssh/adminguide/32/… for more details. I use Putty to do this, so you don't need the CLI client. –  Martijn Heemels Dec 29 '09 at 10:20
    
Yep - that works, too. –  Shannon Nelson Dec 30 '09 at 0:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.