Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It?s possible to Work in transparent Mode ? #115

Open
ST2Labs opened this issue Nov 1, 2017 · 10 comments
Open

It?s possible to Work in transparent Mode ? #115

ST2Labs opened this issue Nov 1, 2017 · 10 comments
Assignees

Comments

@ST2Labs
Copy link

ST2Labs commented Nov 1, 2017

Hi,

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

Thanks

@nickdoikov
Copy link
Collaborator

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.

@ST2Labs
Copy link
Author

ST2Labs commented Nov 1, 2017

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",
  ]

@nickdoikov
Copy link
Collaborator

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

@mrauter
Copy link

mrauter commented Jan 4, 2018

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

@nickdoikov nickdoikov assigned nickdoikov and yyyar and unassigned nickdoikov Jun 25, 2018
@nickdoikov nickdoikov added this to the 0.7.0 milestone Jun 25, 2018
@ST2Labs
Copy link
Author

ST2Labs commented Sep 7, 2018

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

👍

@illarion illarion modified the milestones: 0.7.0, 0.8.0 Nov 17, 2018
@illarion illarion removed this from the 0.8.0 milestone Dec 14, 2018
@z0lt3c
Copy link

z0lt3c commented Mar 7, 2019

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

Is this feature still committed?

@illarion
Copy link
Collaborator

illarion commented Apr 2, 2019

@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.

@daledude
Copy link

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

@sonofwill
Copy link

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.

@LordBurrito
Copy link

hi guys,

any update on this?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants