Starting up MasterServer and NatPunch on DigitalOcean droplet - BeardedManStudios/ForgeNetworkingRemastered GitHub Wiki
If you know another way of doing it, share below.
Legend : M - master server NHT/NP - Nat hole punch DO - digital ocean
Way 1: Manually starting up
It is assumed you have a DO account, you made yourself an Ubuntu droplet, and know how to use Putty and FTP to drop files.
- get mono
sudo apt-get install mono-complete
- Create directories for M and NHT in /var/
- Use FTP and copy the contents of each of them from the repository MasterServer/bin/, same for NHT
- Navigate to masterserver dir
- type
screen
to initiate new screen - type
mono MasterServer.exe
press enter enter, whatever
- press CTR+A, then C it will create a new "window" in the terminal
you can switch between windows by using CTR+A, P (previous), CTR+A, N (next)
- in the new window navigate to NHT directory and launch it same way
Done, both should be working. I'm no expert, but there are certainly ways to do all of this automatically with scripts so if anyone knows how to, append it below.
Troubleshooting
MY PORT IS CLOSED! If your droplet comes with some sort of a server it can block/filter the ports used by master sever. So in that case first check the ports if they are opened:
Download and install Nmap https://nmap.org/download.html
When installing careful not to install additional crap (like Ncap), you wont need it for now.
now open CMD and navigate to Nmap folder, like:
cd C:\Program Files (x86)\Nmap
Then you can use nmap ping command on your ports:
For master server
nmap -p 15940 yourdropletip
For NHP
nmap -p 15941 -sU -P0 YOURIP
If your ports are blocked you will see this:
It will be filtered or blocked, otherwise open
** The NHP .exe port will not be shown as open by online port checkers, they all check for TCP listening processes on the port, while the NHP is UDP, thus for them its "closed" **
Master server port is 15940
, NHP is 15941
So first let the both ports through firewall:
sudo ufw allow 15940/tcp
sudo ufw allow 15941/tcp
Add them to IPTable
sudo iptables -I INPUT 1 -p udp --dport 15940 -j ACCEPT
sudo iptables -I INPUT 1 -p udp --dport 15941 -j ACCEPT
And refresh tables
iptables -L -n
See below linux commands
Commands
netstat -plunt
shows all active listening processes on ports
ufw status
shows all ports rules
ps -ef |grep mono
shows all mono processes