Behind-a-router help
Posted: 28 Feb 2006, 07:37
Hello,
since the most asked question is "how do I connect when I am behind a router" here's a quick guide to solve the most common issues for this type of configuration.
The typical scenario is this: a local network with any numbers of computers and a router (usually with IP -> 192.168.0.1 or similar). All PCs share the same internet connection through the router.
In this case you will need a few extra steps to make your multiplayer games and applications reachable from outside. This is not due to SmartFoxServer and the following instructions are valid for any other server applications.
1- Install SmartFoxServer (Lite/Basic/PRO) on one of the machines inside the LAN
2- Set the IP address of the server in the config.xml to the LAN IP of the machine (ex. 192.168.0.16)
3- Now it's time to configure your router. Outside of your LAN nobody knows the addresses of your computers in the network as they use local addresses. In other words, from outside, the only available "entry point" is your router which is assigned an IP address.
You should configure the NAT service (Network Address Translator) of your router so that all requests on port 9339 (SFS default port) are redirected the computer running SmartFoxServer (in our example the IP is 192.168.0.16)
4- Finally you should point your SWF to the public web address of your router. If you're unsure about what this IP address is, you can use this website --> http://www.whatismyip.com/
5- Don't forget the crossdomain policy file: make sure you turn on the <AutoSendPolicyFile> function of the server (Basic/PRO only)
You can learn more about it here --> http://www.smartfoxserver.com/docs/docP ... basics.htm
If you need more help about NAT and port forwarding, check this website: http://www.portforward.com/
since the most asked question is "how do I connect when I am behind a router" here's a quick guide to solve the most common issues for this type of configuration.
The typical scenario is this: a local network with any numbers of computers and a router (usually with IP -> 192.168.0.1 or similar). All PCs share the same internet connection through the router.
In this case you will need a few extra steps to make your multiplayer games and applications reachable from outside. This is not due to SmartFoxServer and the following instructions are valid for any other server applications.
1- Install SmartFoxServer (Lite/Basic/PRO) on one of the machines inside the LAN
2- Set the IP address of the server in the config.xml to the LAN IP of the machine (ex. 192.168.0.16)
3- Now it's time to configure your router. Outside of your LAN nobody knows the addresses of your computers in the network as they use local addresses. In other words, from outside, the only available "entry point" is your router which is assigned an IP address.
You should configure the NAT service (Network Address Translator) of your router so that all requests on port 9339 (SFS default port) are redirected the computer running SmartFoxServer (in our example the IP is 192.168.0.16)
4- Finally you should point your SWF to the public web address of your router. If you're unsure about what this IP address is, you can use this website --> http://www.whatismyip.com/
5- Don't forget the crossdomain policy file: make sure you turn on the <AutoSendPolicyFile> function of the server (Basic/PRO only)
You can learn more about it here --> http://www.smartfoxserver.com/docs/docP ... basics.htm
If you need more help about NAT and port forwarding, check this website: http://www.portforward.com/