Unit 3: Networking, Packages, File Systems, and Virtualization - Subjective Questions
CSE493 — Linux System Administration • Practice Questions with Detailed Answers
20 questions
Define the essential networking concepts used in Red Hat Enterprise Linux. Explain the roles of IP addresses, subnet masks, default gateways, DNS servers, and network interfaces.
Essential networking concepts:
- IP address: A logical address that uniquely identifies a host or network interface. IPv4 uses 32-bit addresses such as
192.168.1.10, while IPv6 uses 128-bit addresses. - Subnet mask or prefix: Identifies the network and host portions of an IP address. For example,
/24corresponds to255.255.255.0in IPv4. - Default gateway: The router to which packets are sent when their destination is outside the local network.
- DNS server: Converts host names such as
server.example.cominto IP addresses and may also perform reverse resolution. - Network interface: A physical or virtual connection to a network, identified by names such as
enp1s0orens33.
Together, these settings allow a RHEL system to communicate locally, reach remote networks, and resolve host names.
Describe how to validate the network configuration and troubleshoot connectivity on a Red Hat Enterprise Linux system.
Network validation should proceed from the local system toward the remote destination:
- Use
ip linkto verify that the network interface exists and is UP. - Use
ip address showto confirm that the expected IP address and prefix are assigned. - Use
ip routeto inspect connected routes and the default gateway. - Use
ping -c 4 127.0.0.1to test the local TCP/IP stack. - Ping the system's own IP address, followed by the default gateway.
- Ping a remote IP address to test routing without depending on DNS.
- Use
getent hosts hostnameorhost hostnameto validate name resolution. - Use
ss -tulnto check listening TCP and UDP services. - Inspect NetworkManager with
nmcli device statusandnmcli connection show. - Review logs with
journalctl -u NetworkManagerwhen configuration errors are suspected.
This sequence helps distinguish interface, addressing, routing, DNS, and service-level problems.
Explain how nmcli can be used to create and activate a static IPv4 network connection in RHEL. Include suitable commands.
nmcli is the command-line interface for NetworkManager. A static connection can be created as follows:
- Identify interfaces using
nmcli device status. - Create a connection:
nmcli connection add type ethernet ifname enp1s0 con-name static-enp1s0 ipv4.method manual ipv4.addresses 192.168.10.20/24 ipv4.gateway 192.168.10.1 ipv4.dns 192.168.10.1 - Enable automatic connection at boot:
nmcli connection modify static-enp1s0 connection.autoconnect yes - Activate it:
nmcli connection up static-enp1s0 - Verify it:
nmcli connection show static-enp1s0
andip address show enp1s0.
Multiple DNS servers may be supplied as a comma-separated list. Configuration errors should be corrected with nmcli connection modify before reactivating the connection.
Compare DHCP-based and static network configurations. How can an existing NetworkManager connection be changed between these modes using nmcli?
DHCP configuration:
- Receives an IP address, prefix, gateway, and usually DNS settings automatically.
- Is convenient for clients and systems whose addresses do not need to remain fixed.
- Uses the NetworkManager IPv4 method
auto.
Static configuration:
- Uses administrator-defined addressing information.
- Is appropriate for servers, routers, and services that require predictable addresses.
- Uses the IPv4 method
manual.
To use DHCP:
nmcli connection modify CONNECTION ipv4.method auto ipv4.addresses "" ipv4.gateway "" ipv4.dns ""
To use static addressing:
nmcli connection modify CONNECTION ipv4.method manual ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.1
Apply the changes with nmcli connection up CONNECTION. Remote administrators should take care because incorrect changes can terminate their connection.
Describe the purpose and structure of NetworkManager connection files in RHEL. What precautions should be taken when editing them manually?
Persistent NetworkManager profiles are commonly stored under /etc/NetworkManager/system-connections/ as keyfiles. A profile contains sections such as:
[connection]for the connection name, UUID, type, and interface.[ethernet]for Ethernet-specific options.[ipv4]and[ipv6]for addressing methods, addresses, gateways, and DNS settings.
When editing a profile manually:
- Preserve the file's valid keyfile syntax.
- Ensure that the connection UUID and interface assignment are correct.
- Protect credentials and other settings by using restrictive permissions, normally
root:rootownership and mode600. - Reload profiles with
nmcli connection reload. - Activate the changed profile with
nmcli connection up CONNECTION. - Validate the result using
nmcli,ip address, andip route.
Using nmcli is generally preferred because it validates many properties and reduces syntax errors.
Explain how host names and name resolution are configured and verified on a RHEL system.
Host name configuration:
- Display the current settings with
hostnamectl. - Set a persistent static host name with
hostnamectl set-hostname server1.example.com. - The configured static host name is recorded in
/etc/hostname.
Name resolution:
/etc/hostsprovides local static mappings, for example192.168.1.20 server1.example.com server1./etc/resolv.confcontains resolver settings such as DNS server addresses and search domains. On NetworkManager systems, this file is usually generated from active connection profiles./etc/nsswitch.confdetermines the lookup order through thehosts:entry, commonly consulting local files and DNS.
Resolution can be tested with getent hosts server1.example.com, host server1.example.com, or dig server1.example.com. getent is particularly useful because it follows the Name Service Switch configuration used by applications.
Explain how to create, list, extract, and update archives using the tar command.
tar combines multiple files and directories into one archive while preserving directory structure and metadata.
- Create an archive:
tar -cf backup.tar /etc - List its contents:
tar -tf backup.tar - Extract it:
tar -xf backup.tar - Extract into another directory:
tar -xf backup.tar -C /restore - Add a file to an uncompressed archive:
tar -rf backup.tar newfile
Common options include:
-c: create an archive.-t: list archive contents.-x: extract files.-f: specify the archive file.-v: display processed files.-C: change directory before performing the operation.
Absolute paths are normally stored without the leading /, reducing the risk of unexpectedly overwriting absolute locations during extraction.
Compare gzip, bzip2, and xz compression for tar archives. Give commands to create and extract each archive type.
gzip: Fast compression and decompression with a moderate compression ratio.
- Create:
tar -czf backup.tar.gz data/ - Extract:
tar -xzf backup.tar.gz
bzip2: Usually compresses more effectively than gzip but is slower.
- Create:
tar -cjf backup.tar.bz2 data/ - Extract:
tar -xjf backup.tar.bz2
xz: Often provides the highest compression ratio but may require more CPU time and memory.
- Create:
tar -cJf backup.tar.xz data/ - Extract:
tar -xJf backup.tar.xz
The options -z, -j, and -J select gzip, bzip2, and xz respectively. The appropriate format depends on whether transfer size, processing time, memory usage, or compatibility is the main concern.
Describe how files and directories can be copied securely between Linux systems using scp and sftp.
Both scp and sftp use the SSH protocol, providing encrypted authentication and data transfer.
Using scp:
- Copy a local file to a remote system:
scp report.txt user@server:/home/user/ - Copy a remote file locally:
scp user@server:/var/tmp/data.txt . - Copy a directory recursively:
scp -r project/ user@server:/srv/ - Specify a nonstandard SSH port:
scp -P 2222 file user@server:/tmp/
Using sftp:
- Start a session with
sftp user@server. - Use
put fileto upload andget fileto download. - Use
ls,cd,lcd,mkdir, andpwdto navigate and manage paths.
SSH keys can provide secure, noninteractive authentication. Users must have appropriate permissions on both the source and destination paths.
Explain how rsync synchronizes files securely between systems. Why is it often preferred for repeated transfers?
rsync synchronizes files and directory trees locally or across a network. When used with SSH, the connection is encrypted.
Example:
rsync -avz -e ssh /srv/data/ user@server:/backup/data/
Important options include:
-a: archive mode, preserving recursion, permissions, ownership, timestamps, and links where permitted.-v: verbose output.-z: compress transferred data.-e ssh: use SSH as the remote transport.--delete: remove destination files that no longer exist at the source; this must be used carefully.--dry-run: preview changes without modifying files.
rsync is preferred for repeated transfers because it usually sends only changed files or changed portions of files. The trailing slash is significant: /source/ copies the source directory's contents, while /source normally creates or updates a source directory at the destination.
Explain the relationship between RPM software packages and the yum package manager in RHEL.
RPM is the underlying package format and low-level package management system used by RHEL. An RPM package contains software files, metadata, dependencies, scripts, version information, and digital signatures.
Yum is a higher-level package manager that works with RPM packages and enabled repositories. It:
- Resolves and installs dependencies automatically.
- Downloads packages from configured repositories.
- Installs, upgrades, removes, and queries software.
- Maintains package transaction history.
- Verifies package signatures when configured correctly.
Commands such as rpm -q package query the local RPM database, while yum install package obtains the package and its dependencies from repositories. Modern RHEL versions may implement yum through DNF, while preserving familiar yum command behavior.
Describe how to install, update, remove, search for, and obtain information about software packages using yum.
Common yum operations include:
- Install a package:
yum install httpd - Update one package:
yum update httpd - Update all installed packages:
yum update - Remove a package:
yum remove httpd - Search names and descriptions:
yum search web server - Display package information:
yum info httpd - List installed packages:
yum list installed - Identify the package that supplies a file or command:
yum provides '*/semanage' - Display transaction history:
yum history
Yum calculates dependencies, presents a transaction summary, downloads packages, verifies signatures, and updates the RPM database. Administrators should review the proposed changes before confirming significant installations or updates.
What is a yum repository? Explain how repositories can be enabled, disabled, configured, and verified.
A yum repository is a collection of RPM packages and metadata available through a local path or a network service such as HTTP or HTTPS.
Repositories can be managed as follows:
- List repositories:
yum repolist all. - Enable a repository for one command:
yum --enablerepo=repo-id install package. - Disable a repository for one command:
yum --disablerepo=repo-id update. - Enable persistently:
yum config-manager --enable repo-id. - Disable persistently:
yum config-manager --disable repo-id. - Add a repository:
yum config-manager --add-repo URL.
Repository definitions are commonly stored in /etc/yum.repos.d/*.repo. Important properties include name, baseurl, enabled, gpgcheck, and gpgkey. Administrators should use trusted sources, enable GPG verification, import the correct signing key, and verify accessibility with yum repolist or yum makecache.
Explain how an RPM package file can be examined before installation. Include commands for metadata, contents, dependencies, scripts, and signature verification.
An uninstalled RPM file can be examined by combining query mode with the -p option:
- Display package information:
rpm -qip package.rpm - List contained files:
rpm -qlp package.rpm - List configuration files:
rpm -qcp package.rpm - List documentation files:
rpm -qdp package.rpm - Show requirements:
rpm -qRp package.rpm - Show capabilities provided:
rpm -q --provides -p package.rpm - Display installation and removal scripts:
rpm -q --scripts -p package.rpm - Verify the signature and digest:
rpm -K package.rpm
These checks reveal what the package installs, what it requires, whether it executes administrative scripts, and whether it was signed by a trusted source. yum install ./package.rpm is generally preferable to direct installation with rpm -i because yum can resolve dependencies.
Describe how a RHEL system is attached to a Red Hat subscription so that it can receive official software updates.
A RHEL system uses subscription services to gain authorized access to Red Hat repositories.
Typical steps are:
- Register the system with
subscription-manager registerand provide valid organization credentials or an activation key. - Check status using
subscription-manager statusandsubscription-manager identity. - View available subscriptions with
subscription-manager list --available. - Attach an appropriate entitlement where required, for example
subscription-manager attach --pool=POOL_ID. - List repositories with
subscription-manager repos --list. - Enable a required repository using
subscription-manager repos --enable=REPOSITORY_ID. - Verify access with
yum repolistand install updates withyum update.
The exact attachment behavior depends on the Red Hat subscription model and organization settings. Before transferring or retiring a system, it can be unregistered with subscription-manager unregister.
Explain how Linux identifies storage devices, partitions, file systems, labels, and UUIDs. Give commands used to inspect them.
Linux exposes storage devices as files under /dev. Examples include /dev/sda, /dev/vda, and /dev/nvme0n1, while partitions may appear as /dev/sda1 or /dev/nvme0n1p1.
Useful identification commands include:
lsblk: Displays block devices, partitions, mount points, and relationships.lsblk -f: Adds file-system types, labels, and UUIDs.blkid: Reports file-system metadata such asTYPE,LABEL, andUUID.df -hT: Shows mounted file systems, types, and space usage.findmnt: Displays the current mount hierarchy and mount sources.
A file-system label is a human-readable identifier, while a UUID is designed to be unique. Persistent mount configurations commonly use UUID= or LABEL= rather than device names because names such as /dev/sdb1 may change when device detection order changes.
Describe how to mount and unmount a file system temporarily and how to configure it for automatic mounting at boot.
To mount a file system temporarily:
- Identify it with
lsblk -forblkid. - Create a mount point, for example
mkdir -p /data. - Mount it using
mount /dev/sdb1 /dataormount UUID=uuid-value /data. - Verify it with
findmnt /dataordf -hT /data.
To unmount it, use umount /data. If the target is busy, commands such as lsof +D /data or fuser -vm /data can identify processes using it.
For automatic mounting, add an entry to /etc/fstab, such as:
UUID=uuid-value /data xfs defaults 0 0
The six fields specify the source, mount point, file-system type, options, dump setting, and file-system check order. After editing, test the entry with mount -a and verify it with findmnt; this helps detect errors before rebooting.
Distinguish between hard links and symbolic links in Linux. Explain their behavior, limitations, and creation commands.
Hard links:
- Are additional directory entries referring to the same inode and file data.
- Are created with
ln original hardlink. - Usually cannot refer to directories.
- Cannot cross file-system boundaries.
- Continue to provide access to the data if another link name is deleted.
Symbolic links:
- Are separate special files containing a path to another file or directory.
- Are created with
ln -s target symlink. - Can refer to directories and can cross file-system boundaries.
- Can use absolute or relative target paths.
- Become dangling links if the recorded target path no longer exists.
ls -li can display inode numbers, making it possible to confirm that hard-linked names share an inode. readlink linkname displays the path stored in a symbolic link.
Compare the find, locate, which, and whereis commands for locating files and commands on a Linux system.
find: Searches the live directory hierarchy and supports conditions and actions. Examples include find /var -type f -name '*.log', find /home -user student, and find /tmp -mtime +7 -delete. Permissions may restrict the results.
locate: Searches a prebuilt file-name database and is usually faster than find. Because the database is updated periodically, very recent changes may not appear. The database can be refreshed with updatedb when the relevant package and privileges are available.
which: Searches directories in the current PATH for an executable command, for example which python3.
whereis: Locates a command's binary, source, and manual-page files in standard locations, for example whereis passwd.
Thus, find is best for accurate property-based searches, locate for fast name searches, and which or whereis for command-related files.
Explain how a local RHEL virtualization host is prepared and how a new virtual machine is installed and managed using KVM and libvirt tools.
RHEL virtualization commonly uses KVM for hardware-assisted virtualization, QEMU for machine emulation, and libvirt for management.
A typical procedure is:
- Confirm that the processor and firmware support virtualization.
- Install the required virtualization packages, such as the appropriate virtualization package group and tools including
libvirtandvirt-install. - Enable and start the required libvirt service or socket units.
- Verify the host with commands such as
virsh list --alland, where available,virt-host-validate. - Prepare installation media, storage, and a libvirt virtual network or bridge.
- Create a guest with
virt-install, specifying its name, memory, virtual CPUs, disk, network, installation source, and operating-system information. - Complete the operating-system installation through a console or graphical viewer.
Virtual machines can then be managed with virsh start NAME, virsh shutdown NAME, virsh reboot NAME, virsh console NAME, and virsh undefine NAME. Administrators must also plan CPU, memory, storage, networking, security, and guest update requirements.
Define the essential networking concepts used in Red Hat Enterprise Linux. Explain the roles of IP addresses, subnet masks, default gateways, DNS servers, and network interfaces.
Essential networking concepts:
- IP address: A logical address that uniquely identifies a host or network interface. IPv4 uses 32-bit addresses such as
192.168.1.10, while IPv6 uses 128-bit addresses. - Subnet mask or prefix: Identifies the network and host portions of an IP address. For example,
/24corresponds to255.255.255.0in IPv4. - Default gateway: The router to which packets are sent when their destination is outside the local network.
- DNS server: Converts host names such as
server.example.cominto IP addresses and may also perform reverse resolution. - Network interface: A physical or virtual connection to a network, identified by names such as
enp1s0orens33.
Together, these settings allow a RHEL system to communicate locally, reach remote networks, and resolve host names.
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 →