473,387 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to connect to a specific server that has 192.168.0.X IP

Hello everyone
I'm following a simple guide on the internet about how to create a local server for a specific game on a virtual machine
I did all the steps without problems, but when I test, I can't connect to the server
Someone told me it's happening because my virtual machine IP is 192.168.0.X and it should be 192.168.1.X
I tried to set a static IP, but this didn't work
My question is: How do I make it work using 192.168.0.X IP?
Thanks in advance.

This is the guide I'm following:
Step 1 : Create the linux and prepare it
1) Create Virtual machine on Virtual box with this setup
- core : 2
- ram : 4 gb
- disk space : 50Gb

2) Install Ubuntu 20.04.4
- You must install SSH

3) Execute the following commands
Expand|Select|Wrap|Line Numbers
  1. - sudo apt update
  2. - sudo apt upgrade
  3. - sudo apt install nano 
  4. - sudo apt install net-tools
  5. - sudo apt install screen
  6. - sudo apt install unzip
4) Enable root login over SSH using
Expand|Select|Wrap|Line Numbers
  1. - nano /etc/ssh/sshd_config
  2. - Change or add line: PermitRootLogin yes
5) Then restart SSH service
- service ssh restart

6) Then setup database
- sudo apt install postgresql

Step 2 : Setup the postgres database
1) Change your user to postgres
Expand|Select|Wrap|Line Numbers
  1. - su postgres
  2. - Then write: psql ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS PASSWORD 'test';
2) Allow the login from external
Expand|Select|Wrap|Line Numbers
  1. - cd /etc/postgresql/12/main
  2. - Then: sudo su
  3. - Then: nano pg_hba.conf
  4. - Change this: host   all   all   127.0.0.1/32   md5
  5. - To this: host   all   all   0.0.0.0/0   md5
  6.  
3) Update postgresql.conf
Expand|Select|Wrap|Line Numbers
  1. - nano postgresql.conf
  2. - Change this: #listen_addresses = 'localhost'  # what IP address(es) to listen on;
  3. - To this: listen_addresses = '*'  # what IP address(es) to listen on;
4) Restart postgres
- service postgres restart

Step 3 : Setup the database
1) Change to postgres user
Expand|Select|Wrap|Line Numbers
  1. - su postgres
  2. - Copy your database.out to the VM in the folder /home
2) Then:
Expand|Select|Wrap|Line Numbers
  1. - psql -f database.out
  2. - Copy your worlds.sql to the VM in the folder /home
3) Edit the worlds.sql following your local IP
Expand|Select|Wrap|Line Numbers
  1. - INSERT INTO "public"."worlds" VALUES (1010, 'CHANNEL_NAME', 'YOUR_IP', 5712, 0, 150, 1, '002.003.05.67', 1, 0, 1, 100);
4) Then:
Expand|Select|Wrap|Line Numbers
  1. - psql -d fnaccount  -f worlds.sql
  2. - Copy your serverstatus.sql to the VM in the folder /home
5) Update serverstatus.sql following your IP
Expand|Select|Wrap|Line Numbers
  1. - INSERT INTO "public"."serverstatus" VALUES (1010, 'WorldServer', 'YOUR_IP', 5712, '127.0.0.1', 5712, 0);
  2. INSERT INTO "public"."serverstatus" VALUES (1011, 'ZoneServer', 'YOUR_IP', 10166, '127.0.0.1', 10166, 0);
  3. INSERT INTO "public"."serverstatus" VALUES (-2, 'MissionServer', 'none', -1, '127.0.0.1', 7654, 1628266391);
6) Then:
- psql -d fndb1 -f serverstatus.sql

Step 4 : Launch the server
Expand|Select|Wrap|Line Numbers
  1. - Copy paste server folder in /home of your VM
  2. - sudo su
  3. - sudo chmod 777 /home/server -R **
  4. - Change all password database in files
  5. - Start the server with: ./start
May 8 '22 #1
2 20480
dev7060
636 Expert 512MB
How and from where are you trying to connect?

Why does it have to be 192.168.0.X? How do you know if it hasn't been already allocated/assigned/in use?

Step 4 : Launch the server
Does it say something like server is up and running and says any IP/port number?

Not this use case specifically (Postgres server). Long ago, I used NAT (Metasploitable or Kali VM, if I remember correctly) to set up a lab.

The disadvantage of NAT mode is that, much like a private network behind a router, the virtual machine is invisible and unreachable from the outside internet. You cannot run a server this way unless you set up port forwarding.
https://docs.oracle.com/en/virtualiz...twork_nat.html

Might be useful to you.
May 16 '22 #2
cactusdata
214 Expert 128KB
Use the subnet:

Expand|Select|Wrap|Line Numbers
  1. 255.255.0.0
May 17 '22 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: ajikoe | last post by:
How can python connect to server which use SSH protocol? Is it easy since my python has to run third party vendor, write data, read data inside the server (supercomputer). Any suggestion? ...
1
by: Chris | last post by:
I get the follow error on a linux box that is running sun asp: CDONTS.NewMail.1 error '80020009' unable to connect to server The error occurs when the Send Command is Executed. Here is my code...
33
by: Savas Ates | last post by:
in asp page im getting this error how can i solve it.. yesterday the codes work but i setup visual studio 6.0 now it doesnt works..
7
by: Cyphos | last post by:
Hi, I'm just learning how to use the XmlHttpRequest object. Very cool. However, I'm wondering how I can call a specific server-side method. For example, say I have a method defined as follows on...
15
by: rajbala | last post by:
hi all, I got the error like $ mysqladmin -h localhost -u root -p create bedrock Enter password: ****** mysqladmin: connect to server at 'localhost' failed error: 'Access denied for...
3
by: privateson | last post by:
Hi guys, I am a coop student. We are going to convert a C# program into Java. My question is: Does anyone of you know how to connect .Net Server with Java? Since the business logic is inside...
0
by: s6shiva | last post by:
i am not able to connect sql server 2000 giving message: a connection could not be established. "reason:SQL server does not exist or access denied. connectionopen(Connect()).. i am a new...
0
by: Jitsu | last post by:
Hi all, I have a problem. I need to connect Web Server, send a xml string (query) to it and receive another xml string (resutl). I have location of the Web Server like: https://extranet....com:8443,...
2
by: jephperro | last post by:
Hi there, I have a problem using PHPMailer. On my local development machine, the script works fine and sends emails. On amy staging server, when I try to use PHPMailer to send() I see the...
1
by: jwgoerlich | last post by:
Hello group, I am building several Windows C# applications that interact with SQL Server 2005 databases. Is it possible to re-use the SQL "Connect to Server" dialog box? Alternatively, can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.