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:
ifconfig
orip 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.1
nmcli connection down enp7s0 && nmcli connection up enp7s0
ā” restart the connection.
Change IPv4 address using
nmcli
tool: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
ā” setsBOOTPROTO
option to none.
nmcli connection modify enp7s0 ipv6.method "disabled"
ā” Disable ipv6 usingnmcli
tool.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 server20
on/etc/hosts
file ā” map hostnameserver20
to 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-scripts
dir:ip address
orip 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
NetworkManager
service)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.1
nmcli c s
,nmcli connection show
ā” confirm new connection status.cat /etc/sysconfig/network-scripts/ifcfg-enp7s0
ip 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 abouthome
zone.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 topublic
zone.firewall-cmd --reload
ā” reload to apply the changes.
Permanently add a Service to a zone:
firewall-cmd --add-service=httpd --zone=public
ā” add port topublic
zone.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.