Multiple Users in Same Physical Location

Post Reply
webmanoffesto
Member
Posts: 35
Joined: Thu Nov 30, 2017 14:30

Multiple Users in Same Physical Location

by webmanoffesto » Post

I have Minetest 0.4.13 running on my Linux (Ubuntu 16.04 Gnome) laptop. How can I let other people on the same WiFi network join my world. (That would be two other laptops in my house and on the same WiFi network, they have Minetest installed.) I found the Server directions but that seems like opening a dedicated server to the world.
https://wiki.minetest.net/Setting_up_a_server

The directions there say
"Type in YOUR/MINETEST/DIRECTORY/bin/minetestserver or just drop the minetestserver executable (located in /Minetest/bin/) into the terminal"
I have "/home/tom/.minetest"
but I don't have a "bin" folder. Would that be at root, I don't see it there?

Jordach
Member
Posts: 4530
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

Re: Multiple Users in Same Physical Location

by Jordach » Post

webmanoffesto wrote:I have Minetest 0.4.13 running on my Linux (Ubuntu 16.04 Gnome) laptop. How can I let other people on the same WiFi network join my world. (That would be two other laptops in my house and on the same WiFi network, they have Minetest installed.) I found the Server directions but that seems like opening a dedicated server to the world.
https://wiki.minetest.net/Setting_up_a_server

The directions there say
"Type in YOUR/MINETEST/DIRECTORY/bin/minetestserver or just drop the minetestserver executable (located in /Minetest/bin/) into the terminal"
I have "/home/tom/.minetest"
but I don't have a "bin" folder. Would that be at root, I don't see it there?
You have to port forward for it to be accessible globally.

Local connections rely on finding your DHCP or static address provided by your AP for the server laptop, as the clients need it for connecting to the LAN server.

webmanoffesto
Member
Posts: 35
Joined: Thu Nov 30, 2017 14:30

Re: Multiple Users in Same Physical Location

by webmanoffesto » Post

Okay, but how do I do that?
Apparently it is safe for me to set up a "server" and I can be confident that I am not "open to the world" because I have not yet done the port forwarding.

So I run Minetest
I guess I check "Host Server"
and check "Announce Server"

What's the point of the Name and Password, would another person on my WiFi network need that to get into my game/world?

From another computer on my WiFi network I tried various IP addresses I find using "ifconfig" but none of them worked. How can I find the right IP address?
The Wiki only says
Linux: open a terminal and type ifconfig and hit enter. Look for "inet adr" near "wlan0" or "eth0".
"ifconfig" gives me details on
"wlp3s0", "tun0", "lo", and "enp2s0"

Minetest 0.5.0
Ubuntu 16.04 LTS Gnome

turducken
Member
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: Multiple Users in Same Physical Location

by turducken » Post

If you just want to play with others in your house as a lan party with friends/family at the same time, click "local game" and check "host server." Uncheck "announce server" as you don't want it to be visible to all minetest users in the world (and they couldn't connect anyway through your router/modem. Type in a name for yourself, and note the server port (default of 30000.)

Now on the other laptops they need to go under the "play online." Type in the IP address of your hosting laptop given under ifconfig as "wlp3s0" for wireless or "enp2s0" for ethernet (physical network cable.) Port will be the number you needed to note down before (probably 30000.) Those other players will need to pick a name, then click connect.

In short
Hosting Laptop - Local Game -> Host server, uncheck announce, choose player name, note port number, click host game. Find IP address of hosting laptop.

Connecting client laptop - Play online -> Type in hosting laptop IP address and port, choose name, click connect.

I'm unsure if Ubuntu ships with a firewall enabled by default, if so we can override that easily.

If you want to run the world constantly for everyone to join at will, you would either need to leave minetest running with you in it, or setup minetestserver to run in the background. If it is just playing with friends all at once the above way is easier.

webmanoffesto
Member
Posts: 35
Joined: Thu Nov 30, 2017 14:30

Re: Multiple Users in Same Physical Location

by webmanoffesto » Post

turducken wrote:In short
Hosting Laptop - "Start Game" -> Check "Host Server", Uncheck "Announce", Enter "Player Name" and "Password", Note "Port Number" (default 30000), Click "Host Game". Find IP address of hosting laptop.

Connecting client laptop - Play online -> Type in hosting laptop IP address and port, choose name, click connect.

