DHCP & Static IP

DHCP
Dynamic Host Control Protocol (DHCP) is a method for automating the assignment of IP addresses and other networking information. It is used on campus in residence halls and libraries, as well as over the wireless network.

Benefits of DHCP
i) Reliable IP address configuration.
DHCP minimizes configuration errors caused by manual IP address configuration, such as typographical errors, or address conflicts caused by the assignment of an IP address to more than one computer at the same time.

ii) Reduced network administration.

    • DHCP includes the following features to reduce network administration:
    • Centralized and automated TCP/IP configuration.
    • The ability to define TCP/IP configurations from a central location.
    • The ability to assign a full range of additional TCP/IP configuration values by means of DHCP options.
    • The efficient handling of IP address changes for clients that must be updated frequently, such as those for portable computers that move to different locations on a wireless network.


Why use DHCP
Every device on a TCP/IP-based network must have a unique unicast IP address to access the network and its resources. Without DHCP, IP addresses must be configured manually for new computers or computers that are moved from one subnet to another, and manually reclaimed for computers that are removed from the network.

DHCP enables this entire process to be automated and managed centrally. The DHCP server maintains a pool of IP addresses and leases an address to any DHCP-enabled client when it starts up on the network. Because the IP addresses are dynamic (leased) rather than static (permanently assigned), addresses no longer in use are automatically returned to the pool for reallocation.
The network administrator establishes DHCP servers that maintain TCP/IP configuration information and provide address configuration to DHCP-enabled clients in the form of a lease offer. The DHCP server stores the configuration information in a database, which includes:

  • Valid TCP/IP configuration parameters for all clients on the network.
  • Valid IP addresses, maintained in a pool for assignment to clients, as well as excluded addresses.
  • Reserved IP addresses associated with particular DHCP clients. This allows consistent assignment of a single IP address to a single DHCP client.
  • The lease duration, or the length of time for which the IP address can be used before a lease renewal is required.

A DHCP-enabled client, upon accepting a lease offer, receives:

  • A valid IP address for the subnet to which it is connecting.
  • Requested DHCP options, which are additional parameters that a DHCP server is configured to assign to clients. Some examples of DHCP options are Router (default gateway), DNS Servers, and DNS Domain Name. For a full list of DHCP options, see “DHCP Tools and Settings.”

DHCP server
A computer running the DHCP Server service that holds information about available IP addresses and related configuration information as defined by the DHCP administrator and responds to requests from DHCP clients.

DHCP client
A computer that gets its IP configuration information by using DHCP.

DHCP relay agent
Either a host or an IP router that listens for DHCP client messages being broadcast on a subnet and then forwards those DHCP messages directly to a configured DHCP server. The DHCP server sends DHCP response messages directly back to the DHCP relay agent, which then forwards them to the DHCP client. The DHCP administrator uses DHCP relay agents to centralize DHCP servers, avoiding the need for a DHCP server on each subnet. Also referred to as a BOOTP relay agent.

BOOTP
An older protocol with similar functionality; DHCP is based on BOOTP. BOOTP is an established protocol standard used for configuring IP hosts. BOOTP was originally designed to enable boot configuration for diskless workstations. Most DHCP servers, including those running Windows Server 2003, can be configured to respond to both BOOTP requests and DHCP requests.



To use DHCP commands interactively at the command prompt
1.Open Command Prompt.
2.Type netsh.
3.At the netsh> command prompt, type dhcp.
4.At the dhcp> command prompt, type:
server\\ServerName Or serverIPAddress
Where ServerName and IPAddress are the server that you want to manage.
5.Once connected, you can use any supported Netsh DHCP context command. Type /? or help to display the immediate context command menu, or type listto list all of the Netsh DHCP context commands available for use.

To configure Cisco IOS DHCP, follow these steps, which include sample commands:
Router(config)# interface ethernet0/0
Router(config-if)#ip address [ip add here] [subnet mask here]
Router(config-if)# no shutdown
Router(config)# ip dhcp pool mypool     #Create a DHCP IP address pool for the IP addresses you want to use.#
Router(dhcp-config)# network [network ip address] / [subnet mask]   
Router(dhcp-config)#domain-name mydomain.com     #Specify the DNS domain name for the clients.##
Router(dhcp-config)#dns-server [prefered dns server]  [alternate dns server]  #Specify the primary and secondary DNS servers #
Router(dhcp-config)#default-router [prefered dns server] #Specify the default router (i.e., default gateway)#
Router(dhcp-config)#lease 7 #Specify the lease duration for the addresses#
Exit Pool Configuration Mode.

Next, enter the ipconfig /renew command on the laptop to receive an IP address. After you have the IP address, enter the ipconfig /all command.





Static IP connection
Static IP addresses are manually assigned to a computer by an administrator. Even though IP addresses assigned using DHCP may stay the same for long periods of time, they can generally change. In some cases, a network administrator may implement dynamically assigned static IP addresses. In this case, a DHCP server is used, but it is specifically configured to always assign the same IP address to a particular computer. This allows static IP addresses to be configured centrally, without having to specifically configure each computer on the network in a manual procedure.
A static IP address is also preferred if the computer will be connecting to a Virtual Private Network (VPN), or allowing remote access with software like pcAnywhere™ orRadmin™. Software that provides remote access need only be configured once if the remote computer in question has a static IP address. If it has a changing address, the user will have to determine the remote IP each time, then reconfigure the software with the new address.

Advantages of Static IP

  • When hosting a website you are not sharing your IP with another company who sends out a lot of E-mail SPAM and not only has their website been shut down but in turn gets your IP address blacklisted.
  • In contrast a static IP address can become a security risk, because the address is always the same.
  • Static IP's are easier to track for data mining companies. 
  • Static IP addressing is less cost effective than Dynamic IP Addressing.



To add a static IP route
1.Open Command Prompt.
2.At the command prompt, type:
route add [destination mask] [subnetmask gateway] [metric cost] [metric exit interface]
For example, to add a static route to the 10.0.0.0 network that uses a subnet mask of 255.0.0.0, a gateway of 192.168.0.1, and a cost metric of 2, you type the following at a command prompt:
route add 10.0.0.0 mask 255.0.0.0 192.168.0.1 metric 2

Configuring Static Routes
1. Enter into Global Configuration Mode
2. Disable IP Routing
3. Re-enable IP Routing
4. Configure a static route with destination sub-network number, subnet mask ,and IP address of the next-hop router in the destination path.
R1enable
R1#configure terminal
R1(config)#no ip routing
R1(config)#ip routing
R1(config)# ip route [ip address] [subnet mask] [default gateway ip address]
Note: Used no ip routing to remove any previously configured routing information.

0 comments:

Post a Comment