Introduction: How to Configure DHCP in Cisco Packet Tracer

About: Electronic Engineer, please visit our web site http://www.sparkgt.org

In this tutorial we will configure IP addresses dynamically, for this will be done two examples configuring DHCP. The first configuration is through the router and the second is through a server.

I use 2 language for this instructable, the English and the Spanish.

Step 1:

Step 1: First configure the DHCP service on the router, so
we will first enable the two interfaces and place their respective IP addresses with their Subnet Mask.

To do this, the following commands will be written in global configuration for the R1 router:

Int Fa0/0

Ip address 172.16.0.1 255.255.255.0

No shutdown

Int Fa0/1

Ip address 172.16.1.1 255.255.255.0

No shutdown

Do write memory


Paso 1: De primero configuraremos el servicio DHCP en el router, para ello de primero habilitaremos las dos interfaces y le colocaremos sus respectivas direcciones IP con sus Subnet Mask.

Para ello se escribirán los siguientes comandos en configuración global para el router R1:

Int Fa0/0

Ip address 172.16.0.1 255.255.255.0

No shutdown

Int Fa0/1

Ip address 172.16.1.1 255.255.255.0

No shutdown

Do write memory

Step 2:

Step 2: Now you will proceed to enable a logical interface inside the router, this type of interfaces are very useful since these are always on if the router is on too. But it is good practice to always make sure that the logical interface is turned on.
To do this we will place the following commands in the global configuration:

Int loopback 1

Ip address 1.1.1.1 255.255.255.255

No shutdown

Paso 2: Ahora se procederá a habilitar una interfaz lógica dentro del router, este tipo de interfaces son muy útiles ya que estas siempre están encendidas media vez el router este encendido. Pero es una buena práctica siempre asegurarnos de que la interfaz lógica esta encendida. Para ello colocaremos los siguientes comandos en la configuración global:

Int loopback 1

Ip address 1.1.1.1 255.255.255.255

No shutdown

Step 3:

Step 3: To configure the DHCP you must know which network address we want to provide, which is the Subnet Mask and which is the Default Gateway on the network. As optional we can also exclude certain IP addresses to reserve them or simply because we do not want to use them and we can also configure a DNS service where we will place an address that we want, it is worth repeating that these last two configurations are optional since the DHCP service can Work perfectly well without these.
The commands to use are as follows:

Ip dhcp excluded-address 172.16.0.1 172.16.0.10

Ip dhcp pool NET1

Network 172.16.0.0 255.255.255.0

Default-router 1.1.1.1

Dns-server 8.8.8.8

Exit

Ip dhcp excluded-address 172.16.1.1 172.16.1.10

Ip dhcp pool NET2

Network 172.16.1.0 255.255.255.0

Default-router 1.1.1.1

Dns-server 8.8.8.8

Exit

Note that for the Default Gateway we will use the loopback address 1, we could also have put any address of the physical interfaces of the router R1 but for ease we will place in default-router 1.1.1.1. It should also be mentioned that the address 8.8.8.8 that was put in the DNS service is like a demonstrative purpose.

Paso 3: Para la configuración del DHCP se debe de tomar en cuenta cual es la dirección de red que queremos proporcionar, cual es la Subnet Mask y cuál es la Gateway de la red. Como opcional también podemos excluir ciertas direcciones IP para reservarlas o simplemente porque no las queremos usar y también podemos configurar un servicio DNS en donde colocaremos una dirección que nosotros deseemos, cabe repetir de que estas dos últimas configuraciones son opcionales ya que el servicio de DHCP puede funcionar perfectamente bien sin estas. Los comandos a utilizar son los siguientes:

Ip dhcp excluded-address 172.16.0.1 172.16.0.10

Ip dhcp pool NET1

Network 172.16.0.0 255.255.255.0

Default-router 1.1.1.1

Dns-server 8.8.8.8

Exit

Ip dhcp excluded-address 172.16.1.1 172.16.1.10

Ip dhcp pool NET2

Network 172.16.1.0 255.255.255.0

Default-router 1.1.1.1

Dns-server 8.8.8.8

Exit

Hay que tomar en consideración que para el Default Gateway usaremos la dirección de loopback 1, también se pudo haber puesto cualquier dirección de las interfaces físicas del router R1 pero por facilidad colocaremos en default-router 1.1.1.1. También hay que mencionar que la dirección 8.8.8.8 que se puso en el servicio DNS es como un fin demostrativo.

Step 4:

Step 4: We now need to require DCHP services on the respective physical interfaces of the router. We must be very careful that we are requiring the DHCP service in the correct interface, for this we must note that the address of the interface matches the address of the DHCP together with the subnet mask, to require the service we must use the address of the Default-router.
To prevent confusions in this step we will only configure the DHCP request on the Fa0/0 interface. The commands are:

Int Fa0/0

Ip helper-address 1.1.1.1

Paso 4: Ahora debemos de requerir los servicios de DCHP en las respectivas interfaces físicas del router. Debemos de ser muy precavidos de que estamos requiriendo el servicio DHCP en la interfaz correcta, para ello debemos de notar que la dirección de la interfaz coincida con la dirección del DHCP junto con la subnet mask, para requerir el servicio debemos de usar la dirección del default-router. Para evitar confusiones en este paso solo configuraremos la petición de DHCP en la interfaz Fa0/0. Los comandos son:

Int Fa0/0

