Skip to content

Allow binding to another (non-default) interface#29

Open
tahajahangir wants to merge 1 commit into
rofl0r:masterfrom
tahajahangir:master
Open

Allow binding to another (non-default) interface#29
tahajahangir wants to merge 1 commit into
rofl0r:masterfrom
tahajahangir:master

Conversation

@tahajahangir

Copy link
Copy Markdown

No description provided.

@rofl0r

rofl0r commented Sep 25, 2020

Copy link
Copy Markdown
Owner

SO_BINDTODEVICE seems to be a linux-specific API. what prevents you from using the ip address of the specified interface with the existing -b option?

@tahajahangir

Copy link
Copy Markdown
Author

The existing -b option only works when the specified IP is on the same interface as the default route interface. When machine have multiple interfaces and the bind-ip is not on the default interface, this options solves the problem.

@soffchen

soffchen commented Jan 24, 2021

Copy link
Copy Markdown

Nice feature, but works only under linux.

@mimi89999

Copy link
Copy Markdown

what prevents you from using the ip address of the specified interface with the existing -b option?

It would be nice to listen on a different interface that the outgoing connections.

@mimi89999

Copy link
Copy Markdown

The problem is that if the IP address set by the -b option is on the default route, the default route will be used and not the specified interface.

@zopieux

zopieux commented Jul 17, 2022

Copy link
Copy Markdown

I've patched this PR against master and it works and does exactly what I needed. Would you consider accepting it, please?

@rofl0r

rofl0r commented Jul 17, 2022

Copy link
Copy Markdown
Owner

i can't merge this PR as-is, because it would break build on solaris, *BSD, and OSX

@zopieux

zopieux commented Jul 17, 2022

Copy link
Copy Markdown

It is a matter of surrounding the Linux-specific code with #if[def] fences?

@rofl0r

rofl0r commented Jul 18, 2022

Copy link
Copy Markdown
Owner

i dont want to litter the code with ugly ifdefs, they need to be in a single spot, if at all

@alexandervlpl

alexandervlpl commented Apr 29, 2024

Copy link
Copy Markdown

For anyone else looking for this functionality. Dante doesn't have it either, their external option lets you "bind" to an interface by name but in practice works the same way using the default route. 😢 But this PR works perfectly, thanks @tahajahangir !

I do appreciate that @rofl0r doesn't want to clutter such a clean minimalist project.

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

Successfully merging this pull request may close these issues.

6 participants