RHCSA Exam QuestionsBrowse all questions from this exam

RHCSA Exam - Question 1


SIMULATION -

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

Host name: station.domain40.example.com

/etc/sysconfig/network

hostname=abc.com

hostname abc.com

IP Address:172.24.40.40/24 -

Gateway172.24.40.1 -

DNS:172.24.40.1 -

Show Answer
Correct Answer:

To configure the Host Name, IP Address, Gateway, and DNS, follow these steps: To set the hostname to station.domain40.example.com, edit the file /etc/sysconfig/network: 'HOSTNAME=station.domain40.example.com'. For the IP Address, Gateway, and DNS configuration, navigate to /etc/sysconfig/network-scripts/ and edit the ifcfg-eth0 file to include the following: IPADDR=172.24.40.40, PREFIX=24, GATEWAY=172.24.40.1, and DNS1=172.24.40.1. Applying these settings through editing configuration files ensures the network settings are preserved across reboots.

Discussion

25 comments
Sign in to comment
QuangTruong
Sep 20, 2024

#cd /etc/sysconfig/network-scripts/ #ls #vi ifcfg-eth0 IPADDR=172.24.40.40 PREFIX=24 GATEWAY=172.24.40.1 DNS1=172.24.40.1 #hostnamectl set-hostname station.domain40.example.com

xXxM__JxXx
Mar 11, 2022

hi, how do you make this configuration in effect? it tried systemctl restart networkmanager but the service is not found. i tried nmcli networking off and on but this does not take effect also. i did systemctl reboot for this to work. thank you for the advise. btw using nmcli con mod enables me to use nmcli networking off and on to make the changes in effect.

eddiemy
Apr 4, 2022

Either way using ifdown eth0;ifup eth0 or nmcli conn up eth0

kathee
Mar 7, 2023

systemctl restart network.service

scarylucky
May 13, 2023

should be systemctl restart NetworkManager

scarylucky
May 13, 2023

should be systemctl restart NetworkManager

eddiemy
Apr 4, 2022

Either way using ifdown eth0;ifup eth0 or nmcli conn up eth0

kathee
Mar 7, 2023

systemctl restart network.service

scarylucky
May 13, 2023

should be systemctl restart NetworkManager

Luca_D
Mar 22, 2023

It's true up to Rhel 8 , in Rhel 9 configuration files are in /etc/NetworkManager/system-connections/

scarylucky
May 13, 2023

should be systemctl restart NetworkManager

anon201
May 20, 2023

nmcli con reload afterwards and it works like charm !

jose32576358
Dec 6, 2024

ifcfg format is deprecated for RCHSA 9. NetworkManager stored network profiles in /etc/NetworkManager/system-connections

lizivi
Dec 28, 2024

hello all , in the exam there is two connections which connection we should edit ?the active one ( the first connection ) we modify the existing OR we edit the second connection ? please anyone can answer? https://community.learnlinux.tv/t/ex200-practice-questions/4361

Pagma
Jan 28, 2025

exam environment is now RHEL 9?

Pagma
Jan 28, 2025

exam environment is now RHEL 9?

PERjham
Feb 10, 2021

There is many ways to achieve the tasks, remember! In this case, for this question all the commands working in rhel 7 also work in rhel 8. Again, remember, there is many ways to resolve the questions. For example, if you can change the hostanme, you can use the cli (hostnamectl) or modifying directly the archive for that purpose: /etc/hostname. If you can modify the network details, you can use, nmcli (cli for network mannager), nmtui (TUI for network manager) or modify the archives directly. You can choose any of the ways you want!

Rahul95
May 31, 2023

#hostnamectl set-hostname station.domain40.example.com #hostnamectl - to verify #nmcli connection modify eth0 ipv4.addresses 172.24.40.40/24 ipv4.gateway 172.24.40.1 ipv4.dns 172.24.40.1 ipv4.method static #nmcli connection down eth0 #nmcli connection up eth0 # ping 172.24.40.1 - to verify

crystal_star
May 21, 2022

Solution: hostnamectl set-hostname station.domain40.example.com nmcli connection add con-name ens160 ifname ens160 ipv4.method manual ipv4.addresses 172.24.40.40/24 ipv4.gateway 172.24.40.1 ipv4.dns 172.24.40.1 connection.autoconnect yes type ethernet

feidhlimx
Jun 14, 2022

hostnamectl without admin privileges is ok. Does the nmcli command also work in this way?

DBrown
Mar 4, 2023

Option 1 - #sudo nmtui (gui configuration) Option 2 - #nmcli connection modify ipv4.method manual ipv4.addresses 172.24.40.40/24 ipv4.gateway 172.24.40.1 ipv4.dns 172.24.40.1 #hostnamectl set-hostname station.domain40.example.com #sudo nmcli connection down enp0s3 && sudo nmcli connection up enp0s3

Luca_D
Mar 21, 2023

DBrown, why enp0s3? I took the exam and there are two connections, eth0 (active) and enp0s3. I couldn't understand if I had to modify eth0 or add an address to enp0s3. Thanks

Nhan
Sep 27, 2020

the given answer is not correct, for the redhat 8 you must use the systemctl set hostname to set the hostname or modify the hostname by vi /etc/hostname file... Please be carefull i have seem nay question in here is not for redhat 8, also some of the question are given wrong answer or not completely relevant to redhat 8.0. They might work for rehat 7,

RedQuasar
Dec 12, 2020

