Based on the Linux Master 1 exam syllabusReport an error
| OSI Layer | Examples | Devices |
|---|---|---|
| 7 Application | HTTP, FTP, DNS | - |
| 4 Transport | TCP, UDP | - |
| 3 Network | IP, ICMP | Router, L3 switch |
| 2 Data Link | MAC, Ethernet | Switch, bridge |
| 1 Physical | Cable, bits | Hub, repeater |
| CIDR | Subnet Mask | Hosts (usable) |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
TCP vs UDP: TCP is connection-oriented and reliable (3-way handshake), while UDP is connectionless and fast (DNS lookups, streaming). The same service can use both (DNS uses 53/UDP and 53/TCP).
| Service | Port | Protocol |
|---|---|---|
| FTP | 20 (data)/21 (control) | TCP |
| SSH | 22 | TCP |
| Telnet | 23 | TCP |
| SMTP | 25 | TCP |
| DNS | 53 | UDP/TCP |
| DHCP | 67/68 | UDP |
| HTTP | 80 | TCP |
| POP3 | 110 | TCP |
| NTP | 123 | UDP |
| IMAP | 143 | TCP |
| HTTPS | 443 | TCP |
| SMTPS | 465 | TCP |
| Syslog | 514 | UDP |
⚠️ FTP trap: Control is 21 and data is 20 (active mode). In passive mode, the data port changes dynamically. If the question just asks for the "FTP port," the answer is often 21.
/etc/named.conf and zone files.| Record | Meaning |
|---|---|
| A | Hostname → IPv4 |
| AAAA | Hostname → IPv6 |
| MX | Mail server (priority) |
| CNAME | Alias (alias → canonical name) |
| NS | Designates the name server |
| PTR | IP → hostname (reverse) |
| SOA | Zone authority start and refresh information |
/etc/resolv.conf (specifies name servers), /etc/hosts (local static mappings), /etc/nsswitch.conf (lookup order).Lookup tools: nslookup, dig (detailed), host (simple). Reverse lookup uses the PTR record, for IP→name conversion.
| Directive | Meaning |
|---|---|
ServerName | Server domain |
DocumentRoot | Document root path |
Listen | Listening port |
<VirtualHost> | Virtual host |
DirectoryIndex | Default document (index.html) |
| Category | Protocol | Role |
|---|---|---|
| MTA | SMTP | Mail transfer (sendmail/postfix) |
| MDA | - | Delivery to the mailbox (procmail) |
| MUA | POP3/IMAP | User reading (client) |
POP3 vs IMAP: POP3 downloads and deletes from the server (stored locally), while IMAP keeps mail on the server and synchronizes (multiple devices). IMAP is better for multiple devices.
| Mode | Connection Direction | Features |
|---|---|---|
| Active | Server→client data | Possible client firewall problems |
| Passive | Client→server data | Firewall-friendly |
| Item | Details |
|---|---|
| Port | 22 |
| Daemon | sshd |
| Configuration | /etc/ssh/sshd_config |
| Key authentication | ssh-keygen, authorized_keys |
| File transfer | scp, sftp |
⚠️ Security settings: In
sshd_config, the key points arePermitRootLogin no(block direct root login), changingPort, and recommending key authentication. Telnet (23, plaintext) should be replaced with SSH.
| Command | Role |
|---|---|
ip/ifconfig | Configure and check interfaces |
ping | Check connectivity (ICMP) |
traceroute | Trace the route |
netstat/ss | Connection and port status |
nslookup/dig | DNS lookup |
route/ip route | Routing table |
arp | MAC-IP mapping |
Status check in one line: View open ports and LISTEN state with ss -tlnp (or netstat -tlnp). You can see at a glance which process is using which port.
| Service | Port | Configuration File | Role |
|---|---|---|---|
| DHCP | 67 (server)/68 (client) | /etc/dhcp/dhcpd.conf | Automatic IP assignment |
| NTP | 123 | /etc/ntp.conf (chrony uses chrony.conf) | Time synchronization |
The 4 DHCP steps (DORA): Discover → Offer → Request → Ack. The flow in which the client finds a server by broadcast and is leased an IP.
| File | Purpose |
|---|---|
ifcfg-eth0 | Per-interface IP and gateway |
/etc/sysconfig/network | Global network settings |
/etc/hostname | Hostname |
/etc/hosts | Static name resolution |
BOOTPROTO (static/dhcp), IPADDR, NETMASK, GATEWAY, ONBOOT (activate at boot), DNS1.ONBOOT trap: With ONBOOT=no, the interface does not come up at boot. Even if you set every IP value correctly, the network won't work if ONBOOT is no — that's the trap.
| Concept | Description |
|---|---|
| Firewall | Control traffic with iptables/firewalld |
| TCP Wrapper | hosts.allow/hosts.deny access control |
| Port scan | Probing for open ports with tools like nmap (attack reconnaissance) |
| IDS/IPS | Intrusion detection/prevention systems |
Security in one line: Plaintext protocols (Telnet 23, FTP 21) send passwords as-is, so they are vulnerable to eavesdropping. The principle is to replace them with encrypted ones: SSH (22), SFTP, HTTPS (443).
| Class | Range (first octet) | Default Mask | Use |
|---|---|---|---|
| A | 1-126 | /8 | Large scale |
| B | 128-191 | /16 | Medium scale |
| C | 192-223 | /24 | Small scale |
| D | 224-239 | - | Multicast |
| E | 240-255 | - | Research/reserved |
10.0.0.0/8, Class B 172.16.0.0/12, Class C 192.168.0.0/16.| Special Address | Meaning |
|---|---|
127.0.0.1 | Loopback (itself) |
0.0.0.0 | All addresses / unspecified |
255.255.255.255 | Limited broadcast |
127 vs 126: Class A is 1-126, and 127 is excluded because it is reserved for loopback. The answer to "What is the maximum first octet of Class A?" is 126, not 127.
:: once.| Category | IPv4 | IPv6 |
|---|---|---|
| Bits | 32 | 128 |
| Notation | Dotted decimal | Colon hexadecimal |
| Address exhaustion | A problem | Practically unlimited |
| Loopback | 127.0.0.1 | ::1 |
route add/ip route add) and dynamic (RIP, OSPF, BGP).The :: rule: In IPv6, :: (abbreviation of consecutive zeros) can be used only once in an address. Using it twice makes it ambiguous how many zeros each covers, so it is invalid.
Check yourself with the mock exam below.
/24.no, the network doesn't work even if the IP is set correctly.:: abbreviation : A notation in IPv6 that omits a run of consecutive zero groups. It can be used only once in an address.Click a choice to reveal the answer and explanation.
Question 1
Among the 7 OSI layers, which layer is where routers operate and the IP and ICMP protocols belong?
Question 2
Which service separates the control connection and the data connection and uses port 21 as the control port?
Question 3
Which DNS record is used for reverse lookup, converting an IP address to a hostname?
Question 4
Which protocol and port does a mail server's role of transferring mail to another server (MTA) use?
Question 5
Which receiving protocol is suited to synchronizing and using the same mailbox from multiple devices?
Question 6
In a /24 subnet (255.255.255.0), how many IPs can actually be assigned to hosts?
Question 7
Which setting in /etc/ssh/sshd_config blocks direct root login for SSH server security?
Question 8
Which configuration file specifies the name servers a DNS client queries?
Question 9
Which is an appropriate command to check the ports in the LISTEN state on the current system and their processes?
Question 10
Which directive in the Apache (httpd) configuration specifies the top-level directory path of web documents?