Unity Master Server hosted on VPS

Following this guide I setup a remote master server.
I connected to the vps through an ssh connection and downloaded, unzipped and built both the master server and the facilitator.

Using the ps aux command I can see both the facilitator and master server processes running on the vps.
When running the master server using ./MasterServer I see the following output:

IP address: 127.0.0.1
IP address: 172......
02-04-2014 01:27:40	LOG	Unity master server version 2.0.1f1
02-04-2014 01:27:40	LOG	Master server port set to 23466
02-04-2014 01:27:40	LOG	1000 connection count limit
02-04-2014 01:27:40	LOG	To quit press Ctrl-C
----------------------------------------------------

So far, so good. The ip starting with 172. is the private ip of the vps - as the guide instructs I assigned an additional public ip address to the vps which starts with 54 from within the amazon control panel thing.

So here’s the actual problem; When changing the code in the Awake function of my project to:

MasterServer.ipAddress = "172.etc.etc.etc";
MasterServer.port = 23466;

The master server isn’t found and the following generic error is thrown:

Failed to connect to master server at [ip adress].

I’ve tried using the public ip address instead of the one starting with 172 but to no avail.

127.0.0.1 won’t work of course since the server isn’t local.

I’ve also tried adding the code to change the facilitator ip address as well but since I read that unity will default to the regular facilitator if none is specified I thought only specifying the new master server might make fewer things that can go wrong.

So what I am trying to figure out is why my game can’t find the master server - here are also the security settings for the ports etc:
http://www.theorangeday.com/wp-content/uploads/2013/12/amazon_03.png

Does the master server ip address that I reference in the Awake function have to be a public ip address or is the ip address output in the console (private ip) fine?

Maybe some of the more experienced gurus might know what is going wrong?

OK, I finally figured out why it wasn’t working. So for anyone else who is trying to setup the unity master server on a Redhat Enterprise Linux Instance, which is run on a free Amazon AWS account - here is a quick summary:

After connecting to the vps over a ssh connection and installing the master server I made sure that the security settings on the account page had all ports open and that the vps could be connected to.

Btw, You can run the master server from the terminal like this:

./MasterServer -p 23466 &

or to additionally output to log file

./MasterServer -p 23466 > MasterServer.log &

The & sign at the end allows you to type more commands after, for example if you also want to start the facilitator you won’t have to close the masterserver process.

So after doing all that and having both the facilitator and master server running on the vps I still couldn’t connect to either from within my unity project.
This is because the red hat instance has an additional firewall that needs to be disabled/configured.

To do this you can run the following command in the terminal (on the vps of course):

sudo system-config-firewall-tui

I simply disabled the firewall completely for now… Now when running the command:

sudo iptables --line-numbers -n -L

you should get roughly the following output:

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

This means the firewall is completely disabled (probably shouldn’t leave it like that btw ;))
Another thing to note is that you need to use the PUBLIC ip address that was assigned to the instance when trying to connect to the master server within your project - in my case this was the ip address starting with 54.

Here’s more info on changing the iptables: http://www.cyberciti.biz/faq/rhel-fedorta-linux-iptables-firewall-configuration-tutorial/

This just as a heads-up for anyone who ends up with the same problem. Now both the Master Server and Facilitator are found in game.