RHCSA 9 Exam Practice Question 2 (Network Management In Linux)

What Should I know About The RHCSA Exam

EX200/RHCSA 9 Exam Practice question 2

Question

Configure your Host Name, IP Address, Gateway and DNS.

Host name: host1.zone.example.com

IP Address: 192.168.37.137/24

Gateway: 192.168.37.2

DNS/nameserver: 192.168.37.2

dns-search: zone.example.com

The question is based On The Network Configuration & Management In The RHCSA Course on this website. If you have gone through this course, solving this wouldn’t be a problem.

RHCSA Course

Network Management In Red Hat

How To Set Static IP In Red Hat

How To Rename A Hostname In Red Hat

Ask Your Questions

RHCSA 9 Exam Practice Questions & Answers Collection

Answer

There are different ways this can be done.

Method 1 – you can directly edit the NIC/connection configuration file (Note that network script has been deprecated in RHEL 9)

Method 2 – you can use the nmcli utility

Method 3 – you can use the nmtui utility.

Method 4 – you can use the GUI

We are going to use the second method.

1 Verify the NICs on the system, and the active connection

[root@Tekneed ~]# ip a

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: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    ..........................

[root@Tekneed ~]# nmcli conn show

NAME    UUID                                  TYPE      DEVICE
ens160  0f8de7a3-2032-33ed-aa83-f11ceec16148  ethernet  ens160

you can see that the active connection and device is ens160.

2. configure the network by using the nmcli utillity

[root@Tekneed ~]# nmcli con mod ens160 ipv4.addresses 192.168.37.137/24 ipv4.gateway 192.168.37.2 ipv4.dns 192.168.37.2 ipv4.dns-search zone.example.com ipv4.method manual

3. Restart the NIC and network manager service

[root@Tekneed ~]# systemctl restart NetworkManager

NB: sometimes, the changes may not take effect, hence, restart the network interface

[root@Tekneed ~]# nmcli con reload
[root@Tekneed ~]# nmcli con down ens160
[root@Tekneed ~]# nmcli con up ens160

OR you can just write it together at once as shown below

[root@Tekneed ~]# nmcli con down ens160;nmcli con up ens160

4. Verify the new IP address

[root@Tekneed ~]# ip a

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: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:e9:22:93 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 192.168.37.137/24 brd 192.168.37.255 scope global noprefixroute ens160

ex200/rhcsa 9 exam practice question 2

Verify the default gateway

[root@Tekneed ~]# ip route

default via 192.168.37.2 dev ens160 proto static metric 100
............

Verify the DNS

[root@Tekneed ~]# cat /etc/resolv.conf

# Generated by NetworkManager
search zone.example.com
nameserver 192.168.37.2

5. Now set the new hostname

[root@Tekneed ~]# hostnamectl set-hostname host1.zone.example.com 

6. Verify the new hostname

[root@Tekneed ~]# hostname

host1.zone.example.com

You may need to reopen a new session before it can be visible on your terminal

[root@host1 ~]#

Solution Summary

ip a

nmcli conn show

nmcli con mod ens160 ipv4.addresses 192.168.37.137/24 ipv4.gateway 192.168.37.2 ipv4.dns 192.168.37.2 ipv4.dns-search zone.example.com ipv4.method manual

nmcli con down ens160;nmcli con up ens160

hostnamectl set-hostname host1.zone.example.com /etc/hostname

verify

You can also watch the Video on ex200/RHCSA 9 Exam Practice Question 2 by clicking the link below.

Your feedback is welcomed. If you love others, you will share with others

Be the first to comment

Leave a Reply

Your email address will not be published.


*