3

what can I use as automatic port forwarding on a Linux server ?

I am ONLY interested in something like upnp (so, stations with things like uTorrent can open a port automatically), this days any small router (like 10$ one) have this option and working, but I don't seem to find a solution on linux

I already tried miniupnpd, but unfortunately seems that is not fully configured under Ubuntu, installing and automatic configuration (dpkg-reconfigure minupnpd) don't work - the /etc/miniupnpd/miniupnpd.conf is not only NOT configured, but is ignored at all from the service start, and service refuse to start with errors that /etc/default/miniupnpd have missings

and even after ... hacking some (I edited /etc/init.d/miniupnpd and "guess" the proper syntax and the options for /etc/default/miniupnpd) I manage to start the service and got some rules (from the start) in firewall ... but rules never change when a station try to add something

starting it manual (with direct options or config file) don't do any kind of changes in firewall

that miniupnpd package is to such of undeveloped level that man/info miniupnpd don't cover all switches presented in miniupnpd -h

when I used a small router uTorrent had no problems to open ports via upnp (so, station side is working)

In conclusion (I already wrote a lot, you got the picture), I'm not fixed on miniupnpd but open to any suggestion as long as it would work generically with any kind of upnp applications (not just uTorrent)

Later Edit:

Strange, the only answer I get is for Linux based stations and NOT about uPnP, so, let me underline 2 points

  1. don't care what os station have, don't want to go on every station and implement "personal" programing, out there is something called uPnP which is doing just that ... OFFICIALLY ! (officially means that applications know about it, so, why reinventing wheel and do all by hand)
  2. every single litle (little means something the size of a 5 ports switch and with the cost of about 10-20$) router I put my hands on in the last years have uPnP in it , and what makes this lack of answer REALLY STRANGE is the fact that most of this routers (if not all of them) work on Linux, so WHY THERE IS NO SOLUTION ON A "NORMAL" LINUX SERVER ?
Pablo Bianchi
  • 17,371
user40404
  • 316
  • 1
  • 3
  • 8

1 Answers1

1

You can use ssh for port forwarding. read the ssh man page by executing man ssh in Terminal.

Example:

ssh -f servername -L [bind_address:]port:host:hostport

-L [bind_address:]port:host:hostport

Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and a connection is made to host port hostport from the remote machine. Port forwardings can also be specified in the configuration file. IPv6 addresses can be specified by enclosing the address in square brackets. Only the superuser can forward privileged ports. By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of ``localhost'' indicates that the listening port be bound for local use only, while an empty address or `*' indicates that the port should be available from all interfaces.

Daniel
  • 3,626
  • 3
  • 24
  • 46