I'm unsure if Ubuntu ships with a firewall enabled by default, if so we can override that easily.
That all makes sense.

I tried running
$ ufw allow 30000
on the hosting computer before restarting Minetest but the other laptop still couldn't connect.
I ran that command on the "player" (not host) computer and it still couldn't connect.
The "player" computer says "An error occurred: Connection timed out."

turducken
Member
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: Multiple Users in Same Physical Location

by turducken » Post

webmanoffesto wrote:
turducken wrote:In short
Hosting Laptop - "Start Game" -> Check "Host Server", Uncheck "Announce", Enter "Player Name" and "Password", Note "Port Number" (default 30000), Click "Host Game". Find IP address of hosting laptop.

Connecting client laptop - Play online -> Type in hosting laptop IP address and port, choose name, click connect.

I'm unsure if Ubuntu ships with a firewall enabled by default, if so we can override that easily.
That all makes sense.

I tried running
$ ufw allow 30000
on the hosting computer before restarting Minetest but the other laptop still couldn't connect.
I ran that command on the "player" (not host) computer and it still couldn't connect.
The "player" computer says "An error occurred: Connection timed out."
I'm not familiar with Ubuntu commands right now, but run the hosting computer, host a game (eg start the server), then switch to a terminal.

Try running as root (sudo su or just use sudo)

Code: Select all

[root@t550 bin]# netstat -ap | grep 30000
udp        0      0 0.0.0.0:30000           0.0.0.0:*                           19535/minetest 
As above you see minetest is listening on all interfaces (0.0.0.0) on port 30000 and it is using UDP not TCP.

Next we check my firewall, which in Fedora uses the newer command firewall-cmd. UFW may do a similar job on Ubuntu.

Code: Select all

[root@t550 bin]# iptables -L -n | grep 30000
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:30000 ctstate NEW
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:30000 ctstate NEW
We see above that firewall-cmd has setup iptables to allow port 30000 to connect on both UDP and TCP (because it was unclear what to allow when setting up minetest the first time --- you only need UDP.)

If minetest is listening, but the firewall or router is not cooperating, then those are separate issues. One needs to start at an end point and eliminate possibilities.

Lastly, if you did a system wide command with the $ symbol (and no sudo prefacing it) as you have shown above, it most likely didn't open the firewall. # is root, while $ is a user prompt. Perhaps Ubuntu has grown lax in security?

webmanoffesto
Member
Posts: 35
Joined: Thu Nov 30, 2017 14:30

Re: Multiple Users in Same Physical Location

by webmanoffesto » Post

Okay, I must be making progress

Code: Select all

$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To                         Action      From
--                         ------      ----
30000                      ALLOW IN    Anywhere                  
30000 (v6)                 ALLOW IN    Anywhere (v6) 
My Laptop's Minetest is running as Host, Name: TomsMinetest, Port: 30000
and I checked "Announce Server"
On HouseGuest's computer I see "TomsMinetest: 30000"
but when I click "Connect" I still get "Connection timed out."

Earlier work:
I ran netstat

Code: Select all

netstat -ap | grep 30000
udp        0      0 *:30000                 *:*                                 1094/minetest
$ netstat -a
udp        0      0 *:30000                 *:* 
$ netstat -an
udp        0      0 0.0.0.0:30000           0.0.0.0:* 
Interestingly, I don't see 30000 here

Code: Select all

$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 tom-HP-ProBook-4:domain *:*                     LISTEN     
tcp        0      0 localhost:ipp           *:*                     LISTEN     
tcp        0      0 *:31416                 *:*                     LISTEN     
tcp        0      0 localhost:9050          *:*                     LISTEN     
tcp        0      0 localhost:31742         *:*                     LISTEN     
tcp        0      0 localhost:31743         *:*                     LISTEN     
tcp        0      0 localhost:34561         *:*                     LISTEN     
tcp        0      0 *:37383                 *:*                     LISTEN 
sudo netstat -tulpn

Code: Select all

$ $ sudo netstat -tulpn
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:31416           0.0.0.0:*                       LISTEN      1321/boinc      
udp       0          0                 0.0.0.0:30000           0.0.0.0:*                                          1094/minetest   
Nmap says 30000 is closed

Code: Select all

$ nmap localhost -p30000
Starting Nmap 7.01 ( https://nmap.org ) at 2018-02-11 16:55 EST
Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 100.00% done; ETC: 16:55 (0:00:00 remaining)
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000077s latency).
PORT      STATE  SERVICE
30000/tcp closed unknown
nmap localhost

