Kavin Naidu
Roll no: 459
LSA Practical - 1 28-06-25
AIM:- Installing DHCP server on ubuntu.
Theory:-
The Dynamic Host Configuration Protocol (DHCP) is a client–server protocol used to
automatically assign IP addresses and other network configuration parameters to devices. It
reduces the need for manual configuration and prevents IP conflicts in a network.
A DHCP server maintains a pool of IP addresses and leases them to clients for a specific period. The
process of IP allocation follows the DORA cycle:
• Discover – Client broadcasts request for IP.
• Offer – Server offers an available IP.
• Request – Client requests the offered IP.
• Acknowledge – Server confirms and assigns the IP.
In Ubuntu, the most common service used is the ISC DHCP Server. It supports dynamic allocation (IP
from a range), automatic allocation (permanent IP assignment), and manual allocation (static IP
mapping using MAC address).
DHCP improves efficiency, saves administrative effort, and is widely used in LANs, WLANs, and
enterprise networks. It ensures smooth communication between devices by providing IP, subnet mask,
gateway, and DNS details automatically.
Steps to install and configure DHCP server:-
1. Remove any existing package (optional)
sudo apt remove
Password: 123 (when prompted)
2. Update & upgrade packages
sudo apt update
sudo apt upgrade
Kavin Naidu
Roll no: 459
3. Switch to root user
sudo su
4. Install DHCP Server
sudo apt install isc-dhcp-server
5. Navigate to DHCP configuration directory
cd /etc/dhcp
6. List files
ls -l
7. Backup default configuration file
cp dhcpd.conf dhcp.conf.bak
8. Edit DHCP configuration
sudo nano dhcpd.conf
9. Inside the file, add or modify:
Kavin Naidu
Roll no: 459
Save & Exit: Press Ctrl + X, then Y, then Enter.
10. Navigate to DHCP Default Configuration
cd /etc/default/
11. Edit Interface Settings
nano isc-dhcp-server
Add or modify the following line:
INTERFACESv4="enp0s3"
12. Restart DHCP Service
sudo systemctl restart isc-dhcp-server
13. Check DHCP Service Status
systemctl status isc-dhcp-server
Result:- Active: Failed
14. Allow DHCP Port Through Firewall inside /etc/default#
ufw allow 67/udp
Kavin Naidu
Roll no: 459
15. Assign Static IP to Server Interface
ifconfig enp0s3 20.0.0.1;
16. Restart and Verify Again
systemctl restart isc-dhcp-server
systemctl status isc-dhcp-server
Result:- Active: active (running)
Kavin Naidu
Roll no: 459
LSA Practical - 2 Date:- 05-07-25
AIM:- Initial Settings: Add a User, Network Settings, Change to static IP Address, Disable IPV6 if not
needed, Configure Service, display the list of services which are running. Stop and turn OFF auto-start
setting for a service if you don’t need it, Sudo Settings
Theory:
When setting up a Linux system, some initial settings are required for smooth and secure operation. The
first step is to add a user so that administration is not always done as the root user. This improves safety
by giving normal users limited access and using root only when required.
Next, network settings are configured. A static IP address is often preferred for servers because it
ensures the same IP is always used for communication. This is important for services like web servers,
DNS, or DHCP servers.
Linux supports both IPv4 and IPv6 addressing.
• IPv4 uses 32-bit addresses (e.g., 192.168.1.10) and allows about 4.3 billion unique addresses.
• IPv6 (Internet Protocol version 6) uses 128-bit addresses (e.g.,
2001:0db8:85a3::8a2e:0370:7334), which provides a much larger pool of addresses, improved
security features, and better support for modern networking.
If a network does not use IPv6, it can be disabled to simplify configuration and reduce
unnecessary processes.
Linux systems also run background services. Using systemctl, administrators can list running services,
configure them, stop those not needed, and disable auto-start at boot time to save resources.
Finally, sudo settings are configured so normal users can run administrative tasks without logging in as
root. This improves both security and accountability.
Thus, user management, network setup, IPv6 control, service management, and sudo configuration are
the essential initial steps in Linux system administration.
Steps:
1. Add a new user – student3
sudo adduser student3
Is the information correct? [Y/n] : (Type y)
Kavin Naidu
Roll no: 459
2. Give administrative (sudo) access to student3
sudo usermod -aG sudo student3
3. Switch from user gnkhalsa to student3
su - student3
4. Open the Network configuration file:
sudo nano /etc/network/interfaces
~ Addormodify(exampleforstatic IP):
auto enp0s3
iface enp0s3 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
Save & Exit: Press Ctrl + X, then Y, then Enter.
~ Restart networking:
sudo systemctl restart networking
5. EditGRUBifyouwanttodisableIPv6:
sudo nano /etc/default/grub
~ Add/modify line:
GRUB_CMDLINE_LINUX="ipv6.disable=1"
~ After editing, update GRUB:
sudo update-grub
Kavin Naidu
Roll no: 459
sudo reboot
6. View running services:
systemctl list-units -- type=service --state=running
7. List all loaded services
systemctl list-units -- type=service
Enter “Ctrl - c” to come back to the command line.
8. Stop and disable the CUPS service (Printer Service):
sudo systemctl stop cups
sudo systemctl disable cups
9. Edit the sudoers file to grant student3 full administrative privileges:
sudo visudo
Kavin Naidu
Roll no: 459
Scroll to the end of the file and add:
student3 ALL=(ALL:ALL) ALL
Kavin Naidu
Roll no: 459
LSA Practical - 3 Date :- 12-07-25
AIM:- Configure NTP server(NTPd), install and configure NTPd, configure NTP client(ubuntu and
windows)
NTP (Network Time Protocol) is a protocol used to synchronize the clocks of computers within a
network. Accurate timekeeping is very important for logging, authentication, scheduling tasks, and
network security. NTP works on UDP port 123 and can synchronize local system clocks with external
time sources (like public NTP servers) or with a central NTP server inside an organization.
On Linux, the traditional implementation is NTPd (Network Time Protocol Daemon). The NTP server
provides the correct time to all clients, while NTP clients request and adjust their clocks based on the
server’s time.
• NTP Server (NTPd): Installed and configured on one system to act as the master time provider. It
may sync its own time with reliable external NTP servers (like pool.ntp.org). Other devices in the
local network synchronize with this server.
• NTP Client: A client machine that connects to the NTP server to synchronize its system clock.
This ensures that all systems in the network maintain the same time.
On Ubuntu/Linux, the NTP client can be configured using ntpd or chrony. The configuration file
/etc/ntp.conf (for NTPd) defines which server to sync with.
On Windows, the client uses the Windows Time Service (w32time). By default, it can sync with
Microsoft’s time server, but it can also be pointed to a custom NTP server via Control Panel or the
w32tm command.
Overall, configuring an NTP server and clients ensures accurate, consistent, and secure timekeeping
across all devices in a network, which is vital for communication, authentication, and log management.
PART A:- Configure NTP server on Linux
Step 1: Update System & install NTP
sudo apt update
sudo apt install ntp -y
Step 2: Edit the NTP configuration file
sudo nano /etc/ntp.conf
~ Changes to make inside the file:
# pool 0.ubuntu.pool.ntp.org iburst
# pool 1.ubuntu.pool.ntp.org iburst
# pool 2.ubuntu.pool.ntp.org iburst
# pool 3.ubuntu.pool.ntp.org iburst
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
# Restrict network clients
restrict 192.168.21.0 mask 255.255.255.0 nomodify notrap
Kavin Naidu
Roll no: 459
To Save and exit:- Ctrl x and y then Enter
Step 3: Restart NTP service
sudo systemctl restart ntp
Step 4: Enable NTP service on boot
sudo systemctl enable ntp
Step 5: AllowNTPinfirewall(ifenabled – Optional):
sudo ufw allow ntp
Step 6: Check NTP service status
sudo systemctl status ntp
Step 11: Check NTP peers
ntpq -p
PART B:- Configure NTP Client on Linux
Step 1: install NTP
sudo apt install ntp -y
Step 2: Edit the NTP configuration file
Kavin Naidu
Roll no: 459
sudo nano /etc/ntp.conf
Changes to make inside the file:
• Comment out default poolservers.
• For testing open in same user but different terminal
• Add your NTP server (replace <Server_IP> with the Ubuntu server you set up in Part A):
# pool 0.ubuntu.pool.ntp.org iburst
# pool 1.ubuntu.pool.ntp.org iburst
# pool 2.ubuntu.pool.ntp.org iburst
# pool 3.ubuntu.pool.ntp.org iburst
server <Server_IP> prefer
Step 3: Restart Service
sudo systemctl restart ntp
sudo systemctl enable ntp
Step 4: Verify synchronization
ntpq -p
timedatectl status
Kavin Naidu
Roll no: 459
PART C:-ConfigureNTPClienton Windows
1. Open PowerShell (Admin)orCommand Prompt (Admin).
2. Run the following commands (replace <Server_IP> with your Ubuntu NTP server):
Run the following commands:
w32tm /config /manualpeerlist:<Server_IP> /syncfromflags:manual /reliable:YES /update
net stop w32time
net start w32time
w32tm /resync
3. Verify sync:
w32tm /query /status
Kavin Naidu
Roll no: 459
LSA Practical - 4 Date :- 19-07-25
Aim:- Install DNS server BIND, Configure DNS Server which resolves domain name or IPaddress, install
BIND 9, Configure BIND, Limit ranges You allow to access if needed.
The Domain Name System (DNS) is a hierarchical naming system that translates domain names (like
example.com) into IP addresses (like 192.168.1.10) and vice versa. Since users prefer easy-to-remember
names instead of numbers, DNS plays a vital role in networking and the Internet.
On Linux, the most widely used DNS server software is BIND (Berkeley Internet Name Domain). The
latest stable version is BIND 9. It allows an administrator to configure the server to act as:
• Caching DNS Server – temporarily stores query results to speed up resolution.
• Forwarding DNS Server – forwards requests to other DNS servers.
• Authoritative DNS Server – provides actual domain-to-IP mappings for specific zones (e.g., for
hosting a website).
The main configuration file is /etc/bind/named.conf, and zone files are usually stored in /etc/bind/. A
zone file contains records such as:
• A Record – maps hostname to IPv4 address.
• AAAA Record – maps hostname to IPv6 address.
• PTR Record – provides reverse lookup (IP → domain).
•
NS Record – specifies authoritative name servers.
Administrators can also limit access ranges by defining which IP subnets are allowed to query the DNS
server. This enhances security by preventing unauthorized users from using the DNS service.
Thus, configuring BIND involves installing the package, editing configuration files, creating zone files
for domains, setting access restrictions if required, and restarting the service. This allows the DNS
server to resolve domain names to IP addresses efficiently within a network or for public use.
Steps to Install and Configure BIND9 DNS Server
1. Update the system packages
sudo apt update
2. Install BIND9 and related utilities
sudo apt install bind9 bind9utils bind9-doc -y
3. Switch to root user
sudo su
4. Edit the global DNS options file
sudo nano /etc/bind/named.conf.options
Kavin Naidu
Roll no: 459
5. Add the following configuration to define the cache directory, recursion, query permissions,
forwarders, and listening options:
Save and exit:- Ctrl X and Y thenPressEnter
4. Add a Forward Zone:
sudo nano /etc/bind/named.conf.local
Add the following configuration:
Save and exit (Ctrl + X, then Y, then Enter).
5. Create the Zone file
a. Copy the default zone template:
sudo cp /etc/bind/db.local /etc/bind/db.example.local
b. Edit the new zone file:
sudo nano /etc/bind/db.example.local
c. Replace the contents with:
Save and exit (Ctrl + X, then Y, then Enter).
6. Restart BIND9 Service:
7. Enable BIND9 to Start on Boot (Run only once):
Kavin Naidu
Roll no: 459
8. Check the Status of BIND9:
9. Test DNS Resolution with dig Command
a. To test if the DNS server is resolving example.local:
dig @localhost example.local
b. To test if the DNS server is resolving www.example.local:
dig @localhost www.example.local
Kavin Naidu
Roll no: 459
LSA Practical - 5 Date :- 26-07-25
AIM:- SSH Server: Password Authentication Configure SSH server to manage a server from the remote
computer SSHClient: Ubuntu and Windows.
SSH (Secure Shell) is a network protocol used to securely access and manage remote systems over an
unsecured network. It provides encrypted communication, protecting login credentials and data from
interception. SSH replaces older insecure methods like Telnet and rlogin.
An SSH Server runs on the target machine and listens on TCP port 22. Clients connect to it using an SSH
client program. Authentication can be done using passwords or SSH keys. In many setups, password
authentication is enabled initially to allow users to log in with their system credentials, though later it
can be restricted for higher security.
On Ubuntu/Linux, the SSH server is usually provided by the OpenSSH package (openssh-server). Once
installed and enabled, administrators can configure its behavior in /etc/ssh/sshd_config, where options
like PermitRootLogin and PasswordAuthentication are controlled.
For the SSH client:
• On Ubuntu/Linux, the built-in ssh command is used to connect to remote servers (e.g., ssh
user@server_ip).
• On Windows, clients can use either the built-in OpenSSH client (available in Windows 10/11) or
third-party tools like PuTTY. These allow connecting to the SSH server using the server’s
IP/domain, username, and password.
By configuring SSH server and client, administrators can securely manage servers remotely, transfer
files, and execute commands, which is essential for modern system administration.
PART A:-
A) To configure SSH Server on Ubuntu:
Step 1: Update Package Lists
sudo apt update
Step 2: Install OpenSSH Server
sudo apt install openssh-server
Step 3: Check SSH Service Status
sudo systemctl status ssh
Kavin Naidu
Roll no: 459
Step 4: Start and Enable SSH Service
sudo systemctl start ssh
sudo systemctl enable ssh
Step 5: Edit SSH Configuration (Optional)
sudo nano /etc/ssh/sshd_config
~ Changestomakeinsidethefile:
- Ensure password authentication is allowed (uncomment or modify):
PasswordAuthenticationyes
-
(Optional) Allow root login:
After editing, restart the SSH service:
PermitRootLogin yes
sudo systemctl restart ssh
Step 6: Set Password for SSH User (Optional)
sudo passwd your_username
Step 7: Create and Switch to a New User
sudo adduser std1
su - std1
Step 8: Check IP Address
ip a
Kavin Naidu
Roll no: 459
If The system is showing FAILED:-
B) Follow the steps, if the system fails.
Step1: Open the nano file
sudo nano /etc/ssh/ssshd_config
Step 2: Comment out the FIrst line - Package…..file
Step 3: Remove the word “prohibit” from the third line:-
Kavin Naidu
Roll no: 459
Step 4: Comment out the line :- PermitEmptyPasswords no
Save and exit:- Ctrl X and Y then Press Enter
Step 5: Now, again restart and check the status
To change the Setting follow the flow:-
TYCS — Right click — Settings — Network — Attack to: (change to) bridge adapter — clickOK — Restart
Operating System — Run cmd: ip a
Part B & C:- Configure SSH Client (Ubuntu/Linux/Windows)
From the same host terminal, connect to the SSH server:
ssh std1@<Server_IP> (Copy the inet ip address from the cmd- ip a)
Enter the user password when prompted.
OUTPUT:-
Kavin Naidu
Roll no: 459
LSA Practical - 6 Date :- 09-08-25
AIM:- Configure dhcp server, configure NFS server to share directory on your nfs. Configure nfs file on
Ubuntu and Windows Client os.
A DHCP (Dynamic Host Configuration Protocol) Server automatically assigns IP addresses and network
configuration parameters (subnet mask, gateway, DNS) to client machines in a network. This reduces
manual effort and avoids IP conflicts. On Ubuntu, the DHCP service is commonly provided by ISC DHCP
Server. Administrators define the IP address range and options in /etc/dhcp/dhcpd.conf, and the server
dynamically leases IPs to clients.
An NFS (Network File System) Server allows directories on a Linux system to be shared over the
network so that other systems can access them as if they were local. NFS works best in Linux/Unix
environments, but Windows can also connect to NFS shares with additional client support. On Ubuntu,
the NFS service is provided by the nfs-kernel-server package, and shared directories are defined in the
/etc/exports file with permissions (e.g., read/write, allowed IP ranges).
• On Ubuntu clients, the nfs-common package is used to mount the shared directory either
temporarily (using the mount command) or permanently (by editing /etc/fstab).
• On Windows clients, the “Services for NFS” feature (available in Pro/Enterprise editions) or
third-party tools allow access to the shared directory by mapping it as a network drive.
Together, DHCP simplifies IP management, while NFS provides seamless file sharing across a network,
making them important services in enterprise and academic environments.
PART A:- Configure DHCP Server on Ubuntu
Step 1. Update the package list:-
Step 2. Install the dhcp server package
Step 3. For Ip address
Note:-
Ip address:- 192.168.21.98/24
Broadcast :- 192.168.21.255
Interface:- enp0s3
Default gateway: 192.168.0.1
Subnet mask:- 255.255.255.0
Kavin Naidu
Roll no: 459
Subnet:- 192.168.21.0 --Replace 98 with 0 in Ip address
Router:- 192.168.21.0 — Replace 98 with 1 in Ip address
Step 4. Configure the DHCP server
a. Edit the dhcp configuration file:-
b. Add the following configuration:-
4. Restart and Check the status
Step 5: To check the error
sudo dhcpd -t -cf /etc/dhcp/dhcpd.conf
Kavin Naidu
Roll no: 459
Step 6: Fix the error by editing the nano file
sudo nano /etc/default/isc-dhcp-server
Step7: Restart the server
Sudo systemctl restart isc-dhcp-server
Step 8: Check the status
sudo systemctl status isc-dhcp-server
Step 9. Assign the interface to the DHCP server
a. Edit the default interface file:-
b. Set the “INTERFACESv4”=”enp0s3”
No need to write v4, its bydefault v4 itself
Step 11. Restart and check the status:-
Kavin Naidu
Roll no: 459
PART B:- NFS Server Configuration on Ubuntu
Step 1: Install NFS Server Package
sudo apt-get install nfs-kernel-server
Step 2: Create a NFS Directory to share:
sudo mkdir -p /srv/nfs/share
Step 3: Set permissions for the shared dictionary
sudo chown nobody:nogroup /srv/nfs/share
Step 4: Set Directory Permissions
sudo chmod 777 /srv/nfs/share
Step 5: Configure NFS Exports
sudo nano /etc/exports
Step 6:- Export, restart and check the status:-
Kavin Naidu
Roll no: 459
Step 10: Verify Exported Directories
sudo exportfs -v
Step 11: Install NFS Client Utilities
sudo apt-get install nfs-common
Step 12: Create a mount point:
Step 13: Mount the nfs share:
Step 14: Verify the mount