Skip to content

Assign source IP Address #35

Open
Open

Description

@gt5700

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));

Activity

  1. MichaConrad commented on Oct 22, 2018

    @MichaConrad
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions