0

I'm trying to setup a dedicated server for Rust (a game) on an AWS EC2 VPC instance running Ubuntu 14.04 64-bit. Following the instructions, I got the application started and listening on its default ports (UDP 28105, TCP 28106.)

netstat -tulpn shows:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address  State PID/Program name
tcp  0   0   0.0.0.0:28016    0.0.0.0:*  LISTEN   7370/RustDedicated
udp  0   0   0.0.0.0:28015    0.0.0.0:*           7370/RustDedicated    
udp  0   0   0.0.0.0:4209     0.0.0.0:*           7370/RustDedicated

That seems to look okay, but trying to connect to it with the game client and remote console (RCON) yielded a connection refused. I suspected it might be a typical firewall/security group issue, so just for testing purposes, I exposed instance's security group to all ports. Still no dice.

Instead, I decided to see if I could at least connect to it locally, from an SSH session on the same box the application is running.

I ran telnet 127.0.0.1 28106 which yielded:

Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

How can my application be listening on this port, but still refuse connections from its loopback address? As you can see, it's bound to 0.0.0.0.

How can configure this so it won't throw "Connection refused"?

EDIT

sudo iptables -L shows:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Then I updated it with settings that should allow connections through:

Chain INPUT (policy ACCEPT)
target     prot opt source    destination         
ACCEPT     tcp  --  anywhere    anywhere   tcp dpt:28016 flags:FIN,SYN,RST,ACK/SYN
ACCEPT     udp  --  anywhere   anywhere   udp dpt:28015
ACCEPT     tcp  --  anywhere   anywhere    tcp dpt:28015 flags:FIN,SYN,RST,ACK/SYN

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
  • 1
    in your telnet command i see typo with the port(28106 vs 28016) , are you sure you are trying telnet to the right port ? – calvix Apr 25 '16 at 8:27
  • Oh god, I see that typo now... I kind of hope that's the issue, but also not the issue. :( I'll check. – David Elner Apr 25 '16 at 17:10
1

In your netstat you are showing ports 28016 TCP instead of 28106, and UDP 28015 instead of 28105.

Also in your telnet you are not trying to connect to the open port (28016 TCP) but to the port that you think it is open (28106 TCP).

| improve this answer | |
  • I'm so embarrassed.... – David Elner Apr 25 '16 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.