Chapter 4 Lecture Notes
Chapter 4 Lecture Notes
Chapter 4
Network Management
4.1 TCP/IP Networking
1. IP Addressing:
o IP Address: Every device on a network is identified by an IP address. This
address comes in two versions: IPv4 (32-bit) and IPv6 (128-bit).
IPv4: Format is xxx.xxx.xxx.xxx, where each segment is a number
between 0 and 255.
IPv6: Format is xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx,
designed to provide a much larger address space.
o Subnetting: Divides an IP address into two parts: the network part and the host
part. Subnetting allows efficient use of IP addresses and helps reduce congestion
in large networks.
o Public vs Private IPs: Public IPs are unique and accessible globally, while
private IPs are used within private networks (e.g., home or corporate LANs).
2. Routing and Switching:
o Routing: The process of forwarding data packets between networks using routers.
A router uses routing tables to determine the best path for data.
o Switching: Involves forwarding data within a single network based on MAC
addresses. Switches operate at Layer 2 (Data Link Layer) and are used in local
area networks (LANs).
3. Protocol Layers: The TCP/IP model is structured in layers:
o Application Layer: Responsible for application protocols such as HTTP, FTP,
SMTP.
o Transport Layer: Includes protocols like TCP and UDP (User Datagram
Protocol). TCP ensures reliable data delivery, while UDP is used for faster but
less reliable communications.
o Internet Layer: Handles IP addressing and routing using protocols like
IPv4/IPv6.
o Link Layer: Defines how data is transmitted over physical links, including
Ethernet and Wi-Fi.
4. TCP vs UDP:
1|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
Network Troubleshooting: Tools like ping, traceroute, netstat, and nslookup are
essential for diagnosing network issues such as connectivity problems, slow response
times, or incorrect routing.
Security Implications: Understanding TCP/IP also involves recognizing vulnerabilities
such as DDoS attacks, IP spoofing, and man-in-the-middle attacks. Implementing
firewalls, encryption, and VPNs (Virtual Private Networks) can help mitigate these risks.
Linux-based systems are often used in networking environments due to their flexibility,
robustness, and open-source nature. Configuring a Linux system for networking involves setting
up network interfaces, managing IP addressing, and ensuring secure communication between the
system and other networked devices.
2|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
Netstat: A utility to view network connections, routing tables, and interface statistics.
Wireshark: A network protocol analyzer useful for inspecting network traffic and
diagnosing issues.
ss: A utility that replaces netstat for viewing socket statistics in a more efficient
manner.
A Linux box can be configured to function as a router, which is a device that forwards data
packets between different networks. Setting up a Linux-based router enables the device to share
internet connectivity, route packets between subnets, and provide network services such as
DHCP or NAT (Network Address Translation).
1. Enabling IP Forwarding:
o By default, Linux systems do not forward packets between network interfaces. To
enable IP forwarding, modify the /etc/sysctl.conf file and set the
net.ipv4.ip_forward parameter to 1:
3|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
net.ipv4.ip_forward = 1
This rule masquerades (i.e., hides) the internal IP addresses and replaces them
with the external interface’s IP address when forwarding packets.
VPN Support: A Linux router can also support VPN services, allowing remote users to
securely connect to the network via technologies such as OpenVPN or IPsec.
Quality of Service (QoS): Linux routers can implement QoS to prioritize traffic,
ensuring that critical services like VoIP or video conferencing get bandwidth priority
over less time-sensitive applications.
4|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
Apache HTTP Server, commonly referred to as Apache, is one of the most widely used web
servers globally. Apache is open-source software that provides robust, scalable, and secure web
hosting capabilities. It is highly configurable, with support for a wide range of modules,
including security, authentication, and URL rewriting.
1. Installation of Apache:
o Debian/Ubuntu-based Systems: Use the apt package manager:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/example
ServerName www.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
5|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
6. Security Considerations:
o Disable unused modules to reduce the attack surface.
o Configure mod_security and mod_evasive to protect against web-based attacks,
including SQL injection and DoS (Denial of Service) attacks.
o Consider configuring SSL/TLS for encrypted communication:
Generate SSL certificates or obtain them from a certificate authority (CA).
Enable SSL by editing the default SSL configuration file
(/etc/apache2/sites-available/default-ssl.conf) and ensuring it
points to the correct certificate and key files.
7. Testing the Web Server:
o Use the systemctl status apache2 or systemctl status httpd to verify the
Apache service is running.
o Test the web server’s functionality by accessing http://localhost or
http://<server-ip> from a browser. If configured correctly, the default Apache
page or your website’s content should be displayed.
BIND (Berkeley Internet Name Domain) is the most popular open-source DNS server software.
It is used to resolve domain names into IP addresses, allowing users to access websites using
human-readable domain names rather than numerical IP addresses. Configuring BIND as a DNS
6|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
server is essential for maintaining a domain name system locally or for providing authoritative
DNS services.
1. Installation of BIND:
o Debian/Ubuntu-based Systems: Use the apt package manager:
2. Configuration of BIND:
o The main configuration file for BIND is /etc/bind/named.conf
(Debian/Ubuntu) or /etc/named.conf (Red Hat/CentOS). This file includes
other configuration files for zones and DNS settings.
o Zone Files: DNS zone files define the mappings between domain names and IP
addresses. Zone files are typically stored in /etc/bind/ or /var/named/.
3. Setting Up a Simple Zone:
o A zone file contains mappings for domain names and corresponding resource
records (RRs), such as A, MX, NS, and CNAME records.
o Example of a basic zone file (db.example.com):
$TTL 86400
@ IN SOA ns1.example.com. admin.example.com. (
2022032501 ; Serial
3600 ; Refresh
1800 ; Retry
1209600 ; Expire
86400 ) ; Minimum TTL
IN NS ns1.example.com.
IN A 192.168.1.10
www IN A 192.168.1.11
mail IN A 192.168.1.12
@ IN MX 10 mail.example.com.
7|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
options {
allow-query { any; };
allow-transfer { none; };
};
6. Securing BIND:
o Implement DNSSEC (DNS Security Extensions) to secure DNS responses from
manipulation.
o Restrict zone transfers and recursion to trusted clients to prevent unauthorized
access to zone data.
Postfix is a widely used open-source Mail Transfer Agent (MTA) that routes and delivers email
on a network. It is known for its simplicity, performance, and security. Configuring Postfix
allows a Linux server to send, receive, and relay email.
1. Installation of Postfix:
o Debian/Ubuntu-based Systems:
When prompted, select Internet Site as the mail server configuration type, and
enter the mail domain name.
Example:
myhostname = mail.example.com
mydomain = example.com
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
inet_interfaces = all
6. Securing Postfix:
o TLS Encryption: Enable encryption for email transmission using SSL/TLS by
configuring smtpd_use_tls and smtp_tls_security_level in main.cf.
o Authentication: Set up SMTP authentication to prevent unauthorized users from
relaying emails through your server.
Squid is a widely used proxy cache server that improves network performance by caching
frequently requested web content. It serves as an intermediary between client devices and the
internet, storing copies of requested resources like HTML files, images, and videos. When
9|Page
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
another client requests the same content, Squid serves the cached content, reducing bandwidth
usage and speeding up web page load times.
1. Installation of Squid:
o Debian/Ubuntu-based Systems:
4. Caching Configuration:
10 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
o Squid caches web content to reduce bandwidth usage and speed up browsing. The
maximum_object_size directive can be used to control the size of objects that
will be cached:
maximum_object_size 128 MB
o You can also configure the refresh_pattern to determine how often cached
content is refreshed.
5. Enabling Authentication (Optional):
o Squid supports authentication for access control, ensuring only authorized users
can use the proxy. To enable basic authentication, configure Squid to use a
password file (using the htpasswd utility) and add the following:
o Test the proxy configuration by configuring a web browser or client device to use
the Squid server’s IP address and port as its HTTP proxy. Ensure that caching and
access control are functioning as expected.
This section covers the configuration of IP Networking in Linux, focusing on how network
interfaces are managed, and how IP addressing, routing, and other network settings are
configured on a Linux-based system. Proper IP network configuration is essential for enabling
communication between devices, managing subnets, and ensuring optimal network performance.
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
addresses:
- 192.168.1.100/24
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
ping 192.168.1.1
traceroute example.com
netstat -tuln
5. Firewall Configuration:
o Linux uses iptables or nftables to manage network traffic and enforce firewall
rules. Rules can be configured to control the flow of data based on IP addresses,
ports, and protocols.
o Basic iptables rule to allow SSH:
Or using ip:
sudo ip link set eth0 up
sudo ip link set eth0 down
Network services are essential functionalities that run over a network, providing core services
such as DHCP, DNS, email, and more. These services are crucial for the seamless operation of a
network.
1. DHCP Overview:
o A DHCP server dynamically assigns IP addresses to devices (clients) on the
network.
o A DHCP client is a device that requests an IP address from the DHCP server
when it connects to the network.
o The DHCP process involves the exchange of four messages: Discover, Offer,
Request, and Acknowledgment (DORA).
2. Installing a DHCP Server:
o Debian/Ubuntu-based Systems:
oVerify that the DHCP server is working correctly by checking if clients receive IP
addresses automatically.
5. DHCP Relay Configuration (Optional):
o If the DHCP server is on a different network segment, you may need to configure
a DHCP relay agent to forward DHCP requests between clients and the server.
In this section, we’ll explore two critical network management components: Network Time
Services (NTP) and Virtual Network Computing (VNC) for desktop sharing. Both play an
essential role in maintaining system time consistency and enabling remote access to graphical
user interfaces.
NTP (Network Time Protocol) is used to synchronize the clocks of computers over a network. It
ensures that all systems in a network are set to the correct time, which is critical for time-
sensitive tasks such as logging events, scheduling tasks, and maintaining consistency across
distributed systems.
1. Installation of NTP:
o Debian/Ubuntu-based Systems:
14 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
2. Configuration of NTP:
o The main configuration file for NTP is /etc/ntp.conf. This file defines the time
servers the system will sync with and other settings related to time
synchronization.
o Example NTP configuration to sync with public NTP servers:
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
o You can also configure your system to act as an NTP server for other devices on
the network:
ntpq -p
This command shows the status of NTP peers (time servers) and synchronization
details.
timedatectl
5. Security Considerations:
15 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
VNC (Virtual Network Computing) is a graphical desktop-sharing system that allows you to
remotely control a Linux desktop. VNC is widely used to manage and provide access to remote
systems, especially for graphical applications.
vncserver
o This command will prompt you to create a password for accessing the VNC
session. Once done, a default VNC session is created on port 5901 (for display 1).
o You can configure the VNC server further by modifying its configuration file,
typically located in ~/.vnc/xstartup. Ensure that it starts the desired desktop
environment (e.g., GNOME, KDE, or XFCE).
#!/bin/sh
xrdb $HOME/.Xresources
startxfce4 &
vncserver :1
vncserver -kill :1
16 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
[Unit]
Description=Start VNC Server at startup
After=syslog.target network.target
[Service]
Type=forking
User=<username>
ExecStart=/usr/bin/vncserver :1
ExecStop=/usr/bin/vncserver -kill :1
[Install]
WantedBy=multi-user.target
o This forwards the local port 5901 to the VNC server's port through SSH
encryption.
In this section, we explore RPC-based services and the INET super server (inetd or xinetd),
both of which are crucial for managing and coordinating communication between processes in a
networked environment.
RPC-Based Services
RPC (Remote Procedure Call) allows a program to execute a procedure on a remote system as if
it were a local procedure call. RPC-based services enable communication between different
systems and applications, enabling networked applications to request and execute functions
across machines.
17 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
/srv/nfs/share 192.168.1.0/24(rw,sync,no_subtree_check)
The INET Super Server (also known as inetd or xinetd) is a daemon that manages internet
services on a Linux system. It listens for incoming network connections and starts the
corresponding service as needed, reducing system resource consumption by starting services
only when required.
1. Installation of xinetd:
o Debian/Ubuntu-based Systems:
2. Configuration of xinetd:
18 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
service ftp
{
type = UNLISTED
port = 21
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/in.ftpd
log_on_failure += USERID
}
Network troubleshooting is a crucial skill for administrators, helping to diagnose and resolve
connectivity issues. In this section, we will focus on various tools that are commonly used for
TCP/IP troubleshooting, helping identify and resolve network problems, such as connectivity
issues, misconfigurations, or latency problems.
ping
The ping command is one of the most basic and widely used tools for network troubleshooting.
It is used to test the connectivity between two systems on a network and measure the round-trip
time (RTT) for messages sent from the originating host to a destination.
Usage:
ping <hostname_or_IP>
Example:
ping 192.168.1.1
19 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
Explanation: This command sends ICMP Echo Request messages to the destination host
and waits for an Echo Reply. If the reply is received, it indicates that the destination host
is reachable.
Options:
o -c <count>: Sends a specified number of requests.
o -t <TTL>: Sets the Time To Live (TTL) for packets, limiting the number of hops
the packet can take.
o -i <interval>: Specifies the interval between sending packets.
traceroute
traceroute is used to trace the path packets take from the source system to the destination
system. It helps identify any routing issues or delays caused by intermediate routers.
Usage:
traceroute <hostname_or_IP>
Example:
traceroute google.com
Explanation: This command shows each hop between the source and the destination,
displaying the router addresses and the time it took to reach each hop.
Options:
o -m <max_hops>: Sets the maximum number of hops (routers) the trace will
attempt.
o -p <port>: Specifies the port for UDP packets.
ifconfig
ifconfig is used to configure and display network interfaces on Unix-like operating systems. It
can be used to troubleshoot interface issues, view IP addresses, check link status, and manage
network interfaces.
Usage:
ifconfig
Explanation: This command displays the current status of all network interfaces on the
machine, including their IP addresses, MAC addresses, and current status (up or down).
Options:
o ifconfig eth0 up/down: Brings the specified interface ( eth0 in this case) up or
down.
o ifconfig eth0 <IP_ADDRESS>: Assigns an IP address to the interface.
20 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
netstat
netstat is a powerful tool used for network statistics, displaying information about network
connections, routing tables, interface statistics, and more. It helps diagnose problems like port
conflicts or unexpected open ports.
Usage:
netstat -tuln
Example:
netstat -tuln
This command shows active TCP/UDP ports that are being listened on by the system.
Explanation: The command shows open ports and associated programs or services,
helping administrators determine if any unwanted connections are present.
Options:
o -t: Show TCP connections.
o -u: Show UDP connections.
o -l: Show only listening connections.
o -n: Show numerical addresses (instead of resolving hostnames).
ipconfig
ipconfig is a command-line tool available on Windows systems to display and manage network
interface settings. It can be used to view or modify the IP address, subnet mask, and default
gateway settings of the system.
Usage:
ipconfig
Example:
ipconfig /all
This command displays detailed information about all network interfaces, including IP
address, MAC address, and DHCP lease information.
Options:
o /all: Displays all information about network adapters.
o /release: Releases the current DHCP lease.
o /renew: Renews the DHCP lease.
o /flushdns: Clears the DNS cache.
21 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
Remote administration is vital for managing servers and systems without physical access. This
section focuses on SSH (Secure Shell) for secure remote login and SCP (Secure Copy) for file
transfer. We will also discuss Telnet Replacement and Rsync for efficient file synchronization.
SSH is a cryptographic network protocol used for secure communication between computers. It
provides a secure channel for remote administration, file transfers, and other network services
over an unsecured network. SSH encrypts all communication, making it secure against
eavesdropping and man-in-the-middle attacks.
bash
Copy
sudo yum install openssh-server
3. Configuring SSH:
o SSH configuration files are located in /etc/ssh/sshd_config. Important
settings include:
PermitRootLogin no: Disables root login over SSH for security.
PasswordAuthentication yes/no: Enables or disables password-based
authentication.
Port 22: Sets the port for SSH connections.
o After making changes to the configuration file, restart SSH:
ssh username@hostname_or_IP
22 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
o Example:
ssh-keygen -t rsa
ssh-copy-id user@hostname_or_IP
6. Security Considerations:
o Use key-based authentication instead of password authentication.
o Disable root login by setting PermitRootLogin no in /etc/ssh/sshd_config.
SCP is a secure method for transferring files between systems over SSH. It encrypts the file
transfer to protect data integrity and privacy.
Scp /path/to/local/file
username@hostname:/path/to/remote/directory
scp username@hostname:/path/to/remote/file
/path/to/local/directory
2. Transferring Directories:
o Use the -r option to copy entire directories:
3. Options:
o -P <port>: Specifies the SSH port if it's not the default port 22.
o -v: Enables verbose output, useful for troubleshooting.
o -C: Enables compression for faster transfers over slower connections.
This section focuses on Telnet replacement with SSH, Secure Copy (SCP) for secure file
transfer, and Rsync for efficient file synchronization. Telnet is an old, insecure protocol, and
SSH serves as its secure replacement.
Telnet was once widely used for remote login but transmits data (including passwords) in
plaintext, making it insecure.
SSH (Secure Shell) replaces Telnet as it encrypts all communications, ensuring the
security of credentials and data. SSH should be used for all remote login tasks instead of
Telnet.
Rsync
rsync is a powerful tool for syncing files and directories between local and remote systems. It is
highly efficient because it only transfers the differences between files, reducing the amount of
data transferred.
1. Installing Rsync:
o Debian/Ubuntu-based systems:
2. Using Rsync:
o To sync files from a local system to a remote system:
3. Options:
o -a: Archive mode (preserves symbolic links, permissions, timestamps, etc.).
o -v: Verbose output.
o -z: Compress file data during the transfer.
o --delete: Deletes files in the destination that are no longer present in the source.
4. Advanced Rsync Usage:
o To sync over SSH, use the -e option to specify SSH as the remote shell:
24 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
RSA and DSA are asymmetric encryption algorithms, meaning they use two separate
keys: one private and one public.
The private key remains secure on the client machine, while the public key is shared with
the server.
Authentication works by the server encrypting a challenge with the public key. The client
uses its private key to decrypt the challenge and prove its identity, avoiding the need for a
password.
1. Generate SSH Key Pair: To generate an RSA or DSA key pair, use the ssh-keygen
command. This command creates two files: a private key and a public key.
o RSA Key Pair:
ssh-copy-id user@remote_host
Replace user with the remote user’s name and remote_host with the
remote system's IP address or hostname.
This command appends your public key to the remote server’s
~/.ssh/authorized_keys file.
4. Verify the Password-less Login: After copying the public key to the remote server, test
the password-less login by attempting to SSH into the remote system:
ssh user@remote_host
If set up correctly, you should be logged in without being prompted for a password.
Security Considerations:
Private Key Protection: It is essential to protect your private key using a passphrase,
which adds an extra layer of security. If you choose not to use a passphrase, the key can
be used by anyone who has access to it.
Disable Password Authentication: Once key-based authentication is set up, it’s
advisable to disable password authentication to further secure your SSH login. Modify
the /etc/ssh/sshd_config file on the server:
PasswordAuthentication no
Enhanced Security: Since passwords are not transmitted, the risk of password theft is
reduced.
Automation: Password-less SSH allows for automation of tasks like remote backups and
server maintenance scripts.
Remote Command Execution and Port Forwarding are essential features of SSH, allowing
you to execute commands on a remote machine and securely forward ports through an encrypted
SSH tunnel. These features enhance the ability to manage systems remotely and securely access
services across networks.
26 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
SSH allows you to run commands on a remote system without logging into an interactive shell.
This is useful for scripting, automation, and managing remote systems without the need for full
session access.
Example:
This command will list the contents of the /var/log directory on the remote server.
2. Running Multiple Commands Remotely: To run multiple commands, you can either
separate them with && or use a semicolon ;:
3. Executing a Script Remotely: You can also execute a script on the remote machine:
This command sends the local_script.sh script to the remote host and executes it.
SSH supports port forwarding, which allows you to securely forward ports from your local
machine to a remote machine or vice versa. This can be useful for accessing services on remote
networks or bypassing firewalls.
There are three types of port forwarding: local, remote, and dynamic.
Local port forwarding allows you to forward a port from your local machine to a remote server.
It is commonly used to access remote services (like databases or web servers) that are blocked by
firewalls.
Usage:
Example:
27 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
This forwards port 8080 on your local machine to port 80 on the remote server
(192.168.1.100). Any requests made to localhost:8080 will be sent to
remote_host:80.
Remote port forwarding allows you to forward a port from the remote machine to your local
machine. This is useful when you need to expose local services to remote users.
Usage:
Example:
This forwards port 9090 on the remote machine to port 80 on your local machine. Users
on the remote machine can now access your local service by connecting to
remote_host:9090.
Dynamic port forwarding allows you to create a SOCKS proxy over SSH. This is often used to
bypass firewalls or securely access services on a remote network.
Usage:
Example:
This sets up a SOCKS proxy on localhost:1080, which allows you to route traffic
through the SSH tunnel.
Bypass Firewalls: Forwarding ports allows access to services that are otherwise blocked
by a firewall.
Securely Access Remote Services: Port forwarding ensures that traffic to a remote
service is encrypted and protected from interception.
28 | P a g e
Chapter 3: File Systems and Management of Data Storages Note
CHAPTER 4: Network MANAGEMENT, PREPARED BY HUSSIEN M, WU, KIOT, CS 03/25/2025
Remote Desktop Access: Forwarding ports can be used to access remote desktop
services (like VNC or RDP) through an SSH tunnel, adding an extra layer of security.
Security Considerations:
Always use SSH keys for authentication when employing port forwarding to avoid
exposing passwords.
Consider limiting port forwarding access to specific users or IP addresses in the
/etc/ssh/sshd_config file:
AllowTcpForwarding yes
29 | P a g e
Chapter 3: File Systems and Management of Data Storages Note