Code: Select all

$ nmap localhost
Starting Nmap 7.01 ( https://nmap.org ) at 2018-02-11 16:59 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00011s latency).
Not shown: 998 closed ports
PORT     STATE SERVICE
631/tcp  open  ipp
9050/tcp open  tor-socks
More attempts

Code: Select all

$ iptables -L -n | grep 30000
iptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
$ sudo iptables -L -n | grep 30000
$ [No output] 
$ sudo iptables -L -n
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

turducken
Member
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: Multiple Users in Same Physical Location

by turducken » Post

webmanoffesto wrote:Okay, I must be making progress

Code: Select all

$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To                         Action      From
--                         ------      ----
30000                      ALLOW IN    Anywhere                  
30000 (v6)                 ALLOW IN    Anywhere (v6) 
My Laptop's Minetest is running as Host, Name: TomsMinetest, Port: 30000
and I checked "Announce Server"
On HouseGuest's computer I see "TomsMinetest: 30000"
but when I click "Connect" I still get "Connection timed out."

Earlier work:
I ran netstat

Code: Select all

netstat -ap | grep 30000
udp        0      0 *:30000                 *:*                                 1094/minetest
$ netstat -a
udp        0      0 *:30000                 *:* 
$ netstat -an
udp        0      0 0.0.0.0:30000           0.0.0.0:* 
Interestingly, I don't see 30000 here

Code: Select all

$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 tom-HP-ProBook-4:domain *:*                     LISTEN     
tcp        0      0 localhost:ipp           *:*                     LISTEN     
tcp        0      0 *:31416                 *:*                     LISTEN     
tcp        0      0 localhost:9050          *:*                     LISTEN     
tcp        0      0 localhost:31742         *:*                     LISTEN     
tcp        0      0 localhost:31743         *:*                     LISTEN     
tcp        0      0 localhost:34561         *:*                     LISTEN     
tcp        0      0 *:37383                 *:*                     LISTEN 
sudo netstat -tulpn

Code: Select all

$ $ sudo netstat -tulpn
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:31416           0.0.0.0:*                       LISTEN      1321/boinc      
udp       0          0                 0.0.0.0:30000           0.0.0.0:*                                          1094/minetest   
Nmap says 30000 is closed

Code: Select all

$ nmap localhost -p30000
Starting Nmap 7.01 ( https://nmap.org ) at 2018-02-11 16:55 EST
Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 100.00% done; ETC: 16:55 (0:00:00 remaining)
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000077s latency).
PORT      STATE  SERVICE
30000/tcp closed unknown
nmap localhost

Code: Select all

$ nmap localhost
Starting Nmap 7.01 ( https://nmap.org ) at 2018-02-11 16:59 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00011s latency).
Not shown: 998 closed ports
PORT     STATE SERVICE
631/tcp  open  ipp
9050/tcp open  tor-socks
More attempts

Code: Select all

$ iptables -L -n | grep 30000
iptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
$ sudo iptables -L -n | grep 30000
$ [No output] 
$ sudo iptables -L -n
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
It looks like minetest is listening for connections. However, here's the problem: you're trying to connect to your external IP. (At least this is my interpretation of what you wrote.)

You need to UNCHECK announce. Your host computer is sending out to the internet "I'm at IP address x.x.x.x, please connect to me." Your client laptops are automatically fetching this server list. When your clients are selecting the server from the menu list they are trying to connect to your EXTERNAL IP ADDRESS. You need to MANUALLY type in your INTERNAL HOST IP into the clients.

On your hosting machine find the IP address via "ifconfig" or "ip addr" commands. Then on the client machines manually type them into the fields for address and port. Choose your player names and passwords (they are set on first connect, so their progress/inventory is saved) and try connecting. When you make a successful connection they will appear in the list with a star as a favorite (even local IP ones.)

Be aware that most routers will dynamically assign IP addresses to machines when they connect, so your host machine IP may change from day to day (or even reconnections to wifi such as shutdown/reboots/etc.) This means finding out the new IP and making sure to connect clients with the new IP. You only care about the host machine IP.

Lastly, it's unclear if your UFW firewall ports are TCP or UDP, but you do need UDP allowed (maybe UFW allows both by default??)

User avatar
GreenXenith
Member
Posts: 1337
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenXenith
In-game: GreenXenith
Location: The singularity
Contact:

Re: Multiple Users in Same Physical Location

by GreenXenith » Post

Just to be clear, you don't need to start Minetest with any sort of special command. Just start it normally and select a world and tick 'host server', enter information and press 'host'. Type `ifconfig` in a terminal to find your IP and use it on the other connecting computers - leave the ports at 30000, and make sure you are all connected to the same network of course. Firewalls may impede that, which is what it seems like you are trying to fix.
Y▹uTube | Mods | Patre●n | Twitter | Minetest Discord | GreenXenith#3232

Hey, you. You're finally awake.
You were trying to view their profile, right? Found the rest of their signature, same as us, and that guest over there.

webmanoffesto
Member
Posts: 35
Joined: Thu Nov 30, 2017 14:30

Re: Multiple Users in Same Physical Location

by webmanoffesto » Post

turducken wrote:On your hosting machine find the IP address via "ifconfig" or "ip addr" commands.
When ipconfig gives me a response like the below, is it the "inet addr" that I want, i.e. I enter "172.16.11.51" in "address".

Code: Select all

wlp3s0    Link encap:Ethernet  HWaddr 54:8c:a0:05:d8:53  
          inet addr:172.16.11.51  Bcast:172.16.11.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29638 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19990 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:32802769 (32.8 MB)  TX bytes:3854451 (3.8 MB)

turducken
Member
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: Multiple Users in Same Physical Location

by turducken » Post

webmanoffesto wrote:
turducken wrote:On your hosting machine find the IP address via "ifconfig" or "ip addr" commands.
When ipconfig gives me a response like the below, is it the "inet addr" that I want, i.e. I enter "172.16.11.51" in "address".

Code: Select all

wlp3s0    Link encap:Ethernet  HWaddr 54:8c:a0:05:d8:53  
          inet addr:172.16.11.51  Bcast:172.16.11.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29638 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19990 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:32802769 (32.8 MB)  TX bytes:3854451 (3.8 MB)
Yes. That is your wireless address.

webmanoffesto
Member
Posts: 35
Joined: Thu Nov 30, 2017 14:30

Re: Multiple Users in Same Physical Location

by webmanoffesto » Post

Today (while on someone else's WiFi) I managed to make one laptop the Host and another laptop joined that game.
I used
ifconfig
wlp3s0: inet addr:10.0.10.87
I also made sure that my VPN was off. I wonder if that was the problem earlier.

webmanoffesto
Member
Posts: 35
Joined: Thu Nov 30, 2017 14:30

Re: Multiple Users in Same Physical Location

by webmanoffesto » Post

I used the "ufw" command to confirm that the port is open, but I still couldn't connect. Please help me to resolve this problem. I have a computer hosting Minetest, and I want another computer on the same WiFi to "join" that Minetest game.

$ sudo ufw status
Status: active
To Action From
-- ------ ----
30000 ALLOW Anywhere
30000 (v6) ALLOW Anywhere (v6)

turducken
Member
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: Multiple Users in Same Physical Location

by turducken » Post

webmanoffesto wrote:I used the "ufw" command to confirm that the port is open, but I still couldn't connect. Please help me to resolve this problem. I have a computer hosting Minetest, and I want another computer on the same WiFi to "join" that Minetest game.

$ sudo ufw status
Status: active
To Action From
-- ------ ----
30000 ALLOW Anywhere
30000 (v6) ALLOW Anywhere (v6)
I thought this was resolved? Your previous message seemed to state that you successfully connected and ran a hosting server? (EDIT: I see it was on someone else's Wifi.)

Perhaps it is time to run `minetest --verbose` from the command line on both host server and clients and look for error messages. You are specifying the correct host server IP address I assume? Can you `ping` the server from the client and from clients to the server (`ping IP from each other? Do other services between computers work (SSH, NFS, Samba, etc.) In other words, we want to know if the Wifi router is forcing each client to be isolated.

You're going to have to go into the router administrator interface and poke around for some setting that is stopping wifi devices from connecting. It is probably a security setting designed to isolate clients from speaking to each other. My reflashed DWRT has an option to isolate my wifi from my wired lan (very irritating.) If the same computers worked with a different wifi router, the issue lies with your router.

My next suggestion is get a new router! :)

(Yes, make sure any VPN software is disabled.)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], CalebJ and 4 guests