Unit 3: Networking, Packages, File Systems, and Virtualization
I. System Administration Foundations
Linux system administration coordinates network connectivity, software, storage, and computing resources. Red Hat Enterprise Linux (RHEL) provides command-line tools, configuration files, services, and package repositories for managing these resources consistently.
- Privilege model: Administrative operations normally require
rootprivileges, commonly obtained throughsudo. - Persistent configuration: Changes must survive reboot; persistent settings differ from temporary runtime changes.
- Service management:
systemctlcontrols systemd units, whilejournalctlexamines their logs. - Verification principle: Configuration should be checked with status commands and operational tests rather than assumed to work.
- Security principle: Administrators should use authenticated repositories, encrypted transfers, least privilege, and controlled network exposure.
- Resource model: Linux exposes devices, partitions, file systems, network interfaces, packages, and virtual machines through standard management interfaces.
II. Network Administration — Connectivity and Name Resolution
A. Managing Red Hat Enterprise Linux Networking
RHEL networking is primarily managed by NetworkManager, which stores connection profiles and applies them to network interfaces.
- Core service: Check NetworkManager with
systemctl status NetworkManager. - Interface versus connection: An interface such as
enp1s0is hardware; a connection profile contains settings applied to it. - Configuration scope: Profiles can define addresses, routes, DNS servers, gateways, and automatic connection behavior.
B. Networking Concepts
Network communication depends on addressing, routing, naming, and transport protocols.
- IP address: Identifies an interface;
192.168.10.20/24has a 24-bit network prefix. - Gateway: Routes packets to destinations outside the local subnet.
- DNS: Converts a name such as
server.example.cominto an IP address. - Ports: Identify services; SSH normally uses TCP port
22, while HTTPS uses TCP port443. - IPv4 and IPv6: IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses such as
2001:db8::10.
C. Validating Network Configuration
Validation confirms that interfaces, routes, DNS, and remote services operate as intended.
- Addresses:
ip address showdisplays assigned addresses and interface state. - Routes:
ip routeshows the routing table, including the default gateway. - NetworkManager state:
nmcli device statusreports connected and disconnected devices. - Connectivity tests:
ping -c 4 192.168.10.1tests IP reachability;getent hosts example.comtests name resolution. - Listening services:
ss -tulnlists TCP and UDP listening sockets.
D. Configuring Networking with nmcli
The nmcli utility creates, modifies, activates, and inspects NetworkManager profiles.
- Display profiles: Use
nmcli connection show. - Create a static profile:
nmcli connection add con-name office ifname enp1s0 type ethernet \
ipv4.method manual ipv4.addresses 192.168.10.20/24 \
ipv4.gateway 192.168.10.1 ipv4.dns 192.168.10.53
nmcli connection up office- Modify settings:
nmcli connection modify office connection.autoconnect yes. - DHCP configuration: Set
ipv4.method autoinstead ofmanual.
E. Editing Network Configuration Files
Network configuration files provide persistent profile definitions when direct file management is necessary.
- Keyfile location: Current RHEL releases store NetworkManager profiles under
/etc/NetworkManager/system-connections/. - Protection: Keyfiles may contain secrets and generally require permissions such as mode
600. - Reloading: After editing, run
nmcli connection reload, then reactivate the profile. - Legacy format: Older RHEL systems may use
ifcfg-*files under/etc/sysconfig/network-scripts/.
F. Configuring Host Names and Name Resolution
Host names identify systems, while resolver configuration maps names to addresses.
- Static hostname: Set it with
hostnamectl set-hostname server1.example.com. - Verification:
hostnamectldisplays static, transient, and pretty host names. - Local mappings:
/etc/hostscontains entries such as192.168.10.20 server1.example.com server1. - DNS settings: NetworkManager normally generates
/etc/resolv.conffrom active profile settings. - Resolution check:
getent hosts server1.example.comfollows the system resolver configuration.
III. Archives and Remote File Transfer — Portable and Secure Data Movement
A. Archiving and Copying Files Between Systems
Archiving combines directory trees into one file, simplifying storage and transfer while preserving metadata.
- Archive creation:
tar -cf backup.tar /etccreates an uncompressed archive. - Inspection:
tar -tf backup.tarlists members without extracting them. - Extraction:
tar -xf backup.tar -C /restoreextracts into/restore. - Preservation:
tarrecords directory structure, permissions, ownership, and timestamps, subject to extraction privileges.
B. Managing Compressed tar Archives
Compression reduces archive size by passing tar data through a compression algorithm.
- gzip:
tar -czf backup.tar.gz /etcuses gzip and thezoption. - bzip2:
tar -cjf backup.tar.bz2 /etcuses bzip2 andj. - xz:
tar -cJf backup.tar.xz /etcuses xz andJ. - Extraction:
tar -xzf backup.tar.gzextracts a gzip-compressed archive. - Trade-off: Stronger compression can reduce storage requirements but consume more CPU time.
C. Copying Files Between Systems Securely
scp and sftp transfer files through authenticated, encrypted SSH connections.
- Upload:
scp report.txt admin@server:/srv/reports/. - Download:
scp admin@server:/var/log/messages .. - Directories:
scp -r project/ admin@server:/srv/copies recursively. - Authentication: SSH keys are preferable to repeated password entry and can be managed with
ssh-keygenandssh-copy-id.
D. Synchronizing Files Between Systems Securely
rsync efficiently synchronizes only changed data and can operate over SSH.
- Archive mode:
rsync -arecursively preserves common metadata. - Remote synchronization:
rsync -av /data/ admin@server:/backup/data/. - Deletion behavior:
--deleteremoves destination files absent from the source and therefore requires care. - Path semantics: A trailing slash in
/data/copies its contents;/datacopies the directory itself.
IV. Software Package Management — Installation, Repositories, and Updates
A. Installing and Updating Software Packages
RHEL distributes software as RPM packages containing files, metadata, dependencies, and installation scripts.
- Installation:
yum install httpdresolves dependencies and installs the package. - Removal:
yum remove httpdremoves the package and evaluates dependencies. - Package search:
yum search webserversearches available metadata. - Information:
yum info httpddisplays version, repository, architecture, and description.
B. Managing Software Updates with yum
yum compares installed packages with enabled repository metadata and performs dependency-aware updates.
- Check availability:
yum check-updatereports packages with newer versions. - Update system:
yum updatedownloads and installs applicable updates. - Single package:
yum update openssllimits the transaction. - History:
yum historyrecords transactions and package changes. - Modern implementation: On RHEL 8 and later,
yumis based on DNF technology.
C. Enabling yum Software Repositories
Repositories provide signed RPM packages and metadata through configured software sources.
- List repositories:
yum repolist --alldisplays enabled and disabled sources. - Temporary enablement:
yum --enablerepo=repo-id install package. - Configuration: Repository definitions use
.repofiles under/etc/yum.repos.d/. - Trust:
gpgcheck=1requires RPM signature verification using an imported trusted key.
D. Examining RPM Package Files
RPM tools inspect package files and the database of installed packages.
- Installed query:
rpm -q bashreports the installed package version. - Package details:
rpm -qi bashdisplays metadata. - Owned files:
rpm -ql bashlists files installed by the package. - File ownership:
rpm -qf /usr/bin/bashidentifies the owning package. - Uninstalled file:
rpm -qpi package.rpminspects an RPM file without installing it.
E. Attaching Systems to Subscriptions for Software Updates
RHEL systems use subscription services to establish entitlement and repository access.
- Registration:
subscription-manager registerassociates the host with a Red Hat account or activation key. - Status:
subscription-manager statusreports registration and content-access state. - Repositories:
subscription-manager repos --list-enabledshows enabled Red Hat repositories. - Removal:
subscription-manager unregisterdisassociates the system when appropriate.
F. RPM Software Packages and Yum
RPM and yum serve related but distinct package-management roles.
- RPM layer:
rpminstalls or queries individual package files and maintains the local package database. - Yum layer:
yumuses repositories, downloads packages, verifies signatures, and resolves dependencies.
- Practical rule: Prefer
yum install ./package.rpmoverrpm -i package.rpmwhen dependencies may be required.
V. Linux File Systems — Devices, Mounts, Links, and Search
A. Accessing Linux File Systems
Linux presents mounted file systems through one directory hierarchy rooted at /.
- Mount points: Separate devices can appear at directories such as
/home,/boot, or/mnt/data. - Path types:
/var/log/messagesis absolute;docs/report.txtis relative to the current directory. - Usage:
df -hreports mounted file-system capacity;du -sh /var/logmeasures directory contents.
B. Identifying File Systems and Devices
Device and file-system identification prevents mounting or modifying the wrong storage.
- Block inventory:
lsblk -fdisplays devices, partitions, file-system types, labels, UUIDs, and mount points. - Persistent identity: UUIDs remain more reliable than names such as
/dev/sdb1, which can change. - Detection:
blkidreads file-system metadata. - Common types: RHEL commonly uses XFS, while ext4 remains widely supported.
C. Mounting and Unmounting File Systems
Mounting attaches a file system to the directory tree; unmounting detaches it safely.
- Temporary mount:
mount /dev/sdb1 /mnt/data. - Unmount:
umount /mnt/datarequires that no process is using the mount. - Persistent mount:
/etc/fstabrecords device, mount point, type, options, dump value, and check order. - Validation: After editing
fstab, usemount -aand inspect errors before rebooting.
D. Making Links Between Files
Links provide additional names or references to file-system objects.
- Hard link:
ln source.txt copy.txtcreates another directory entry for the same inode and cannot normally cross file systems. - Symbolic link:
ln -s /srv/data currentstores a path and can cross file-system boundaries.
- Removal behavior: Deleting one hard link does not remove data while another remains; a symbolic link can become broken.
E. Locating Files on the System
Linux offers indexed and real-time tools for locating files and commands.
- Real-time search:
find /var -type f -name "*.log"traverses/var. - Criteria:
findcan filter by owner, permissions, size, type, or modification time. - Indexed search:
locate passwdsearches a database that may requireupdatedb. - Command lookup:
which sshsearchesPATH;type cdalso identifies shell built-ins.
VI. Virtualization — Hosting and Deploying Virtual Machines
A. Using Virtualized Systems
Virtualization runs isolated guest operating systems on virtual hardware managed by a hypervisor.
- RHEL stack: KVM provides kernel virtualization, QEMU supplies device emulation, and libvirt provides management interfaces.
- Guest resources: Each virtual machine receives virtual CPUs, memory, disks, and network adapters.
- Requirements: Hardware-assisted virtualization normally uses Intel VT-x or AMD-V support.
- Benefits: Isolation, consolidation, snapshots, and reproducible deployment improve infrastructure flexibility.
B. Managing a Local Virtualization Host
Libvirt tools control virtual machines, storage pools, and virtual networks on a host.
- Service interface:
virsh list --alldisplays defined guests. - Lifecycle:
virsh start vm1,virsh shutdown vm1, andvirsh reboot vm1manage guest state. - Automatic startup:
virsh autostart vm1starts the guest when the host boots. - Graphical management: Virtual Machine Manager provides a desktop interface where available.
C. Installing a New Virtual Machine
A new virtual machine requires a guest definition, allocated resources, storage, networking, and installation media.
- Preparation: Select CPU count, RAM, disk capacity, virtual network, and an installation ISO or network source.
- Command installation:
virt-install --name rhel-vm --memory 4096 --vcpus 2 \
--disk size=30 --network network=default \
--cdrom /var/lib/libvirt/images/rhel.iso- Persistent definition: Libvirt stores the guest configuration so it can be stopped and restarted later.
- Post-installation: Apply updates, configure networking, install guest tools, and verify host-to-guest connectivity.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →