sudo nmcli con reload # or command below
sudo systemctl restart NetworkManager
nmcli con down vnat2
nmcli con up vnat2
ip
Set down interface ens160 (if necessary):
ip link set down dev ens160
Delete ipv4 address and routing from device ens160:
ip addr del 192.168.2.4/24 dev ens160
ip route del default via 192.168.2.2
Set device up, because either is will not work:
ip link set up dev ens160
Set new ipv4 address and route:
ip addr add 192.168.2.5/24 dev ens160
ip route add default via 192.168.2.2 dev ens160
Task 2:
Create new network connection with existing interface (enp1s0) using provided values:
IPv4: 172.25.X.10/255.255.255.0 (where X is your domain number: Domain 15)
Gateway: 172.25.X.2
DNS server: 172.25.X.2
Add the following secondary IP addresses statically to your current running connection. Do this is a way that does not compromise your existing settings:
IPv4: 10.0.0.5/24 and set the hostname node1.domain15.example.com
nmcli solution
Create a New Network Connection:
nmcli con add con-name primary-connection ifname enp1s0 type ethernet ip4 172.25.15.10/24 gw4 172.25.15.2
nmcli con mod primary-connection ipv4.dns 172.25.15.2
nmcli con up primary-connection
Add secondary IPv4 address:
nmcli con mod primary-connection +ipv4.addresses 10.0.0.5/24
nmcli con up primary-connection
ip addr show enp1s0
Set hostname:
sudo hostnamectl set-hostname node1.domain15.example.com
# making hostname settings permanent:
echo "node1.domain15.example.com" | sudo tee /etc/hostname
# verify changes:
hostnamectl