An open API service indexing awesome lists of open source software.

https://github.com/amiel/iptables-tunnel

Iptables tunnel allows you to easily forward local requests to another machine, and is meant to be used in conjunction with HAProxy.
https://github.com/amiel/iptables-tunnel

Last synced: 12 months ago
JSON representation

Iptables tunnel allows you to easily forward local requests to another machine, and is meant to be used in conjunction with HAProxy.

Awesome Lists containing this project

README

          

h2. iptables Tunnel

Iptables tunnel allows you to easily forward local requests to another machine, and is meant to be used in conjunction with HAProxy.

h3. Example

Assuming a HAProxy configuration with this in the listen section (10.0.1.3 is the local host):

server webA 10.0.1.3:5000 check port 5500 inter 2s

server webB 10.0.1.3:5001 check port 5501 inter 2s

Then a call like this will hook HAProxy (using ports 5001 and 5501) up to that host:

iptables_tunnel.sh add 1 10.0.1.5:3000

NOTE: the reason for the seperate ports is to allow connections to continue to use a server until HAProxy sees that it is unavailable. (see discussion here: http://www.igvita.com/2008/12/02/zero-downtime-restarts-with-haproxy/)

h3. WHY?

The need for iptables_tunnel came from the need to dynamically add and remove to/from the list of servers that HAProxy can load balance with (originally for use with amazon ec2).

h3. Issues

The method iptables Tunnel is using to send requests to another host doesn't seem to work if the originating request is coming to localhost,
so instead of making a request to localhost, HAProxy must use a local ip. If anyone has an answer to this please let me know.