# Data Networking/Spring 2016/Subramaniam Veerabahu

1. Subramaniam Veerabahu 2. Shaurya Katiyar 3. Anirudh Mittal 4. Raghav Surianarayanan

## Motivation

Linux Operating system has developed into a force in almost each and every networking application, which gives us the much required motivation to play around with the OS. Linux is one of the powerful open-source operating system. Linux OS is a key skill-set to possess for a successful career in networking. Hoping to develop a good proficiency in Linux, we have decided to approach this project.

## Behaviour of Protocols
### Domain Name System

The main understanding involved in DNS is that it is used to resolve host name into IP address. When a particular website is typed in the address bar of the browser, DNS server finds out the corresponding IP address of the website and returns it to the user. Initially, a DNS query is made to the servers and the server replies back with a response about the IP address of the website. After the IP address is obtained, the host can be reachable to retrieve data from them. In order to reduce the latency, BIND9 server with caching can be used. The main advantage is that whenever a response is received for a DNS query, it is cached in the server. As a result, the time taken to load the previous cached page is considerably reduced, thereby decreasing the waiting time of the user to obtain the data from the webpage.

### Dynamic Host Configuration Protocol

Assigning IP addresses to the networking component can be done in the following ways. i) Static Allocation: In this method, IP addresses to networking components like computers, routers etc. are assigned statically and remain constant until changed by the network administrator. ii) Automatic Allocation: In this method, same IP addresses are allocated to the systems whenever it connects to a particular network.
iii) Dynamic Allocation: In this method, a DHCP server is used to allocate IP addresses to the devices, from a selected pool of addresses as specified in the DHCP server. Both IPv4 and IPv6 addressing can be provided using the DHCP server. A suitable subnet mask needs to be provided for correct allocation of IP addresses, to prevent the wastage of IP’s.

### Webserver & Firewall

In order to host a website, we need a webserver to run on the Linux OS. Apache2 is the most popularly used webserver. In addition, firewall is used to provide a layer of security to control the incoming and outgoing traffic in a network. All traffic other than the allowed set of rules made in the IP tables are denied by the firewall at the gateway router (router in between the private network and the public network). Requirements The main requirement is a Linux based OS. This project is being implemented using Ubuntu 14.04. In addition to this, BIND9 for implementing DNS caching, DHCP server for implement dynamic IP allocation and Apache2 server for hosting a website are required.

## Installation Steps
### DNS

