# Data Networking/Fall 2014/Linux Project
## Introduction

This project is an attempt to create a network of devices on Linux (Ubuntu), an open source operating system .The project includes various network components. Below are servers and protocols, which are widely used in the Internet for efficient and secure communication.

## Objective

In this project we have implemented DHCP server and client model, DNS Query request on server, access to WEB SERVER , Firewall to restrict specific IP Addresses, VIRTUAL PRIVATE NETWORK(VPN),NETWORK FILE SYSTEM (NFS),NETWORK INFORMATION SERVICE(NIS) and Backup of our DNS SERVER on our LINUX(Ubuntu) System.

## Team Members

1. Abhimanyu Varshney
2. Dhaval Shashikant Jangale
3. Saumitra More
4. Shubham Shrivastava

## Concepts
### DNS Server

DNS is an application layer protocol. It is often referred as dictionary of Internet consisting of hostnames and their corresponding IP addresses. The use of DNS is to resolve a domain name to its IP address and vice-versa. It uses both TCP and UDP connections and its port is 53. When a client writes a hostname in the web browser, it makes a request to the DNS server to translate that hostname to its corresponding IP address, which is present in that DNS server.
I. First the client will send the query to translate hostname to the local DNS server
II. Then the local DNS server sends this request to the root DNS server, then root DNS server takes a look at the domain (ex. .com, .edu) and returns the list of IP addresses for TLD DNS servers responsible for that particular domain to local DNS server
III. Then again local DNS server resend the query to TLD DNS server, here TLD DNS server takes a look at TLD hostname and sends back the IP of authoritative DNS server to the local DNS server
IV. Then local DNS server sends query to authoritative DNS server, which will now respond with the desired IP address of the hostname typed by the client.

### DHCP Server

DHCP is defined by RFC 1541 along with revisions in RFC 2131. DHCP uses UDP connection and ports 67 and 68. There are 4 handshakes Discover, Offer, Request and Acknowledgement with which DHCP works. It’s a protocol used to lease an IP address to certain client for the desired period of time, which is connected to the network dynamically.
DHCP server’s operation is called as DORA process: I. Client Discover: Initially when client is on it sends IP as 0.0.0.0 255.255.255.255, which is called, Discover request.
II. Server Offer: After Discover, DHCP server offers an IP address to the client in Offer.
III. Client Request: After Server’s Offer, client makes official Request for IP address to DHCP server. (But the server has already given an IP address to that client, so client request is just sent for a sake of ACK from server)
IV. Server Acknowledgement: After official request from client, Server Acknowledges the Request from client.

### WEB Server

Web Server is used to create web pages. Web Server use port 80 to accept HTTP request and port 443 to accept HTTPS request. Apache is a Web Server and here we are using version 2.0. Here we have used HTML language to create the web page.

### Firewall

Firewall is used to guard an internal private network from external public network. To implement firewall, Firewall Configuration (UFW) software is used. Firewall can be hardware or software based. Firewall helps to provide security and privacy. Normally when a client make a request to certain hostname on its web server, it will see a web page if the hostname exists. But if that particular client is denied access to a webpage by using Firewall then after making the request, the client will not be able to browse the web page.

### Backup

Backup is used to take a backup of the files by synchronizing files and directories from one location to another. Backup is used so as to recover files in case of loss . Backup of the DNS Server on our Linux System has been implemented using Secure Shell (SSH).This will encrypt the data during the file transfer.

## Configurations
### DNS Configuration

* First step is to install bind (Berkley Internet Domain)
* Second step is to edit the local file to create zones. (Forward and Reverse zones)
* Next step is to edit options file to give forwarders.
* Next step is to create a directory named zones in bind
* Next step is to copy db.local and db.127 files from bind to zones
* Next step is to create resource records
* Next step is to edit resolv.config
* Next step is to edit hosts
* Final step is to start the bind9

### DHCP Configuration

* First step is to install DHCP server
* Next step is to edit interfaces
* Next step is to edit interfaces in isc-dhcp-server file (eth0)
* Next step is to edit dhcpd.config
* Final step is to start the DHCP server

### Web Server Configuration

* First step is to install apache2
* Next step is to go to html directory and open HTML file to edit the web page
* Next step is to edit the HTML file as required

### Firewall Configuration

* First step is to install ufw
* Next step is to write rules to allow and deny

### Backup Configuration

* First step is to install ssh and rsync packages on server and client side
* Next step is to check at the client whether it has received files or not

### Network Information Services

It provides the telnet access of the server on the client system. It is done by providing username and password on the client .This username and password is configured on NIS System on the server.
Cofiguration
Server Side: • First step is to install nis and portmap
* Next step is to edit Makefile
* Next step is to edit nis file
* Finally we have edit ypserv.securenets file to provide with range
Client Side: • Fisrt step is to install NIS and portmap
* Next step is to edit hosts file
* Next step is to edit yp.conf
* Next step is to edit nsswitch.conf

### Network File System

It creates an access to a file or folder on the server system to the client .We can read only (RO) or Read Write (RW) privileges for the file system .The client mounts the directory to retrieve the file.
Configuration
Server Side: • First step is to install nfs-kernel-server
* Next step is make a directory named DATA1
* Next step is to decide whetehr the client can read or write or both
* Next step is to check whether DATA1 is created or not
* Next step is to edit export file
* Finally restart the NFS
* Next step is used to check the mounted folder on the server and to which client it is mounted (192.168.1.103 is client’s IP address)
Client Side: • We have to write munt command in client’s machine (IP of server)

### VPN

VPN are employed in organizations were private access is needed to a particular client. For instance, in case of Northeastern University, Boston, it requires a VPN to have a private link to its Seattle campus.
Configuration
* First step is to install pptpd telnet iptables
* Then edit pptpd-options file
* Then edit pptpd.config
* Then edit chap-secrets

### DNS Load Balancing

It divides the traffic coming towards particular IP to more than one IP’s by providing similar hostname for different IP addresses.
Configuration • Edit the ankit.com.db file
* Check by doing nslookup

## Future Scope

1. A backup to the DNS server by providing secondary DNS server can be added
2. Routers can be added to see communication between hosts from different subnets.
3. NFS can be used to mount the entire files from the server to a desired client as a form of backup.
4. NFS can also be used to give desired file preference to the specific client.
5. Port Security can be added to the DHCP Server.