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)?
Binding on 2 interfaces
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:
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.
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.
enum Bool { True, False, FileNotFound };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement