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

Support IP_FREEBIND/IP_BINDANY/SO_BINDANY #66

Open
daurnimator opened this issue May 27, 2015 · 0 comments
Open

Support IP_FREEBIND/IP_BINDANY/SO_BINDANY #66

daurnimator opened this issue May 27, 2015 · 0 comments

Comments

@daurnimator
Copy link
Collaborator

Linux ip(7):

IP_FREEBIND (since Linux 2.4)
If enabled, this boolean option allows binding to an IP
address that is nonlocal or does not (yet) exist. This
permits listening on a socket, without requiring the
underlying network interface or the specified dynamic IP
address to be up at the time that the application is trying to
bind to it.

FreeBSD ip(4):

If the IP_BINDANY option is enabled on a SOCK_STREAM, SOCK_DGRAM or a
SOCK_RAW socket, one can bind(2) to any address, even one not bound to
any available network interface in the system. This functionality (in
conjunction with special firewall rules) can be used for implementing a
transparent proxy. The PRIV_NETINET_BINDANY privilege is needed to set
this option.

OpenBSD setsockopt(2):

SO_BINDANY allows the socket to be bound to addresses which are not local to the machine, so it can be used to make a transparent proxy. Note that this option is limited to the super-user. In order to receive packets for these addresses, SO_BINDANY needs to be combined with matching outgoing pf(4) rules with the divert-reply parameter. For example, with the following rule the socket receives packets for 192.168.0.10 even if it is not a local address:
pass out inet from 192.168.0.10 divert-reply


This issue was not born out of any particular need; I just saw this post: http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/32124 and thought it would be good to have support

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

No branches or pull requests

1 participant