in NDD430

Objective
To run a small scale network using Linux as router and Windows server as DHCP  & DNS server which will server DHCP & DNS request across the network using router as a medium to serve clients. Also, installing service such as a web server (IIS & Apache) on two different servers serving on a custom port.
Prerequisite: Completion of Check point 1

Step One – Installing & Setting Up an Apache2 Web Server

 

  1. Log in as root
    [root@router ~]$ su -
  2. Update the package list and upgrade the server if not done in the previous check point:
    [root@router ~]$ apt-get update -y && apt-get upgrdae -y
  3. Install the apache2 server:
    [root@router ~]$ apt-get install apache2 -y
    
  4. Enable and Start apache2:
    [root@router ~]$ systemctl enable apache2 && systemctl start apache2
    
  5. By default the apache2 port is pointed to port 80. To change port 80 to 8383 edit the file /etc/apache2/ports.conf using your favourite editor:
    [root@router ~]$ nano /etc/apache2/ports.conf
  6. Change 80 to 8383 as shown below:
    # If you just change the port or add more ports here, you will likely also
    # have to change the VirtualHost statement in
    # /etc/apache2/sites-enabled/000-default.conf
    
    Listen 8383
    
    ---
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
  7. After changing/modifying any configuration file it is necessary to restart the service:
    [root@router ~]$ systemctl restart apache2

Open up your browser and visit localhost:8383 as shown below to see changes:Click to view in a Large size


Step Two – Installing & Setting Up IIS on Windows Server 2012 R2

  1. Log in to the administrator account and Launch server manager.
  2. Click On Manage and then Add Roles and Features. 
  3. Keep clicking next until the page Server Roles. 
  4. Scroll down and Check the check box beside Web Server (IIS) and Accept. 
  5. Keep Clicking Next and then Install.

Close the pop up window after installation

Click to view the GIF in a Large size

  1. Launch IIS
  2. In the left pane keep expanding until Default site and Double click it.
  3. In the right pane of default site click Bindings, change IP Address to your desired IP and change Port to 9393 and fill in your Host Name for example ‘winserv.username.com’.
  4. Close the pop up and Restart the website by click Restart in the right pane

Click to view the GIF in a Large size

Launch Internet Explorer and Visit IP:PORT to view your web page

Note: Visiting the site using your host name will not work because DNS has not been configured yet.


Step Three – Installing & Setting Up DNS & DHCP On Windows Server 2012 R2

  1. As step two, Launch Server Manager and Click On Manage and then Add Roles and Features. Keep clicking next until the page Server Roles.
  2. Scroll down and Check the check box beside DHCP Server & DNS Server, click Add Features when a pop appears.
  3. Click next through all the pages until “Confirm Installation Process” and proceed to Install.

Click the gif to open in a new tab

Setting Up DNS

  1. In server Manager click Tools and in the drop down click DNS.
  2. In the DNS Manager window double click the computer name int the left pane under DNS.
  3. Right click Forward Lookup Zones and the New Zone to create a new Forward Lookup Zone.
  4. Keep clicking next in the New Zone Wizard Window until Zone Name page.
  5. In the Zone Name Page enter a zone name (domain name) and keep clicking next and the Finish.

Instructions are similar to create the Reverse Lookup Zone.

Adding Hosts to DNS Zone

  1. Double click click the Zone just created.
  2. Right click in the right pane and click New host (A or AAAA).
  3. Enter the name of the host in the Name field and the IP address of the host in the IP address field.
  4. Check the box before Create associated pointer (PTR) record and click Add Host.
  5. Repeat the process to add additional hosts.

After adding hosts, either reload DNS or Update Server Data file.

03 - Adding Hosts

 

Setting Up DHCP

  1. Launch DHCP Console.
  2. In the right pane click on the servers hostname to expand.
  3. Select and Right click IPv4 and select New Scope.
  4. Click Next.
  5. In Scope Name window type in a Scope Name and it’s Description and click next.
  6. In the IP Address Range window add a starting IP address and Ending IP Address (Make sure the subnet mask is correct). Click Next.02 - IP Address Range
  7. In ‘Add Exclusive and Delay’ Add an IP address range or just a single IP to exclude from the DHCP OFFER and Click Next when Done.
  8. Keep clicking next until Router (Default Gateway) screen.
  9. Add the IP Address of your router and Click Next.
  10. In the Domain Name and DNS Servers add the DNS Server if not automatically added and Click Next.
  11. Keep clicking Next and the Finish.

Click on GIF to open in a new tab

 


Step Four – Installing & Setting Up DHCP-Relay On Linux Router (Debain 8)

In this step, isc-dhcp-relay will be used as a relay to forward DHCP packets between Client and the DHCP server.

  1. Log in as root:
    [root@router ~]$ su -
  2. Install isc-dhcp-relay:
    [root@router ~]$ apt-get install isc-dhcp-relay -y
  3. Edit the file /etc/default/isc-dhcp-relay
    [root@router ~]$ nano /etc/default/isc-dhcp-relay
  4. Add the address of your server in the line where it says SERVERS in between the quotes.
    SERVERS="195.165.8.70"
  5. Add the interfaces of the client and DHCP server where it states INTERFACES.
    INTERFACES="eth1 eth3"
  6. To apply changes restart the isc-dhcp-relay
    [root@router ~]$ systemctl restart isc-dhcp-relay

A sample isc-dhcp-relay file when completed.

# Defaults for isc-dhcp-relay initscript
# sourced by /etc/init.d/isc-dhcp-relay
# installed at /etc/default/isc-dhcp-relay by the maintainer scripts

#
# This is a POSIX shell fragment
#

# What servers should the DHCP relay forward requests to?
SERVERS="195.165.8.70"

# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
INTERFACES="eth1 eth3"

# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""

 


Step Five – Enabling IP Forwarding In Linux (Debian 8)

To make linux act as a router and send traffic from one interface to another, IP Forwarding need to be enabled.

  1. Log in as root
    [root@router ~]$ su -
  2. Edit the file /etc/sysctl.conf
    [root@router ~]$ nano /etc/sysctl.conf
  3. Uncomment the following line
    net.ipv4.ip_forward = 1
    
  4. To make changes take effect, run the command:
    [root@router ~]$ sysctl -p /etc/sysctl.conf
    

 

 

Leave a Reply