Ip helper-address 1.1.1.1

Step 5:

Step 5: Now proceed to verify that if the IP addresses have been automatically distributed for the final devices that are connected to the Fa0/0 interface.
To do this we go to a laptop and select the IP Configuration option, then we have to click the DHCP option. It may take some time to give the address automatically but if we are sure that our configuration is fine we will not have to worry, there is a possibility that it will be late to give the address automatically, for that we can select the Static option and then DHCP again to get the IP address.

Paso 5: Ahora procederemos a verificar que si se hayan repartido automáticamente las direcciones IP para los dispositivos finales que estén conectados a la interfaz Fa0/0. Para ello entramos a una laptop y seleccionamos la opción IP Configuration, luego tenemos que darle click a la opción de DHCP. Puede tardar un cierto tiempo en dar la dirección automáticamente pero si estamos seguros de que nuestra configuración está bien no tendremos de que preocuparnos, hay una posibilidad de que se tarde para dar la dirección automáticamente, para eso podemos seleccionar la opción de Static y luego DHCP de nuevo para obtener la dirección IP.

Step 6:

Step 6: In this part we will configure the DHCP service for the Fa0/1 interface as it was done in Step 4, the commands we will use are:

Int Fa0/1

Ip helper-address 1.1.1.1

Do write memory

Paso 6: En esta parte configuraremos el servicio DHCP para la interfaz Fa0/1 así como se hizo en el Paso 4, los comandos que utilizaremos son:

Int Fa0/1

Ip helper-address 1.1.1.1

Do write memory

Step 7:

Step 7: We need to select the DHCP option on the laptops that are connected to the Fa0/1 interface as was done in Step 5.

Paso 7: Tenemos que seleccionar la opción de DHCP en las laptop que están conectadas a la interfaz Fa0/1 así como se hizo en el Paso 5.

Step 8:

Step 8: Now proceed to configure the DHCP service of the second form, in this method we have to configure it on a Server.

Paso 8: Ahora procederemos a configurar el servicio DHCP de la segunda forma, en este método tenemos que configurarlo en un Server.

Step 9:

Step 9: In this step we will configure the IP addresses for the physical interfaces. The programming will be done in the global configuration with the following commands:

Int fa0/0

Ip address 10.10.10.1 255.255.255.252

No shutdow

Int fa0/1

Ip address 172.32.0.1 255.255.255.0

No shutdow

Do write memory


Paso 9: En este paso configuraremos las direcciones IP para las interfaces físicas. La programación se hará en la configuración global con los siguientes comandos:

Int fa0/0

Ip address 10.10.10.1 255.255.255.252

No shutdow

Int fa0/1

Ip address 172.32.0.1 255.255.255.0

No shutdow

Do write memory

Step 10:

Step 10: In this step, select the server by selecting and clicking the Desktop option, then selecting IP Configuration to place an IP address together with the Subnet Mask and its default Gateway that matches the physical interface of the Router that is connected.

Paso 10: En este paso seleccionaremos el Server, para ello lo seleccionamos y le damos click a la opción de Desktop, luego seleccionamos IP Configuration para colocarle una dirección IP junto con su Subnet Mask y su Default Gateway que coincida con la interfaz física del router al que esta conectado.

Step 11:

Step 11: Now select the Services option and then the DHCP service.

Paso 11: Ahora seleccionamos la opción de Services y luego el servicio de DHCP.

Step 12:

Step 12: At this moment we have to select the option On to start the service and proceed to configure it, just like the DHCP programming on the router, it must match the network address we want to give you the service Ip addresses automatically.

We must take into account that the Default Gateway must be the Ip address of the interface where we will request the service, when we have everything configured we will click the Add button and then the Save button.

Paso 12: En este momento tenemos que seleccionar la opción On para poner en operación el servicio y procederemos a configurarlo, al igual que la programación de DHCP en el router, este debe de coincidir con la dirección de red que queremos brindarle el servicio de dar direcciones Ip de forma automática.

Hay que tomar muy en cuenta que la Default Gateway debe de ser la dirección Ip de la interfaz donde nos solicitarán el servicio, cuando tengamos todo configurado daremos click al botón de Add y luego al botón de Save.

Step 13:

Step 13: Then we will return to the configuration of the router to require the DHCP service of the Server, for this we must note that the service will be requested based on the IP address of the Server. The commands to be used will be programmed in the global configuration.

Int Fa0/1

Ip helper-address 10.10.10.2

Do write memory


Paso 13: Luego regresaremos a la configuración del router para requerir el servicio de DHCP del Server, para ello debemos de notar que se solicitará el servicio en base a la dirección IP del Server. Los comandos a utilizar se programarán en la configuración global.

Int Fa0/1

Ip helper-address 10.10.10.2

Do write memory

Step 14:

Step 14: Finally on a laptop select the option of Desktop and Ip Configuration, then select the DHCP option to receive the IP address automatically.

It should be remembered that if you do not give the address automatically you can implement the recommendations in Step 5.

Paso 14: Por último entraremos a un dispositivo final para seleccionaremos la opción de Desktop y Ip Configuration, luego seleccionaremos la opción de DHCP para recibir la dirección Ip de manera automática.

Se debe de recordar que si no da al principio la dirección de manera automática puede implementar las recomendaciones del Paso 5.

Makerspace Contest 2017

Participated in the
Makerspace Contest 2017