<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.completenoobs.com/noobs/index.php?action=history&amp;feed=atom&amp;title=Linux_Networking</id>
	<title>Linux Networking - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.completenoobs.com/noobs/index.php?action=history&amp;feed=atom&amp;title=Linux_Networking"/>
	<link rel="alternate" type="text/html" href="https://www.completenoobs.com/noobs/index.php?title=Linux_Networking&amp;action=history"/>
	<updated>2026-04-30T03:37:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.completenoobs.com/noobs/index.php?title=Linux_Networking&amp;diff=366&amp;oldid=prev</id>
		<title>AwesomO: /* SSH */</title>
		<link rel="alternate" type="text/html" href="https://www.completenoobs.com/noobs/index.php?title=Linux_Networking&amp;diff=366&amp;oldid=prev"/>
		<updated>2023-04-27T20:07:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;SSH&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:07, 27 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l230&quot;&gt;Line 230:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 230:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===SSH===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===SSH===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/del&gt;SSH: To connect to a remote server using SSH, you need to have the OpenSSH client installed on your local machine and the OpenSSH server installed on the remote machine. In Ubuntu, you can install them using the following commands:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[SSH_and_How_to_Use_It|Main ssh and sshd page can be found here - &#039;&#039;&#039;SSH and How to Use It&#039;&#039;&#039;]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:    &lt;/ins&gt;SSH: To connect to a remote server using SSH, you need to have the OpenSSH client installed on your local machine and the OpenSSH server installed on the remote machine. In Ubuntu, you can install them using the following commands:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AwesomO</name></author>
	</entry>
	<entry>
		<id>https://www.completenoobs.com/noobs/index.php?title=Linux_Networking&amp;diff=336&amp;oldid=prev</id>
		<title>imported&gt;AwesomO: Created page with &quot;=Linux Networking=  Linux networking is an essential aspect of system administration and daily operations, as it enables communication between systems and provides access to various network resources.   ==Network configuration and troubleshooting==  ===Configuring network interfaces===  On Ubuntu, the network configuration is usually handled by the netplan utility, which generates configuration files for the system&#039;s network manager (e.g., NetworkManager or systemd-netwo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.completenoobs.com/noobs/index.php?title=Linux_Networking&amp;diff=336&amp;oldid=prev"/>
		<updated>2023-04-17T04:00:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Linux Networking=  Linux networking is an essential aspect of system administration and daily operations, as it enables communication between systems and provides access to various network resources.   ==Network configuration and troubleshooting==  ===Configuring network interfaces===  On Ubuntu, the network configuration is usually handled by the netplan utility, which generates configuration files for the system&amp;#039;s network manager (e.g., NetworkManager or systemd-netwo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Linux Networking=&lt;br /&gt;
&lt;br /&gt;
Linux networking is an essential aspect of system administration and daily operations, as it enables communication between systems and provides access to various network resources. &lt;br /&gt;
&lt;br /&gt;
==Network configuration and troubleshooting==&lt;br /&gt;
&lt;br /&gt;
===Configuring network interfaces===&lt;br /&gt;
&lt;br /&gt;
On Ubuntu, the network configuration is usually handled by the netplan utility, which generates configuration files for the system&amp;#039;s network manager (e.g., NetworkManager or systemd-networkd) based on YAML configuration files. These files are typically located in /etc/netplan/.&lt;br /&gt;
&lt;br /&gt;
To configure a static IP address, follow these steps:&lt;br /&gt;
&lt;br /&gt;
:* a. List available network interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip link show&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* b. Create or edit the netplan configuration file (e.g., /etc/netplan/01-netcfg.yaml):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo $EDITOR /etc/netplan/01-netcfg.yaml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* c. Add the following configuration, replacing INTERFACE_NAME with the appropriate interface name (e.g., eth0 or enp0s3) and adjusting the IP addresses and gateway as needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
network:&lt;br /&gt;
  version: 2&lt;br /&gt;
  renderer: networkd&lt;br /&gt;
  ethernets:&lt;br /&gt;
    INTERFACE_NAME:&lt;br /&gt;
      dhcp4: no&lt;br /&gt;
      addresses:&lt;br /&gt;
        - 192.168.1.100/24&lt;br /&gt;
      gateway4: 192.168.1.1&lt;br /&gt;
      nameservers:&lt;br /&gt;
          addresses: [8.8.8.8, 8.8.4.4]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;/etc/netplan/01-netcfg.yaml&amp;lt;/b&amp;gt; line-by-line explanation:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;network&amp;#039;&amp;#039;&amp;#039;:: This is the root element of the configuration file. It defines the start of the network configuration.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;version: 2&amp;#039;&amp;#039;&amp;#039;: This specifies the configuration format version. Netplan uses version 2 by default.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;renderer: networkd&amp;#039;&amp;#039;&amp;#039;: This sets the backend renderer that Netplan will use to generate the configuration files. networkd is a system service provided by systemd for managing networks. The other common renderer is &amp;#039;&amp;#039;&amp;#039;NetworkManager&amp;#039;&amp;#039;&amp;#039;, which is a more user-friendly network management tool.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;ethernets&amp;#039;&amp;#039;&amp;#039;:: This is a key representing a dictionary of Ethernet devices. Each entry in the dictionary corresponds to a single network interface.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;INTERFACE_NAME&amp;#039;&amp;#039;&amp;#039;:: This is a placeholder for the actual network interface name (e.g., &amp;#039;&amp;#039;&amp;#039;eth0&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;enp0s3&amp;#039;&amp;#039;&amp;#039;). Replace it with the name of the network interface you want to configure.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;dhcp4&amp;#039;&amp;#039;&amp;#039;: no: This disables DHCPv4 for the network interface. When set to &amp;quot;no,&amp;quot; the interface will not request an IP address automatically from a DHCP server. Instead, you will have to set a static IP address.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;addresses&amp;#039;&amp;#039;&amp;#039;:: This key represents a list of IP addresses to assign to the network interface.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;- 192.168.1.100/24&amp;#039;&amp;#039;&amp;#039;: This is the static IP address assigned to the network interface. The &amp;#039;&amp;#039;&amp;#039;/24&amp;#039;&amp;#039;&amp;#039; notation represents the subnet mask, which is equivalent to 255.255.255.0.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;gateway4: 192.168.1.1&amp;#039;&amp;#039;&amp;#039;: This sets the IPv4 gateway (default route) for the network interface. This is the address of the router that connects the local network to other networks, such as the internet.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;nameservers&amp;#039;&amp;#039;&amp;#039;:: This key represents the DNS configuration for the network interface.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;addresses: [8.8.8.8, 8.8.4.4]&amp;#039;&amp;#039;&amp;#039;: This is a list of DNS server addresses that the system will use for domain name resolution. In this example, Google&amp;#039;s public DNS servers (8.8.8.8 and 8.8.4.4) are used.&lt;br /&gt;
&lt;br /&gt;
This configuration sets up a network interface with a static IP address, disables DHCP, configures the gateway and DNS servers, and uses networkd as the renderer.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* d. Apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo netplan apply&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting network issues===&lt;br /&gt;
&lt;br /&gt;
To diagnose connectivity issues, use the ping, traceroute, and nslookup or dig commands:&lt;br /&gt;
&lt;br /&gt;
: a. Check if you can reach a specific IP address:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ping 8.8.8.8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: b. Check if you can resolve a domain name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nslookup example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dig example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: c. Trace the network path to a destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;traceroute example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have connectivity issues, you can try to restart the networking service or the specific network interface:&lt;br /&gt;
&lt;br /&gt;
:    Restart the networking service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo systemctl restart networking&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Restart a specific network interface:&lt;br /&gt;
Replace INTERFACE_NAME with the appropriate interface name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip link set INTERFACE_NAME down&lt;br /&gt;
sudo ip link set INTERFACE_NAME up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Network protocols and services==&lt;br /&gt;
&lt;br /&gt;
===TCP/IP===&lt;br /&gt;
TCP/IP (Transmission Control Protocol/Internet Protocol) is the foundation of the internet and the most commonly used protocol suite for networking. It consists of multiple protocols that facilitate communication between devices on a network.&lt;br /&gt;
&lt;br /&gt;
TCP: A connection-oriented protocol that ensures reliable and ordered delivery of data packets between devices on a network. It establishes a connection, maintains the data flow, and closes the connection once data transmission is complete.&lt;br /&gt;
&lt;br /&gt;
IP: A connectionless protocol responsible for addressing and routing data packets across networks. It encapsulates data into packets and sends them to their destination based on the IP addresses of the source and destination devices.&lt;br /&gt;
&lt;br /&gt;
===DHCP (Dynamic Host Configuration Protocol)===&lt;br /&gt;
&lt;br /&gt;
DHCP is a network protocol that automatically assigns IP addresses and other network configuration parameters to devices on a network. It helps to automate IP address allocation, reducing the need for manual configuration.&lt;br /&gt;
&lt;br /&gt;
Example: To install and configure a DHCP server on Ubuntu, follow these steps:&lt;br /&gt;
&lt;br /&gt;
:    Install the DHCP server package:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt install isc-dhcp-server&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Configure the DHCP server by editing its configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo $EDITOR /etc/dhcp/dhcpd.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Add the following example configuration to the file (adjust the values according to your network requirements):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
subnet 192.168.1.0 netmask 255.255.255.0 {&lt;br /&gt;
  range 192.168.1.100 192.168.1.200;&lt;br /&gt;
  option domain-name-servers 8.8.8.8, 8.8.4.4;&lt;br /&gt;
  option routers 192.168.1.1;&lt;br /&gt;
  option subnet-mask 255.255.255.0;&lt;br /&gt;
  default-lease-time 600;&lt;br /&gt;
  max-lease-time 7200;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;/etc/dhcp/dhcpd.conf&amp;lt;/b&amp;gt; :Explanation &lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;subnet 192.168.1.0 netmask 255.255.255.0 {&amp;#039;&amp;#039;&amp;#039;: This line defines the subnet (192.168.1.0) and its netmask (255.255.255.0). The netmask denotes that the first three octets (192.168.1) are the network part, and the last octet is for host addresses.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;range 192.168.1.100 192.168.1.200;&amp;#039;&amp;#039;&amp;#039;: This line specifies the range of IP addresses (from 192.168.1.100 to 192.168.1.200) that the DHCP server can assign to devices on the network.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;option domain-name-servers 8.8.8.8, 8.8.4.4;&amp;#039;&amp;#039;&amp;#039;: This line sets the DNS servers (8.8.8.8 and 8.8.4.4, which are Google&amp;#039;s public DNS servers) that the DHCP server will provide to the devices on the network.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;option routers 192.168.1.1;&amp;#039;&amp;#039;&amp;#039;: This line specifies the default gateway (192.168.1.1) that the DHCP server will provide to devices on the network for routing traffic outside the local subnet.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;option subnet-mask 255.255.255.0;&amp;#039;&amp;#039;&amp;#039;: This line sets the subnet mask (255.255.255.0) that the DHCP server will provide to devices on the network.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;default-lease-time 600;&amp;#039;&amp;#039;&amp;#039;: This line defines the default lease time (600 seconds, or 10 minutes) for the IP addresses assigned by the DHCP server. The lease time is the duration for which a device holds an IP address before it needs to be renewed.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;max-lease-time 7200;&amp;#039;&amp;#039;&amp;#039;: This line sets the maximum lease time (7200 seconds, or 2 hours) for the IP addresses assigned by the DHCP server. If a device requests a lease time longer than the maximum lease time, the server will assign it the maximum lease time instead.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;}&amp;#039;&amp;#039;&amp;#039;: This line marks the end of the configuration block for the specified subnet.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Restart the DHCP server to apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo systemctl restart isc-dhcp-server&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===DNS (Domain Name System)===&lt;br /&gt;
&lt;br /&gt;
DNS is a system that translates human-friendly domain names (e.g., www.example.com) into IP addresses (e.g., 192.0.2.1) that computers can understand. It acts as a phone book for the internet, allowing users to access websites and resources using domain names instead of IP addresses.&lt;br /&gt;
&lt;br /&gt;
Example: To configure a DNS server on Ubuntu using BIND9, follow these steps:&lt;br /&gt;
&lt;br /&gt;
:    Install the BIND9 package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt install bind9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Configure the DNS server by editing its configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo $EDITOR /etc/bind/named.conf.options&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Add the following example configuration to the file (you can replace the forwarders with the DNS servers of your choice):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
options {&lt;br /&gt;
  directory &amp;quot;/var/cache/bind&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  recursion yes;&lt;br /&gt;
  allow-query { any; };&lt;br /&gt;
&lt;br /&gt;
  forwarders {&lt;br /&gt;
    8.8.8.8;&lt;br /&gt;
    8.8.4.4;&lt;br /&gt;
  };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;/etc/bind/named.conf.options&amp;lt;/b&amp;gt;  explanation of each line:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;options {&amp;#039;&amp;#039;&amp;#039;: This line marks the beginning of the options block, which contains various settings for the DNS server.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;directory &amp;quot;/var/cache/bind&amp;quot;;&amp;#039;&amp;#039;&amp;#039;: This line sets the working directory for the BIND server to &amp;quot;/var/cache/bind&amp;quot;, which is where the server will store its cache and other working files.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;recursion yes;&amp;#039;&amp;#039;&amp;#039;: This line enables recursive queries on the DNS server. Recursive queries allow the server to forward queries to other DNS servers if it doesn&amp;#039;t have the requested information in its cache or zone files.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;allow-query { any; };&amp;#039;&amp;#039;&amp;#039;: This line sets the allowed sources for DNS queries. In this case, the server is configured to accept queries from any IP address.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;forwarders {&amp;#039;&amp;#039;&amp;#039;: This line marks the beginning of the forwarders block, which contains a list of DNS servers to which the BIND server will forward queries it cannot answer.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;8.8.8.8;&amp;#039;&amp;#039;&amp;#039;: This line specifies one of the forwarder DNS servers (8.8.8.8), which is one of Google&amp;#039;s public DNS servers.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;8.8.4.4;&amp;#039;&amp;#039;&amp;#039;: This line specifies another forwarder DNS server (8.8.4.4), which is another one of Google&amp;#039;s public DNS servers.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;};&amp;#039;&amp;#039;&amp;#039;: This line marks the end of the forwarders block.&lt;br /&gt;
&lt;br /&gt;
:    &amp;#039;&amp;#039;&amp;#039;};&amp;#039;&amp;#039;&amp;#039;: This line marks the end of the options block.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Restart the BIND9 service to apply the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo systemctl restart bind9&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, your Ubuntu system is configured to use BIND9 as its local DNS server, forwarding DNS queries to the specified forwarders.&lt;br /&gt;
&lt;br /&gt;
==Remote access and management (SSH, SCP, SFTP)==&lt;br /&gt;
&lt;br /&gt;
SSH (Secure Shell) is a protocol used to securely access and manage remote Linux systems over an unsecured network. It encrypts all data transmitted between the client and server, ensuring the confidentiality and integrity of the data. SSH can be used for executing commands, managing files, and launching applications on remote systems.&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
&lt;br /&gt;
    SSH: To connect to a remote server using SSH, you need to have the OpenSSH client installed on your local machine and the OpenSSH server installed on the remote machine. In Ubuntu, you can install them using the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install openssh-client&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the remote machine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install openssh-server&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To connect to the remote server, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh username@remote_host&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace &amp;quot;username&amp;quot; with the remote user&amp;#039;s username and &amp;quot;remote_host&amp;quot; with the remote server&amp;#039;s IP address or hostname.&lt;br /&gt;
&lt;br /&gt;
===SCP (Secure Copy)===&lt;br /&gt;
&lt;br /&gt;
:    SCP (Secure Copy): SCP is a file transfer protocol that uses SSH for secure data transfer. It allows you to copy files between local and remote systems or between two remote systems.&lt;br /&gt;
&lt;br /&gt;
To copy a file from the local machine to a remote machine, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scp /path/to/local/file username@remote_host:/path/to/remote/directory&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file from a remote machine to the local machine, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scp username@remote_host:/path/to/remote/file /path/to/local/directory&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SFTP (Secure File Transfer Protocol)===&lt;br /&gt;
&lt;br /&gt;
:    SFTP (Secure File Transfer Protocol): SFTP is another secure file transfer protocol that uses SSH for secure data transfer. Unlike SCP, SFTP provides an interactive command-line interface, similar to FTP, for managing files on the remote system.&lt;br /&gt;
&lt;br /&gt;
To start an SFTP session with a remote server, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sftp username@remote_host&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once connected, you can use commands like ls, cd, get, put, and mkdir to navigate and manage files on the remote system. To exit the SFTP session, type exit or bye.&lt;br /&gt;
&lt;br /&gt;
These protocols and tools are essential for securely managing remote Linux systems and transferring files between them.&lt;br /&gt;
&lt;br /&gt;
==Network Security and Firewalls: iptables and ufw==&lt;br /&gt;
&lt;br /&gt;
Network security is crucial to protect your Linux system from malicious traffic and unauthorized access. Firewalls act as a barrier between your system and the external network, allowing or blocking network traffic based on predefined rules. In this tutorial, we will discuss how to configure and manage firewalls using iptables and ufw.&lt;br /&gt;
&lt;br /&gt;
===iptables===&lt;br /&gt;
&lt;br /&gt;
iptables is a powerful command-line utility for managing the Linux kernel&amp;#039;s netfilter framework. It allows you to create, modify, and manage firewall rules to control incoming and outgoing network traffic.&lt;br /&gt;
&lt;br /&gt;
Installing iptables&lt;br /&gt;
&lt;br /&gt;
iptables comes pre-installed on most Linux distributions, including Ubuntu. You can verify its installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo iptables --version&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basic iptables commands&lt;br /&gt;
&lt;br /&gt;
:*    List current rules: &amp;#039;&amp;#039;&amp;#039;sudo iptables -L&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*    Flush/Delete all rules: &amp;#039;&amp;#039;&amp;#039;sudo iptables -F&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*    Save current rules: &amp;#039;&amp;#039;&amp;#039;sudo iptables-save &amp;gt; /path/to/backup/file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:*    Restore saved rules: &amp;#039;&amp;#039;&amp;#039;sudo iptables-restore &amp;lt; /path/to/backup/file&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Creating rules&lt;br /&gt;
&lt;br /&gt;
iptables rules are based on chains (INPUT, OUTPUT, and FORWARD) and targets (ACCEPT, DROP, and REJECT).&lt;br /&gt;
&lt;br /&gt;
:    Allow all incoming SSH traffic:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Block all incoming traffic from a specific IP address:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo iptables -A INPUT -s &amp;lt;IP_ADDRESS&amp;gt; -j DROP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Allow all outgoing HTTP traffic:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:    Block all incoming traffic on a specific port:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo iptables -A INPUT -p tcp --dport &amp;lt;PORT_NUMBER&amp;gt; -j DROP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ufw (Uncomplicated Firewall)===&lt;br /&gt;
&lt;br /&gt;
ufw is a user-friendly frontend for iptables that simplifies the process of configuring and managing firewalls. It is recommended for beginners and users who prefer a straightforward approach to firewall management.&lt;br /&gt;
&lt;br /&gt;
Installing ufw&lt;br /&gt;
&lt;br /&gt;
On Ubuntu, ufw comes pre-installed. You can verify its installation by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo ufw version&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabling and disabling ufw&lt;br /&gt;
&lt;br /&gt;
:    Enable ufw: &amp;#039;&amp;#039;&amp;#039;sudo ufw enable&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:    Disable ufw: &amp;#039;&amp;#039;&amp;#039;sudo ufw disable&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Basic ufw commands&lt;br /&gt;
&lt;br /&gt;
:    Check ufw status and rules: &amp;#039;&amp;#039;&amp;#039;sudo ufw status&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:    Reset ufw to default settings: &amp;#039;&amp;#039;&amp;#039;sudo ufw reset&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Creating rules&lt;br /&gt;
&lt;br /&gt;
:    Allow incoming SSH traffic: &amp;#039;&amp;#039;&amp;#039;sudo ufw allow ssh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:    Block incoming traffic from a specific IP address: &amp;#039;&amp;#039;&amp;#039;sudo ufw deny from &amp;lt;IP_ADDRESS&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:    Allow outgoing HTTP traffic: &amp;#039;&amp;#039;&amp;#039;sudo ufw allow out http&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:    Block incoming traffic on a specific port: &amp;#039;&amp;#039;&amp;#039;sudo ufw deny in &amp;lt;PORT_NUMBER&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In summary, network security and firewalls play a crucial role in protecting your Linux system. iptables and ufw are two powerful tools that can help you configure and manage firewalls to safeguard your system from unauthorized access and malicious traffic.&lt;/div&gt;</summary>
		<author><name>imported&gt;AwesomO</name></author>
	</entry>
</feed>