DD-WRT - Host-based forwarding

1

1

I would like to know if I can configure DD-WRT router, that operates as the server's network gateway, so support different forwards based on hostname (other than port 80).

I've configured successfully Varnish and it's used to forward all requests to the backend web servers and also have the following port forwarding logic:

143, 25 (web) -> 143, 25 (192.168.1.10) 80 (web) -> 80 (192.168.1.11) ...

I would like to know if I can configure, as an additional rule, for a single domain, such as: if hostname is "domainX.com" then port 25 should go to another server, otherwise, all port 25 requests will go to the default mail server.

PS: If there's no efficient way, I'll setup a port forwarding and firewall dedicated server.

Thanks!

narcis

Posted 2013-03-02T12:52:50.393

Reputation: 13

Answers

1

Yes you can do this; you'll need the Pound add-on.

WHAT POUND IS:

  1. a reverse-proxy: it passes requests from client browsers to one or more back-end servers.
  2. a load balancer: it will distribute the requests from the client browsers among several back-end servers, while keeping session information.
  3. an SSL wrapper: Pound will decrypt HTTPS requests from client browsers and pass them as plain HTTP to the back-end servers.
  4. an HTTP/HTTPS sanitizer: Pound will verify requests for correctness and accept only well-formed ones.
  5. a fail over-server: should a back-end server fail, Pound will take note of the fact and stop passing requests to it until it recovers.
  6. a request redirector: requests may be distributed among servers according to the requested URL.

From Wikipedia:

Pound is a lightweight open source reverse proxy program suitable to be used as a web server load balancing solution... Using regular expression matching on the requested URLs, Pound can pass different kinds of requests to different backend server groups.

Pound home page.

Ƭᴇcʜιᴇ007

Posted 2013-03-02T12:52:50.393

Reputation: 103 763

Brilliant! Thanks for the tip. I've been using optware with an external USB drive, but never knew that you can setup a reverse proxy on the actual device. – narcis – 2013-03-03T10:46:21.530

When you say Pound add-on, it seems like Pound is an add-on for DD-WRT, but it's not, right? It's just a stand-alone app. I need name-based forwarding to multiple IP/names too, and with DD-WRT, I can't seem to figure out how to do it. – SAFX – 2013-05-16T23:28:01.597