How to connect your server

Connecting Your Server

At home you have a connection from your provider with which you can connect to the internet. The provider provides a modem where a network cable (cat5 or cat6) can be inserted. That way you can connect to dirty internet without any security. Almost everyone with such a connection sets up a router after the modem with the aim of connecting multiple computers. The router also ensures that breaking in from outside is made virtually impossible by using special techniques. This does not mean that you can not run into viruses by surfing the internet, in which case you usually invite the burglar….

Some providers provide a device where the modem and router are combined. It is then possible to connect different computers or connect to the internet via Wi-Fi.

In any case, the server at home must be connected directly to the router. This ensures that the server is connected to the server in the fastest way from the other computers in the house. This is important for the performance of the equipment.

Connecting to your server from outside your home

The server will therefore always be connected directly behind a router. The standard configuration of a router blocks all access to the home network so that you are more secure behind the router than when you are connected directly to the internet. If you still want to allow traffic then it is necessary to configure the router so that this traffic can be established.
This special traffic should only be sent to the server. All other computers at home must be protected. A fixed IP address is then required to be able to route this traffic from outside to the server.

Configure a fixed IP address in the server

When choosing a fixed internet address, care must be taken to choose an address from the range of the DHCP server pool. Open the configuration file: to be able to lead far.
sudo nano /etc/network/interfaces
Pas de volgende tekst toe:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primairy network interface
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
nameserver 212.54.40.25 212.54.35.25 8.8.8.8 8.8.4.4

It should be noted that one works in the right address range. A frequently used address range is 192.168.0.1. This adjustment must be processed here in the example.

The dns servers, the name servers, can often be found in your router as the router requests these addresses from the provider’s system.

Then restart the network services:
sudo /etc/init.d/networking restart

Configure a fixed IP address in the router

Many routers have a possibility to generate a list of connected devices. In this list you can look up the server and determine the MAC address of the server. It can often be indicated that a device with that mac address must have a certain IP address chosen by you. In this way, no adjustments are required in the server.

Details about the configuration of the router can be found in the operating instructions of your router.

Port Forwarding in the router

If you want to run a web server at home, the ports 80 and 8080 must be forwarded from the server. Ports must also be forwarded for other options. Now that a fixed address has been set for the server, this becomes possible.

There is a possibility to forward ports in the router. This is also called open. This can be found in the router under “Portforwarding”. this is a simple list in which a port number and an ip address can be included. The traffic of the specified port is then always sent to the given ip address. In this way, Internet can enter outside traffic on the server and be processed further there.
Laatst bijgewerkt op 1 oktober 2018

Een gedachte over “How to connect your server

  1. Beste Cees,
    Misschien kun jij mij helpen. Het bovenstaande stukje beantwoord niet mijn vraag en ik worstel met het volgende probleem.
    Nieuwste Ubuntu server pakket geinstalleerd. Pc met 2 netwerkkaarten. De ene kaart moet de server verbinden met het adslmodem en natuurlijk internet. De andere kaart moet mijn LAN voorzien van ip-adressen via DHCP en voorts het internet verkeer van alles in het LAN regelen (in feite gewoon doorlinken). Voorheen gewerkt met CLearOS systeem en werkte probleemloos.
    Nu wilde ik het proberen te regelen met Ubuntu omdat daarvoor iets meer software pakketten beschikbaar zijn.
    Het lukt mij echter niet om de LAN-netwerk kaart werkend te krijgen. De server heeft prima internet, maar clients aan de lan-kant krijgen geen internet of een juist ip adres.
    Misschien nog als extra info: de server verspreid zijn ip’s via een router die ook tevens het WIFI verkeer regelt.

    Kun jij mij helpen met de juiste configuratie voor de 2 netwerkkaarten in te stellen.

    Ik ben benieuwd!
    Alvast dank voor je reactie.
    Met vriendelijke groet,
    Ron

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *