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

Assign source IP Address #35

Open
gt5700 opened this issue Oct 22, 2018 · 1 comment
Open

Assign source IP Address #35

gt5700 opened this issue Oct 22, 2018 · 1 comment

Comments

@gt5700
Copy link

gt5700 commented Oct 22, 2018

I have a multihomed (multi-interface) server, and I need to ensure DNS requests are sourced from a specific IP Address on the server. The default for Udp/TcpClient is to source from the address "closest" from a routing point of view to the destination address. I need it to be sourced from a fixed IP Address regardless of which interface the request "leaves" the server on.

If this helps, for other code, I've used the UdpClient/TcpClient constructors that take an IPEndpoint allowing you to specify the local address the client binds to.

eg/
var udpClient = new UdpClient(new IPEndPoint(srcIPAddress,0));

@MichaCo
Copy link
Owner

MichaCo commented Oct 22, 2018

Yeah we could add that as an additional configuration. Sounds reasonable.

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

2 participants