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

[Feature request] IPv6 support. #13

Open
przemyslaw0 opened this issue Jun 16, 2024 · 3 comments
Open

[Feature request] IPv6 support. #13

przemyslaw0 opened this issue Jun 16, 2024 · 3 comments

Comments

@przemyslaw0
Copy link

I would like to use BindToInterface with IPv6

@JsBergbau
Could you please implement this feature?

@przemyslaw0
Copy link
Author

@JsBergbau

I've modified the code for working with IPv6: https://paste.ee/p/L6FNt

export LD_PRELOAD=./bindToInterface.so
export BIND_INTERFACE=eth0
export BIND_SOURCE_IPV4=192.168.1.10
export BIND_SOURCE_IPV6=fe80::1
export DNS_OVERRIDE_IP=8.8.8.8
export DNS_OVERRIDE_PORT=53
export BIND_EXCLUDE=192.168.1.1,fe80::2
w3m -4 ipleak.net
w3m -6 ipleak.net

But there is a problem, perhaps with my system, both the original and my modified bindToInterface.c are not working with DNS when DNS_OVERRIDE_IP is set, the DNS uses the system DNS.

@JsBergbau
Copy link
Owner

Thanks for modifying the code.
Can you try using an IPv6 DNS-Server? I know it should also work with IPv4-DNS-Server, but who knows...

I don't have IPv6 access to assist with debugging, so I can't debug any further :(

@przemyslaw0
Copy link
Author

I tried with $ host g.co

export LD_PRELOAD=./bindToInterface.so
export BIND_INTERFACE=vpngw
export BIND_SOURCE_IPV4=10.96.0.26
export BIND_SOURCE_IPV6=fd54:20a4:d33b:b10c:a70:0:60:1a
export DNS_OVERRIDE_IP=2620:fe::9
export DNS_OVERRIDE_PORT=53
export BIND_EXCLUDE=127.0.0.1,2620:fe::9

screen1

I tested also with DNS IPv4:

export LD_PRELOAD=./bindToInterface.so
export BIND_INTERFACE=vpngw
export BIND_SOURCE_IPV4=10.96.0.26
export BIND_SOURCE_IPV6=fd54:20a4:d33b:b10c:a70:0:60:1a
export DNS_OVERRIDE_IP=1.1.1.1
export DNS_OVERRIDE_PORT=53
export BIND_EXCLUDE=127.0.0.1,1.1.1.1

screen2

I noticed that not all programs use the DNS specified in bindToInterface.so, some examples are w3m and curl.

And I realized that SO_BINDTODEVICE is unstable and sometimes buggy across many kernel versions, even more with IPv6, setting up a policy based routing with a fwmark pointing to a separate table is more suitable.

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

2 participants