Jump to content
ChrisChuah

How to use a particular network interface to send out UDP data

Recommended Posts

Hi

On my mac, it seems that i have many network interfaces.

I used Indy GStack.GetLocalAddressList to obtain all these interface name and IP address.

 

Stack Local Address 0: en0: FE80:0:0:0:102B:BAE3:A50E:FEDA
Stack Local Address 1: en0: 192.168.1.10
Stack Local Address 2: en1: FE80:0:0:0:C55:FF1F:977A:4ECD
Stack Local Address 3: en1: 192.168.1.11
Stack Local Address 4: awdl0: FE80:0:0:0:380D:36FF:FE0A:D127
Stack Local Address 5: llw0: FE80:0:0:0:380D:36FF:FE0A:D127
Stack Local Address 6: utun0: FE80:0:0:0:FE2C:6391:70B1:32E5
Stack Local Address 7: utun1: FE80:0:0:0:D512:288C:E8D7:52E1
Stack Local Address 8: utun2: FE80:0:0:0:CE81:B1C:BD2C:69E
Stack Local Address 9: bridge100: 172.16.90.1
Stack Local Address 10: bridge100: FE80:0:0:0:787B:8AFF:FE3C:7864
Stack Local Address 11: bridge101: 192.168.83.1
Stack Local Address 12: bridge101: FE80:0:0:0:787B:8AFF:FE3C:7865
Stack Local Address 13: bridge102: 192.168.84.1
Stack Local Address 14: bridge102: FE80:0:0:0:787B:8AFF:FE3C:7866
Stack Local Address 15: bridge103: 192.168.85.1
Stack Local Address 16: bridge103: FE80:0:0:0:787B:8AFF:FE3C:7867
Stack Local Address 17: bridge104: 172.16.49.1
Stack Local Address 18: bridge104: FE80:0:0:0:787B:8AFF:FE3C:7868

 

If i want to send a broadcast packet onto 192.168.84.255 (Bridge102), How can i specify it in idUDPClient?

Or will idUDPClient able to automatically send it out via that interface?

 

Please advise

 

regards

chris

 

 

 

Share this post


Link to post
2 hours ago, ChrisChuah said:

If i want to send a broadcast packet onto 192.168.84.255 (Bridge102), How can i specify it in idUDPClient?

You can optionally set the TIdUDPClient.BoundIP property to the IP of the desired network adapter.

2 hours ago, ChrisChuah said:

Or will idUDPClient able to automatically send it out via that interface?

If you don't bind the client, the OS will route the packet using the network adapter it thinks is most appropriate, based on its configured routing tables.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×