ip-connection

Task 1:

Set this configurations on your redhat host:

Gateway - 192.168.2.2

IPv4 - 192.168.2.3

Netmask - 255.255.255.0

DNS - 8.8.8.8


nmcli

Deleting previous records:

nmcli connection delete <NAME>
nmcli connection delete ens160

Adding new record:

nmcli device show
#then:

nmcli connection add con-name VNAT type thernet ifname ens160

# or
nmcli connection add con-name VNAT type ethernet \
    ipv4.method manual ipv4.addresses 19.168.2.4/24 \
    ipv4.gateway 192.168.2.2 ipv4.dns 8.8.8.8
    
# enable autoconnect
nmcli con mod VNAT connection.autoconnect yes

If required, you can down and up the connection:

nmcli the old way:

In old releases, ifconfig creates scripts and adds to network-scripts folder, this is deprecated but it is worth to know for debugging purposes:

You can add then start the connection by:

ip

Set down interface ens160 (if necessary):

Delete ipv4 address and routing from device ens160:

Set device up, because either is will not work:

Set new ipv4 address and route:

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:

Add secondary IPv4 address:

Set hostname:

Last updated

Was this helpful?