Assigning IP addresses with OS tools
DCImanager 6 assigns IP addresses to the server automatically during the operating system (OS) reinstallation. You can assign IP addresses to the server manually. The procedure of assigning IP addresses depends on the server's operating system.
Note
Be careful when changing network settings manually. If you specify incorrect data, the server’s network connection may be disrupted. In this case, remote work with the server will only be possible via BMC.
AlmaLinux
To assign an IP address:
Connect to the server via SSH with superuser permissions.
- To assign an IPv4 address
Specify the network settings in /etc/sysconfig/network-scripts/ifcfg-<interface> file, where <interface> is the name of the network interface. For example, /etc/sysconfig/network-scripts/ifcfg-eth0.
Example of settings
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.1.100 NETMASK=255.255.255.0 GATEWAY=192.168.1.1
CODEComments to the exampleDEVICE — interface name
IPADDR — IP address
NETMASK — network mask
GATEWAY — gateway IP address
To assign an IPv6 addressAdd IPv6 settings to the network interface file /etc/sysconfig/network-scripts/ifcfg-<interface>, where <interface> is the interface name. For example, /etc/sysconfig/network-scripts/ifcfg-eth0.
Example of settings
IPV6INIT=yes IPV6ADDR=2001:0DB8::/64 IPV6_DEFAULTGW=2001:0DB8::1
CODEComments to the exampleIPV6ADDR — IPv6 address with network prefix
IPV6_DEFAULTGW — gateway IP address
Restart the NetworkManager software:
systemctl restart NetworkManager
BASHReconnect the network interface:
nmcli device disconnect <interface> && nmcli device connect <interface>
BASHComments to the command<interface> — name of the network interface
CentOS
To assign an IP address:
Connect to the server via SSH with superuser permissions.
- To assign an IPv4 address
Specify the network settings in /etc/sysconfig/network-scripts/ifcfg-<interface> file, where <interface> is the name of the network interface. For example, /etc/sysconfig/network-scripts/ifcfg-eth0.
Example of settings
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.1.100 NETMASK=255.255.255.0 GATEWAY=192.168.1.1
CODEComments to the exampleDEVICE — interface name
IPADDR — IP address
NETMASK — network mask
GATEWAY — gateway IP address
To assign an IPv6 addressEnable IPv6 support in the OS. Add the following line to the /etc/sysconfig/network file:
NETWORKING_IPV6=yes
CODEAdd IPv6 settings to the network interface file /etc/sysconfig/network-scripts/ifcfg-<interface>, where <interface> is the interface name. For example, /etc/sysconfig/network-scripts/ifcfg-eth0.
Example of settings
IPV6INIT=yes IPV6ADDR=2001:0DB8::/64 IPV6_DEFAULTGW=2001:0DB8::1
CODEComments to the exampleIPV6ADDR — IPv6 address with network prefix
IPV6_DEFAULTGW — gateway IP address
Restart the network service:
systemctl restart network
BASH
Debian, Ubuntu
To assign an IP address:
- Connect to the server via SSH with superuser permissions.
Specify the network settings in /etc/network/interfaces:
To assign an IPv4 addressExample of settings
iface ens3 inet static address 192.168.2.100 netmask 255.255.255.0 gateway 192.168.2.1 auto ens3
BASHComments to the exampleens3 — network interface
address — IP address
netmask — network mask
gateway — gateway IP address
To assign an IPv6 addressExample of settings
iface ens3 inet6 static address 2001:0DB8:: netmask 64 gateway 2001:0DB8::1 auto ens3
BASHComments to the exampleens3 — network interface
address — IPv6 address
netmask — subnet prefix length
gateway — gateway IP address
Restart the networking service:
systemctl restart networking
BASH