• Advertisement
Sign in to follow this  

Binding on 2 interfaces

This topic is 4169 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a server application which provides data to multiple clients. We have 2 connections from 2 ISP's, both plugged into the machine which runs this server. The setup is like this:
  ISP1 --> ROUTER (192.168.0.5) ---> (192.168.0.1) SERVER MACHINE (DHCP) <--- ISP2 (PPPoE)
Is it possible to have the server listen on both interfaces (both are connected to the internet, one through a local router and one through PPPoE) ? Is there any special code i need to write when creating the listening socket (i'm currently binding to 0.0.0.0)?

Share this post


Link to post
Share on other sites
Advertisement
If you bind to 0.0.0.0, it means you will listen on all available interfaces.

So, yes, you will be listening on both ports. However, note that the IP that you have behind the router is not a public IP, so you have to set up port forwarding for that to actually work. Also, you might want to think a bit about how someone wanting to connect to you gets one of the addresses, versus the other, out of DNS.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement