Monday, July 29, 2013

DHCP and Telnet

Dynamic Host  Protocol:

Before the start of the exercise we were grouped in pairs or threes where a person will configure their PC/ linux box to allow the other person's PC (computer A) to connect to the internet via computer B, meaning act as a router and DHCP server.



Here we set the appropriate firewall settings of Computer B


Here we used the the interface names that correspond to the NICS

The exercise was to allow the connecting PC to automatically configure their every time it connects to our network. That is without manually copying the contents of etc/resolv.conf from our PC to his

We editted the file dhcpd.conf and added the lines

default-lease-time 600;
max-lease-time 7200;
option domain-name "intranet.uplb.edu.ph";
option domain-name-servers 172.16.1;

these are global parameters that defines the domain name and addresses of the main server which is present in our etc/resolv.conf file 

 which allowed Computer A's resolv.conf file to be automatically editted with the following domain name and address of the main server


To show that Computer B is configured properly we use the command
cat /var/lib/dhcp3/dhcpd.leases
to view the lease file which contain the IP addresses currently on lease by the DHCP server


Telnet:

The last thing we did was to use the Hypertext transfer protocol using the command

$telnet www.google.com 80

GET /search?=joseph+hermocilla

which to our dismay didn't work as intended as we keep receiving an error message from the browser, after a bit of research from stackoverflow.com we found out the we need a complete address to get the search results which is

GET http://www.google.com/search?q=joseph+hermocilla HTTP/1.0

Answers:
1. iptable command parameters and their descriptions:

-F  used to flush the selected chain and delete all the previous rules one by one
-P  sets the policy for the given target
ACCEPT means let the packet through
INPUT for packets destined  to local sockets  
FORWARD  for packets being routed through the box
OUTPUT for locally-generated packets
-t    This option specifies the packet matching table which the command should operate on. 
nat    This table is consulted when a packet that creates a new connection  is encountered
-A    Append one or more rules to the end of the selected chain
POSTROUTING    for altering packets as they are about to go out
-o Name of an interface via which a packet is going to be sent 
-j This specifies the target of the rule; i.e., what to do if the packet matches it.
MASQUERADE    This target is only valid in the nat table, in the POSTROUTING chain.

2.Options used in the etc/dhcpd.conf are the domain-name and domain-name-server

3. To assign a fixed static IP address you need the ff. information:
IP address, netmask, network address, broadcast and gateway.





No comments:

Post a Comment