gobetween icon indicating copy to clipboard operation
gobetween copied to clipboard

It?s possible to Work in transparent Mode ?

Open ST2Labs opened this issue 7 years ago • 10 comments

Hi,

I want to know how to configure gobetween in transparent mode.

Thanks

ST2Labs avatar Nov 01 '17 15:11 ST2Labs

Hi @ST2Labs please clarify you question.

Gobetween for now can`t be a transparent proxy and forward some port to a selected backends pool. You are welcome to clarify your needs and next we will discuss possibility to add it.

nickdoikov avatar Nov 01 '17 16:11 nickdoikov

Hi,

I would like to deploy gobetween in transparent proxy and forward for UDP stream.

My needs is:

UDP Stream [src_ip] ----> [gobetween]  -----> backend_server_[1...N] ----> [ BBDD ]
                                                           

GoBetween Version

Using gobetween v0.50 from binary x64


Problems

  1. We need to know Original IP Source from UDP Stream

Description: I ran gobetween and backend_server have Source_IP = IP_Gobetween Host, and I have a bunch error, see following Error logs.


Error Logs

2017-11-01 19:28:32 [ERROR] (udp/Session): Error reading from backend read udp gobetween:35470->backed_server_1:40000: recvfrom: connection refused
2017-11-01 19:28:32 [ERROR] (udp/Session): Error reading from backend read udp gobetween:46052-> backed_server_1:40000: recvfrom: connection refused
2017-11-01 19:28:32 [ERROR] (udp/server): Error sending data to backend write udp gobetween:37415->backed_server_2:40000: write: connection refused
2017-11-01 19:28:33 [ERROR] (udp/Session): Error reading from backend read udp gobetween:37415->backed_server_2:40000: recvfrom: connection refused
2017-11-01 19:28:33 [ERROR] (udp/Session): Error reading from backend read udp gobetween:40224->backed_server_1:40000: recvfrom: connection refused


Settings

[logging]
level = "error"   # "debug" | "info" | "warn" | "error"
output = "stdout" # "stdout" | "stderr" | "/path/to/gobetween.log"

[defaults]
max_connections = 0              # Maximum simultaneous connections to the server
client_idle_timeout = "0"        # Client inactivity duration before forced connection drop
backend_idle_timeout = "0"       # Backend inactivity duration before forced connection drop
backend_connection_timeout = "0" # Backend connection timeout (ignored in udp)

[servers]

[servers.sample]
bind = "0.0.0.0:40000"
protocol = "udp"
balance = "roundrobin"
udp_responses = 0


  [servers.sample.udp]
  max_responses = 0
  max_requests  = 0

  [servers.sample.discovery]
  kind = "static"
  static_list = [
      "backed_server_1:40000",
      "backed_server_1:40000",
  ]

ST2Labs avatar Nov 01 '17 18:11 ST2Labs

For now gobetween can`t overlap source packet ip with original ip.

nickdoikov avatar Nov 09 '17 05:11 nickdoikov

I have the same need. Is there a chance this feature will be added?

mrauter avatar Jan 04 '18 21:01 mrauter

Great notice ! Next release (0.7) could include transparent mode ! Great work !!

👍

ST2Labs avatar Sep 07 '18 11:09 ST2Labs

I also need gobetween to preserve the original source address of UDP packets forwarded.

Is this feature still committed?

z0lt3c avatar Mar 07 '19 22:03 z0lt3c

@z0lt3c Unfortunately in go standard library it's impossible to construct udp packets with specific source ip without prior binding to it, and binding to ip that is not on the host is not allowed. The only option left is to manually create udp packets, using gopacket for example.

illarion avatar Apr 02 '19 11:04 illarion

For linux maybe use sysctl variable ip_nonlocal_bind. Or ebpf packet processor.

daledude avatar May 12 '19 23:05 daledude

Has there been any further work on preserving the original source address and port?

This feature is possible with Nginx. I understand, of course, you're using a different programming language.

sonofwill avatar Aug 13 '19 08:08 sonofwill

hi guys,

any update on this?

it would be very helpful to track the original UDP IP address.

LordBurrito avatar Jun 24 '20 09:06 LordBurrito