HOWTO: Select local IP address to bind to

Hi,

there are two network interfaces in machine, and two IP addresses (one for
each interface). How can be local IP addresses listed (like ifconfig
shows) and selected to bind just created TDI connection to? Will such a
binding to IP guarantee that all the packets will be sent using interface
that IP belongs to (no special routing added - just default one)?

Thanks for help!

Anton Kolomyeytsev

Check TdiQueryInformationEx() . You can enumerate all IP addresses byuding
this function.

----- Original Message -----
From: “Anton Kolomyeytsev”
To: “NT Developers Interest List”
Sent: Sunday, September 01, 2002 5:45 PM
Subject: [ntdev] HOWTO: Select local IP address to bind to

> Hi,
>
> there are two network interfaces in machine, and two IP addresses (one for
> each interface). How can be local IP addresses listed (like ifconfig
> shows) and selected to bind just created TDI connection to? Will such a
> binding to IP guarantee that all the packets will be sent using interface
> that IP belongs to (no special routing added - just default one)?
>
> Thanks for help!
>
> Anton Kolomyeytsev
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>

> there are two network interfaces in machine, and two IP addresses
(one for

each interface). How can be local IP addresses listed (like ifconfig
shows) and selected to bind just created TDI connection to?

bind() at TDI level is a creating an address file object. Just specify
the correct TRANSPORT_ADDRESS there which will contain explicit IP
address and not INADDR_ANY.

Will such a
binding to IP guarantee that all the packets will be sent using
interface
that IP belongs to (no special routing added - just default one)?

IIRC yes.

Max