Custom ISO installation – configure gateway

servers guru

Last Update há 9 meses


Doing a manual installation via ISO will cause some trouble with the automatic configuration via DHCP.

You will therefore have to configure the default gateway yourself.


Doing a manual configuration via an installer is not possible.

This guide explains how to set up the default gateway manually.


Prerequisites:

The new ISO image must have been mounted

You must have performed a restart on your server After the server’s restart, you have to complete the image installation via the VNC console. You can open the console by clicking the VNC button on your control panel next to your VPS.


Configuring the default gateway:

If you’re using Ubuntu 16.04 (or newer) or Debian 9 (or newer), the interface name is ens3.


During the installation

When you open the console as explained above, it will view the installation.


Use the key combination ALT + → to exit the installation view and change to the console view. If the view does not change, finish one or two installation steps and try again.


To activate the console, press ENTER.


ALT + ← will take you back to the installation view.


Execute the following commands in the console:


Server with IPv4 and / or IPv6

172.31.1.1 is a private IP address that you can copy directly with the rest.


The first command will print all network interfaces.

The second command specifies that the entire traffic is to be directed via the 172.31.1.1 gateway with the interface ens3.

The third command defines 172.31.1.1 as the default gateway. This means, this gateway will automatically be used, unless stated otherwise.


Your server now has a default gateway with the IP address 172.31.1.1.


With ip route show you can check if the changes were saved successfully.

Afterwards, use the key combination ALT + ← to go back to the installation view.


After the installation

To Connect to the server after the installation, you can use a normal CLI again, instead of the VNC console.


After the installation, you could theoretically use the commands that were also shown for “during the installation”. However, the changes would only be saved temporarily, and you would lose them with the next restart.


To change the default permanently after the installation, you will have to edit the network configuration.


Ubuntu/Debian

Ubuntu 18.04 and newer

Ubuntu 18.04 (and newer) uses netplan, which is different to the older configurations of Ubuntu.


Open the .yml file in the /etc/netplan/ folder:

Edit the file:


Replace eth0 with ens3

Once you are done, you can use CTRL + X to exit the file, Y to save the file and ENTER to confirm.


Debian 9 or newer / Ubuntu 16.04

Open the configuration file in the /etc/network folder:

Edit the file:


Replace eth0 with ens3

Once you are done, you can use CTRL + X to exit the file, Y to save the file and ENTER to confirm.

Was this article helpful?

1 out of 1 liked this article

Still need help? Message Us