hostnamectl set-hostname station.domain40.example.com nmcli con add type ethernet con-name eth0 ifname eth0 ipv4.addresses 172.24.40.40/24 ipv4.gateway 172.24.40.1 ipv4.dns 172.24.40.1 nmcli con mod eth0 ipv4.addresses 172.24.40.40/24 ipv4.gateway 172.24.40.1 ipv4.dns 172.24.40.1

Joeytechn9t
Jun 2, 2021

#cd /etc/sysconfig/network-scripts/ #ls #vim ifcfg-enp0s3 IPADDR=172.24.40.40 PREFIX=24 GATEWAY=172.24.40.1 DNS1=172.24.40.1 #nmcli connection down enp0s3 && sudo nmcli connection up enp0s3 # hostnamectl set-hostname station.domain40.example.com

Kengoudy
Dec 16, 2022

So I am to enter the parameters in the network-scripts. How do I check to see if the changes were made? Thanks.

rhcsa_conqueror
Feb 4, 2023

For RHCSA 9 we can use nmtui right. I feel this is very easy. Any one please confirm

Akira_Goketsu
Sep 16, 2023

you can use nmtui it is more faster way, it work for exam version 8

DANG257315
Jan 8, 2021

* hostnamectl set-hostname station.domain40.example.com * nmcli con add con-name wifi type ethernet ifname enp0s3 ip4 172.24.40.40/24 gw4 172.24.40.1 ipv4.dns 172.24.40.1 para comprobar hostname ip a

cloudsinair
May 15, 2023

RHEL 9.1 root]# root]# hostnamectl set-hostname station.domain40.example.com root]# root]# cat /etc/hostname root]# nmcli connection add con-name MyExam ifname ens224 type ethernet ipv4.addresses 172.24.40.50/24 ipv4.gateway 172.24.40.1 root]# root]#nmcli connection modify MyExam ipv4.dns 172.24.40.1 root]# root]# nmcli connection modify MyExam ipv4.method manual root]# root]# nmcli connection up MyExam root]# root]# nmcli device

duracell
Dec 27, 2023

hostnamectl hostname station.domain40.example.com is correct, whithout set-

ACM13
Aug 5, 2023

"nmtui" is easier to remember and can achieve both goals. "nmcli" is also easy but required a bit more of remembering the right order of the commands for exemple

Leepipes101
Mar 15, 2021

# nmcli con add type ethernet con-name anyname ifname ensXXX or ethX ip4 XXX.XXX.XXX.XXX/XX \gw4 XXX.XXX.XXX.XXX # nmcli con modify nameofconnection +ipv4.dns XXX.XXX.XXX.XXX # hostnamectl set-hostname nameofhost # nmcli con up nameofconnection or # systemctl reboot or # systemctl restart NetworkManager or # nmtui or from the GUI

onyeo
Oct 4, 2021

I had network config issues while taking ex200 exam. I used the exam provided addresses for ip dns, gateway, nameserver and netmask but I was unable to connect my VM1 and VM2 via nmtui or nmcli tools. All address entries were correct but the VMs failed to connect with this error "172.24.1.10 icmp_seq=1 Destination Host Unreachable" I have done a couple online research but I truly don't know what I am missing or getting wrong. I have tried re-create the error on my home lab but I failed. Sorry to bother you, What recommendation/resolution can be used to fix this issue. I want to retake the exam. Thank you.

STFN2019
Oct 5, 2021

It could be the routing issue or the firewalld.

Kengoudy
Dec 16, 2022

When ls in the network-scripts, I get readme- ifcfg- rh.txt. Am I suppose to touch ifcfg-etho into network-scripts?

Dewitts68
May 15, 2023

it has moved. Read the readme for more information. /etc/NetworkManager/system-connections/ <--- is the new location of the config files

dunia
Oct 6, 2023

hello all , in the exam there is two connections which connection we should edit ?the active one ( the first connection ) we modify the existing OR we edit the second connection ? please anyone can answer?

lordwhisss014
Apr 13, 2021

you can edit it /etc/sysconfig/networkscripts/ifcfg-nameofconnection this is applicable on rhel8

ASherbiny_1604
May 31, 2021

It is not a recommended way to edit the network-scripts file, it is better to use nmcli or nmtui

nickoftime
Apr 18, 2021

i hostnamectl set-hostname station.domain40.example.com and if u using netowork manager.... nmcli connection modify ens33 ipv4.addresses 172.24.40.40/24 ipv4.gateway 172.24.40.1 ifname ens33 ipv4.method manual autoconnect yes

SachinRao
Aug 4, 2022

vi /etc/hostname station.domain40.example.com

jahmad0730
May 21, 2023

Do you need mask of 24 in the network-scripts vi? As in... IPADDR=172.24.40.40/24 or IPADDR=172.24.40.40 ???

Ozarsif
Sep 26, 2023

yes, you do. otherwise you will get IP of 172.24.40.40/32

shubby12
Jun 7, 2023

#cd /etc/sysconfig/network-scripts/ #ls

thomasstate
Nov 23, 2023

after i config, can't ping anymore ist normal?

shaifullahdipto
Sep 23, 2024

nmcli connection modify eth0 ipv4.addresses 192.168.65.1/24 ipv4.gateway 192.168.115.1 ipv4.dns '8 8 8 8 8 8 4 4' ipv4.method static I have used the command to set my ip address and gateway. However, when i ping www.google.com, it says "Destination Host Unreachable". Would you please explain whats wrong? Why am i getting this? Thank you very much.

Pedro_Marcelo
Nov 8, 2024

01 - nmtui ; very easy guys!