VPS: Fixing Network Problems That Occur After Migration
Please use the “Print” function at the bottom of the page to create a PDF.
In individual cases, the name of the network device is changed in the network configuration file of your operating system as part of the migration of your server.
To correct the network configuration settings, proceed as follows:
Operating systems without static configuration of IP addresses
To display information on all network interfaces, enter the following command:
[root@localhost ~]# ip addr
In this example, the name of the network interface is ens192:[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:2c:95:c9 brd ff:ff:ff:ff:ff:ff:ff
altname enp11s0
inet 82.165.19.21/32 scope global dynamic noprefixroute ens192
valid_lft 40221sec preferred_lft 40221sec
inet6 2001:8d8:1800:194::1/128 scope global dynamic noprefixroute
valid_lft 3231sec preferred_lft 3231sec
inet6 fe80::6c11:4b6b:f43d:adad/64 scope link noprefixroute
valid_lft forever preferred_lft foreverIf you are using Ubuntu 20.04 or Ubuntu 22.04, you must also check whether Netplan is being used. To do this, change to the /etc/netplan directory and check whether there is a configuration file in this directory. To do this, enter the following commands:
[root@localhost ~]# cd /etc/netplan
[root@localhost ~]# lsOpen the configuration file of your network with the vi editor.
CentOS 7root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens192
Ubuntu 18.04, Ubuntu 20.04, Debian 10, 11 and Debian 12[root@localhost ~]# vi /etc/network/interfaces
CentOS Stream 8, AlmaLinux 8 and Rocky Linux 8[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-NETZWERKINTERFACE
Example:
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens192
Ubuntu 20.04 and 22.04 with Netplan[root@localhost ~]# vi /etc/netplan/01-netcfg.yaml
CentOS Stream 9, AlmaLinux 9 and Rocky Linux 9[root@localhost ~]# vi /etc/NetworkManager/system-connections/NETZWERKINTERFACE.nmconnection
Example:
[root@localhost ~]# vi /etc/NetworkManager/system-connections/ens192.nmconnection
Notes
- The vi editor has an insert mode and a command mode. You can call up insert mode with the i key. In this mode, the characters entered are immediately inserted into the text. To call up command mode, press ESC. If you use command mode, your keyboard input is interpreted as a command.
- To exit vi and save the file, enter the command :wq and then press Enter.
- Check the entries and correct the name of the specified network interface.
- To save the changes, press the ESC key, then enter :wq and press Enter.
Operating systems with static configuration of IP addresses
To display information on all network interfaces, enter the following command:
[root@localhost ~]# ip addr
In this example, the name of the network interface is ens192:
[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:2c:95:c9 brd ff:ff:ff:ff:ff:ff:ff
altname enp11s0
inet 82.165.19.21/32 scope global dynamic noprefixroute ens192
valid_lft 40221sec preferred_lft 40221sec
inet6 2001:8d8:1800:194::1/128 scope global dynamic noprefixroute
valid_lft 3231sec preferred_lft 3231sec
inet6 fe80::6c11:4b6b:f43d:adad/64 scope link noprefixroute
valid_lft forever preferred_lft foreverIf you are using Ubuntu 20.04 or Ubuntu 22.04, you must also check whether Netplan is being used. To do this, change to the /etc/netplan directory and check whether there is a configuration file in this directory. To do this, enter the following commands:
[root@localhost ~]# cd /etc/netplan
[root@localhost ~]# lsOpen the configuration file for your network using the vi editor.
CentOS 7
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens192
Ubuntu 18.04, Ubuntu 20.04 without Netplan, Debian 10, 11 and Debian 12[root@localhost ~]# vi /etc/network/interfaces
CentOS Stream 8, AlmaLinux 8 and Rocky Linux 8[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens192
Ubuntu 20.04 and 22.04 with Netplan[root@localhost ~]# vi /etc/netplan/01-netcfg.yaml
CentOS Stream 9, AlmaLinux 9 and Rocky Linux 9[root@localhost ~]# vi /etc/NetworkManager/system-connections/ens192.nmconnection
or[root@localhost ~]# vi /etc/NetworkManager/system-connections/eth0.nmconnection
Notes
- The vi editor has an insert mode and a command mode. You can call up insert mode with the i key. In this mode, the characters entered are immediately inserted into the text. To call up command mode, press ESC. If you use command mode, your keyboard input is interpreted as a command.
- To exit vi and save the file, enter the command :wq and then press Enter.
- Check the entries and correct the name of the specified network interface.
- Replace the specified gateway. To do this, use the main IPv4 address and replace the numbers after the third dot with the number 1. Use the following format:
IP address: 123.456.78.91
IPv4 gateway: 123.456.78.1
Example:
The server uses the main IPv4 address 82.165.34.29. In this case, the gateway 82.165.34.1 must be entered. - Only applies to Ubuntu 18.04, Ubuntu 20.04, Debian 10, 11 and Debian 12: Make sure that the netmask 255.255.255.255 is used.
Replace the IPv6 settings:
CentOS 7
IPV6INIT=yes
IPV6_FAILURE_FATAL=no
IPV6_AUTOCONF=yes
DHCPV6C=yes
CentOS Stream 8, AlmaLinux 8 and Rocky Linux 8IPV6INIT=yes
IPV6_FAILURE_FATAL=no
CentOS Stream 9, Alma Linux 9 and Rocky Linux 9[ipv6]
addr-gen-mode=eui64
method=auto
Ubuntu 18.04, Ubuntu 20.04 without Netplan, Debian 10, 11 and Debian 12iface ens192 inet6 manual
pre-up sleep 5
up dhclient -6 -nw -v ens192
down dhclient -6 -r -v ens192
Ubuntu 20.4 and Ubuntu 22.04 with Netplandhcp6: true
- To save the changes, press the [ESC] key, then enter :wq and press Enter.
Restart the server so that the changes are applied. To do this, enter the following command:
root@localhost:~# systemctl reboot