Step 1: Install bind(
Command:
Step 2: Restart the networking daemon
Command:
Step 3: Create a hostname
Command:
Step 4: Create a domain-name by editing /etc/hosts
Command:
Add
Do a restart of the server Step 5: Install BIND9
Command:
Step 6: Configure named.conf.options
Command:
Step 7: Configure named.conf.local
Command:
Edit
Step 8: Create two database files db.linux.abc and db.192 in zones folder
Command: Make the directory etc/bind/zones
Copy db.local to db.linux.abc
Open db.linux.abc file
Edit the file
Step 9: Create two database files db.linux.abc and db.192 in zones folder
Command:
Save and Exit Copy db.127 to db.192
Open db.192 file
Edit the file
Save and Exit Check whether both zones are working properly
Step 10: Configure resolv.conf
Command:
Edit
Restart the bind server and check the log file for no errors

### DHCP

Step1: Install DHCP server package Command:
Step2: Edit the isc-dhcp-server file Command:
On line 11 change: INTERFACES=”eth0” Save and Exit
Step3: Editing file /etc/dhcp/dhcpd.conf create backup /etc/dhcp/dhcpd.conf Command:
Login as root
Create configuration file dhcpd.conf:
Step4: Restart the DHCP server Command:

### Webserver

Step 1: Install Apache2 Webserver
Command:
Step 2: Check whether the web server is able to listen on port 80
Command:
Step 3: Restart the web server
Command:
Step 4: Develop a webpage for the server
Command:

### Firewall

Firewall allows the system administrator to configure the ip tables. 1. In order to block ICMP requests:
2. In order to prevent SSH login:
3. In order to block FTP ports:
4. In order to block the port used by Telnet:
5. To block a webpage:

## Additional Features
### Mail Server

Postfix is the default mail transfer agent for Ubuntu. Step 1: Install postfix
Command:
Step 2: Configure the following:
Command:
Insert the following details: 1.General type of mail configuration: Internet Site 2.NONE doesnot appear in current config 3.System mail name: linux.abc 4.Root and postmaster mail recipient: <admin_user_name> 5.Other destinations for mail: server1.linux.abc 6.Force synchronous updates on mail queue?: No 7:Local networks: 127.0.0.0/8 8:Yes doesnot appear to be requested in current config 9:Mailbox size limit (bytes): 0 10.Local address extension character: + 11.Internet protocols to use: all Step 3: Configure the mailbox format for Maildir
Command:
Step 4: Configure Postfix to do SMTP AUTH using SASL
Command:
Generate certificates to be used for TLS encryption and/or certificate Authentication
Step 5:Configure Postfix to do TLS encryption for incoming and outgoing mail:
Command:
Step 6:Restart the postfix daemon Command:

### VPN

Step 1:Install pptpd package used to configure VPN Command:
Step 2:Edit the files in /etc/pptpd.conf and change Command:
Step 3:Edit /etc/ppp/pptpd-options file
Command:
Step 4:Set userid and password
Command:
* indicates the IP addresses in the IP range

### NFS

Step 1:Configuring the NFS-server
Command:
Edit the file
On the last line
Save and Exit Change the directory
Restart the server
Step 2:Configuring the NFS-client
Command:
Make directory in /home

### Master & Slave

Step 1: Edit /etc/hosts
Command:
Add
Step 2: Edit /etc/bind/named.conf.local on the master virtual machine Command:
Edit
Step 3: Edit /etc/bind/named.conf.local on the slave virtual machine Command:
Edit

### Backup

The protocols used for backup are rsync and ssh. Rsync is a protocol used to synchronize files in Ubuntu. It updates only that data that is not yet synchronized with the backup file. Ssh protocol provides a secure channel to send and receive files on Unix machines.It uses encryption and decryption at the end users. Crontab is used for scheduling backups. Step 1: Install rsync
Step 2: Install ssh
Step 3: Create a public and a private key for security
Step 4: Copy this into the web server
Step 5: Edit crontab
Step 6: Give the scheduling and run the rsync command from the crontab to automate the backup of the webserver using Rsync

### PXE Boot and RARP

The Bootstrap Protocol is a network protocol used by a client to obtain an IP address from a server which provides an IP address pool.PXE boot is an extension from the BOOTP as well as DHCP. Using PXE boot, we can boot thousands of Linux Terminals from a remote server. The configuration for PXE boot has the following four steps: Step 1: Configure dhcp service
Add these lines:
Step 2: Restart the dhcp service Configure the tftp service
Step 3: Configure the vsftp service
Step 4: Configure the pxe service
Copy the file to boot Ubuntu to /tftpboot and boot Ubuntu using PXE boot.

## Test Plan
### DNS Test

The following commands are used for DNS testing: 1) Dig Domain Information Groper is used to query DNS name servers. It performs DNS lookups and returns the response from the name servers.
2) Nslookup nslookup is a command used to query DNS servers. Interactive mode gives permission to the user to query the name servers for getting information about hosts and domains. Non-interactive mode gives permission to the user for printing just the name and information that is requested for a particular host or domain.
3) Ping Ping is used for checking the network layer status of the server.
4) Host
Host is used for DNS lookups. It resolves hostnames to IP addresses and vice versa.

### DHCP Test

A device entering a network gets an IP address, which is allocated by the DHCP server. IP address can be verified using ifconfig/ipconfig.

### Webserver Test

Open the web browser and enter the host name or the local IP address. If it is working, then the web server is up and running.

### Firewall Test

A client Can try to ping the servers which are blocked. If the response is request timed-out then, the firewall has blocked the client and it is working properly.
The client won't gain access to the webpage because it is forbidden.