This is part of the independent and unofficial RHCSA Exam Study Guide series providing free š¤ resources to prepare for the exam.
This post covers the objectives under the section:
“MANAGE BASIC NETWORKING”
It contains two main parts:
- Resources: with links to learn and practice for each objective.
- Cheatsheet: containing some examples of commands and actions performed in each objective (when applied).
š Resources:
š Introduction to Networking | Network Fundamentals Part 1
š Networking basics (2020) | What is a switch, router, gateway, subnet, gateway, firewall & DMZ
CONFIGURE IPV4 AND IPV6 ADDRESSES
š How to configure a static IP address on RHEL 8 / CentOS 8 Linux
š Configuring an IPv6 address in Red Hat Enterprise Linux 7 and 8
š Chapter 4. Using nmtui to manage network connections using a text-based interface
š Chapter 33. Using NetworkManager to disable IPv6 for a specific connection
CONFIGURE HOSTNAME RESOLUTION
CONFIGURE NETWORK SERVICES TO START AUTOMATICALLY AT BOOT
š Chapter 8. Configuring an Ethernet connection (Skip items that uses “RHEL System Roles”.)
š Chapter 26. Manually creating NetworkManager profiles in key file format
RESTRICT NETWORK ACCESS USING FIREWALL-CMD/FIREWALL
š Using firewalld
š Cheatsheet:
CONFIGURE IPV4 AND IPV6 ADDRESSES
Change IPv4 address manually editing the network script file:
ifconfigorip aā” display information of all network devices./etc/sysconfig/network-scripts/enp7s0ā” edit this file to update the connections settings.BOOTPROTO=static IPADDR=192.168.1.5 NETMASK=255.255.255.0 GATEWAY=192.168.1.1nmcli connection down enp7s0 && nmcli connection up enp7s0ā” restart the connection.
Change IPv4 address using
nmclitool:nmcli connection modify enp7s0 IPv4.address 192.168.1.5/24ā” change IP address.nmcli connection modify enp7s0 IPv4.gateway 192.168.1.1ā” change gateway address.nmcli connection modify enp7s0 IPv4.method manualā” setsBOOTPROTOoption to none.
nmcli connection modify enp7s0 ipv6.method "disabled"ā” Disable ipv6 usingnmclitool.ping -c2 alldrops.infoā” test IPv4 connection issuing two ping packets toalldrops.info.ping6 -c2 alldrops.infoā” test IPv6 connection issuing two ping packets toalldrops.info.nmtuiā” command line tool with graphical interface to manage network connections.
CONFIGURE HOSTNAME RESOLUTION
cat /etc/resolv.confā” check DNS lookup definitions.192.168.0.120 server20.example.com server20on/etc/hostsfile ā” map hostnameserver20to the ip provided.ping -c2 server20ā” test hostname resolution issuing two ping packets toserver20.dig,host,nslookup,getentā” tools to query DNS.
CONFIGURE NETWORK SERVICES TO START AUTOMATICALLY AT BOOT
Configure a Network Connection manually at
network-scriptsdir:ip addressorip aā” verify info for network interfaces./etc/sysconfig/network-scripts/ifcfg-enp7s0ā” create this file to add a new profile for the network interface (use antoher file in the folder as a starting point).ifdown enp7s0,ifup enp7s0ā” reactivate interface.
Configure a Network Connection using
nmcli(preferred way):(Requires
NetworkManagerservice)systemctl status NetworkManagerā” check if enabled and active.nmcli d s,nmcli device showā” check presence of a new interface.nmcli con add type Ethernet ifname enp7s0 con-name enp7s0 ip4 172.10.10.120/24 gw4 172.10.10.1nmcli c s,nmcli connection showā” confirm new connection status.cat /etc/sysconfig/network-scripts/ifcfg-enp7s0ip aā” confirm ip assignments for the new connection.nmcli c down enp7s0ā” deactivate connection.nmcli c up enp7s0ā” deactivate connection.
RESTRICT NETWORK ACCESS USING FIREWALL-CMD/FIREWALL
firewall-cmd --state,systemctl status firewalldā” check if the service is enabled and active.firewall-cmd --get-default-zoneā” display default zone name.firewall-cmd --get-active-zonesā” display active zones.firewall-cmd --get-zonesā” display all available zones.firewall-cmd --set-default-zone=homeā” set default zone tohome.firewall-cmd --list-allā” display information about the defualt zone.firewall-cmd --list-all --zone=homeā” display information abouthomezone.firewall-cmd --list-all-zonesā” list all zones.firewall-cmd --list-servicesā” list allowed services in the current zone.firewall-cmd --list-portsā” list allowed ports in the current zone.firewall-cmd --zone=public --list-servicesā” list allowed services for the specific zone.Permanently add a Port to a zone:
firewall-cmd --add-port 443/tcp --zone=public --permanentā” add port topubliczone.firewall-cmd --reloadā” reload to apply the changes.
Permanently add a Service to a zone:
firewall-cmd --add-service=httpd --zone=publicā” add port topubliczone.firewall-cmd --runtime-to-permanentā” make changes persist.
firewall-cmd --change-interface=enp7s0 --zone=home --permanentā” change specified interface to specified zone.
Next:
(RHCSA) Manage Users and Groups
…or back to Red Hat Certified System Administrator (RHCSA) Exam Study Guide
Useful links & references:
Enable Sysadmin (a blog from Red Hat)
Footnotes:
- Follow me on Twitter to get more posts like this and other quick tips in your feed.
- If you have any doubts or tips about this article, Iād appreciate knowing and discussing it via email.
- Do you have any other Linux tips? Would you like to publish that in this blog? Please send an email to all drops.
- As English is not my native language, I apologize for the errors. Corrections are welcome.
- Contact: contact [@] alldrops [.] info.




