Tuesday, 25 September 2012

Any port in a storm...


Since I've been messing around with my Raspberry Pi, I've had cause to become more well acquainted with Port Forwarding, as a method of exposing it to computers outside my local network.

In my experience, routers only let you forward packets on to the same port on another machine; that is, if a packet comes in to port 22 on the router, it can only be forwarded to port 22 on the end machine.

I was wondering if any more-techy readers know some reason for this limitation? Being able to forward to different ports could be useful, since, unless you reconfigure your servers, this limits you to only using ssh, ftp, or any similar service, on a single machine within a LAN.

I suppose this might be in defence against some form of attack which relies on packets being directed to ports that would not be expecting them - but it seems to me that if an attacker has penetrated your system to the point of being able to alter router settings, you have far worse (and less circuitous) things to worry about than this!

Since I'm very much self-taught in such things, it could be that I'm going about this in completely the wrong - it may be perfectly possible to forward to arbitrary ports, or it may be bad practice (for some reason) to host such services on more than one machine on the network. It may also be that the "port" property of a packet is more intrinsic than simply a value in a header, and changing it is non-trivial.  If anyone has any light to cast on this, I'd appreciate your comments!

And, on a related note - I really can't recommend the Raspberry Pi highly enough. Once you've got Wifi up-and-running (a very good guide for which is here), it's just the perfect nerdy toy. Do yourself a favour and splash out - it's a fully functional computer for (if you count power cable) less than £40 - you can't do much better than that!

No comments:

Post a Comment