How to setup multiple instances of Dante sock5 proxy

2.3k Views Asked by At

I have a Dante proxy server setup on my ubuntu machine, which has 4 NICs, one ethernet (eth0) and three usb modems (usb1,usb2,usb3). All with their own internet connection. I am trying to setup in such way that ,The proxy listens on only the eth0 on different ports, and depending on the port number the client connects on, the appropriate usb modem, will be used as the external gateway, for the client. This is my danted.conf file

logoutput: /var/log/socks.log
internal: eth0 port = 4343
internal: eth0 port = 4344
internal: eth0 port = 4345
internal: eth0 port = 4346

external: usb1
external: usb2
external: usb3
external.rotation: route
user.privileged: root
user.notprivileged: nobody
client pass {
        from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
        log: connect disconnect error
  }
socks pass {  
      from: 0.0.0.0/0 to: 0.0.0.0/0
      log: error connect disconnect 
   }

I see two options to do it, either use the

external.rotation: route 

option to route the traffic, but cant seem to figure out, how to setup the routing table for it

The second option being to setup multiple instances of Dante proxy listening on a specific port each. I tried

 sudo cp /etc/init.d/danted /etc/init.d/danted1
 sudo nano /etc/danted1.conf

and changed the

  daemon=/usr/sbin/danted1
  NAME=danted1
  sudo /etc/init.d/danted1 start

but it still seems to be using the same danted.conf file, for both the instances and cant bind to the given ip address, since both are trying to bind to the same port. I am sure i am missing something very obvious.

Any suggestions are appreciated. Thank you

1

There are 1 best solutions below

0
On

There are two ways I can think of to do this, but "external.rotation: route" is not one of them (this option in effect means Dante will consult the routing table to see what external address it should use for each destination, but this is not what you want, as you want to override the routing table):

  • Option A is what you have tried to do already. Run four instances of Dante, one for each internal:/external: address tuple. This is the simplest and cheapest option, unless the load on your machine is so high that running multiple instances of Dante is a problem, or you prefer to just administer one instance of Dante rather than four. You just need to find out how to make each instance of Dante use it's own sockd.conf on your particular system. The system independent way it to specify a different sockd.conf for each Dante instance by using Dante's "-f" option.

  • Option B is by buying the "redirect module" Inferno Nettverk A/S sells for Dante (see https://www.inet.no/dante/module.html). This would allow you to run one instance of Dante, and use the redirect module to specify that clients accepted by Dante on a given internal address should be "redirected" from a given external address. You could say that e.g. clients accepted on internal port 4343 should be forwarded from external address usb2.