Configure network card under CloudLinux
Foreword
In this article, we explain how you can configure an additional network card under CloudLinux.
Prerequisites
- Unmanaged CloudLinux server
Configuration
After the VPC network card has been added to the server in the customer center, it must be configured in the respective server. To do this, make a note of the MAC address assigned by our system to the new VPC network card.
You can use the MAC address to determine which adapter name has been assigned to the network card by the operating system. For Debian or Ubuntu-based operating systems, ens19
is often assigned for the network card that has just been added.
To do this, log on to the respective server via SSH and execute the command ip a
to display all available network cards and determine the correct network adapter based on the MAC address. In this case, this is ens19
.
ip a
// [...]
3: ens19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 16:ca:8f:70:23:22 brd ff:ff:ff:ff:ff:ff:ff:ff
altname enp0s19
You can also use the command nmcli connection show
to display the corresponding UUIDs.
NAME UUID TYPE DEVICE
ens18 bae37c7b-8f79-39da-96fc-b89beeff375d ethernet ens18
Wired connection 1 ebef83ba-8d98-3032-a8b8-eb9765479c44 ethernet ens19
lo 02166105-4617-4c6e-9d54-5489f32ce560 loopback lo
Use the following command to add a new network connection using the desired network adapter. If the command has been executed correctly, the output below appears:
nmcli con add connection.interface-name ens19 type ethernet
Output: Connection 'ethernet-ens19' (a1568c26-698d-492f-8dca-5f92e208925a) successfully added.
To store the desired IP address, you must edit the corresponding network adapter using the CLI (Command Line Interface) of the NetworkManager (nm):
nmcli con edit ethernet-ens19
Then use the following nmcli commands to configure the IPv4 address of the network adapter. Replace the IPv4 address with your desired IPv4 address:
nmcli> set ipv4.addresses
Enter 'addresses' value: 10.20.0.X/24
nmcli> save
nmcli> activate
Then exit nmcli
with the command q
nmcli> q (terminates "nmcli")
Please ensure that you do not assign the IP address of your VPC network twice, otherwise the IP address cannot be used correctly.
Repeat these steps on all CloudLinux servers for which you want to set up an isolated VPC network connection and assign a new IP address from the defined network range for each server.