Custom ISO installation – configure gateway
servers guru
Last Update un mese fa
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
The gateway will change depending on your ip range.
your ip is in the range : 185.198.234.0/24
gateway: 185.198.234.1
your ip is in the range: 45.135.180.0/24
gateway: 45.135.180.1
your ip is in the range: 86.107.168.0/24
gateway: 174.142.205.11
your ip is in the range: 2.57.241.0/24
gateway: 2.57.241.1
your ip is in the range: 89.35.131.0/24
gateway: 89.35.131.1
your ip is not in any of these ranges:
gateway: 172.31.1.1
Please replace {{ MY_GATEWAY }} below with the corresponding gateway and {{ MY_INTERFACE }} with the network interface of your VM.
The second command specifies that the entire traffic is to be directed via the {{ MY_GATEWAY }} gateway with the interface ens3.
The third command defines {{ MY_GATEWAY }} 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 {{ MY_GATEWAY }}.
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.