Cisco Network Academy provides plenty of learning resources in networking. I will cover how to configure basic DHCPv4 on a router and a DHCPv4 Server, and a DHCP relay agent using Packet Tracer where you can simulate network topologies and configurations.


Build Network and Configure Basic Device Settings



Topology topology

Addressing Table addressing-table

Create a new packet tracer file and set up routers and switches, devices.

The complete set-up without cabling should look like set-up-no-cabling

Since serial ports will be used between routers, the routers should have HWIC-2T which is a Cisco 2-Port Serial High-Speed WAN Interface Card, providing 2 serial ports.  HWIC-2T

Add connection

Make sure that cabling for R1 network is Copper straight-though, and cabling between the routers is Serial port (FYI, the interface Se0/0/0 at R1 and Se0/0/1 at R2 are DCE side)
Plus, double-check the topology and the addressing table so that the device and connection setting don’t go messy and you’re on the right track.
cabling


Configure basic settings for routers

When assigning IP addresses to each of the interfaces, make sure you follow the IP addressing form
ip-addressing-form

Open R1’s CLI and configure the interface g0/0, g0/1 and se0/0/0 with IP addresses according to the addressing table


Addressing Table addressing-table

g0/0

Router>en
Router#conf t
Router(config)#hostname R1
R1(config)#int g0/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit

g0/1

R1(config)#int g0/1
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit

se0/0/0
As the serial interface 0/0/0 at R1 is DCE (Data circuit-terminating equipment), clock rate must be configured. I will set it as 128000

R1(config)#int s0/0/0
R1(config-if)#ip address 192.168.2.253 255.255.255.252
R1(config-if)#clock rate 128000
R1(config-if)#no shut
R1(config-if)#exit

r1-ip-addressing

Open R2’s CLI and configure the interface se0/0/0 and se0/0/1 with IP addresses according to the addressing table


Addressing Table addressing-table

se0/0/0

Router>en
Router#conf t
Router(config)#hostname R2
R2(config)#int s0/0/0
R2(config-if)#ip address 192.168.2.254 255.255.255.252
R2(config-if)#no shut
R2(config-if)#exit

se0/0/1
Again, as the serial interface 0/0/1 at R2 is DCE (Data circuit-terminating equipment), clock rate must be configured. I will set it as 128000

R2(config)#int s0/0/1
R2(config-if)#ip address 209.165.200.226 255.255.255.224
R2(config-if)#clock rate 128000
R2(config-if)#no shut
R2(config-if)#exit

r2-ip-addressing


Open ISP’s CLI and configure the interface se0/0/1 with IP addresses according to the addressing table


Addressing Table addressing-table

se0/0/1

Router>en
Router#conf t
Router(config)#hostname ISP
ISP(config)#int s0/0/1
ISP(config-if)#ip address 209.165.200.225 255.255.255.224
ISP(config-if)#no shut
ISP(config-if)#exit


As you can see below, all the IP addressing is completed and the line protocols on all of the interfaces within the topology changed state to up showing green-colored up arrows (or triangles).

isp-ip-addressing

Configure dynamic, default, and static routing on the routers.

Before configuring a DHCPv4 Server and a DHCP Relay Agent, routing configuration over the routers should be done first in order for each of the routers to know adjacent networks based on the topology.


Configure RIPv2 for R1.

To automatically reroute the traffic around R1, configure RIPv2 on R1.

R1

R1>en
R1#conf t
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.0.0
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.2.0
R1(config-router)#no auto-summary
R1(config-router)#exit
R1(config)#exit
R1#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]

To check the ip route commands you’ve just done, type show ip route show-ip-route-r1


Configure RIPv2 for R2

Configure RIPv2 specifying RIP protocol, RIP version, network and no auto-summary.

R2

R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.2.0
R2(config-router)#no auto-summary


Configure a default route to the ISP on R2

Being still in the RIPv2 config mode, R2 with the command default-information originate gets ready to generate a static default route into RIPv2.
The command ip route 0.0.0.0 0.0.0.0 209.165.200.225 in the configuration mode (not in the RIPv2 mode) then enables R2 to configure a static route that matches all the packets (any IP addresses & any subnet mask) and sends all the packets out to the next hop of the ISP router.

R2(config-router)#default-information originate
R2(config-router)#exit
R2(config)#ip route 0.0.0.0 0.0.0.0 209.165.200.225
R2(config)#exit
R2#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]


R2 configures a static route to the ISP first and then advertises it to the other routers with RIPv2. default-route re-r2-command-ripv2-and-default-route




Configure a static route on ISP to reach out to the networks on the R1 and R2 routers


ISP also needs to know the networks over the other routers so configure routes statically.

ISP>
ISP>en
ISP#conf t
ISP(config)#ip route 192.168.0.0 255.255.255.0 209.165.200.226
ISP(config)#ip route 192.168.1.0 255.255.255.0 209.165.200.226

isp

isp-2


Configure a DHCPv4 Server on R2

Now, make R2 work as a DHCPv4 server.

On R2, configure:


DHCPv4 Server setting on R2 for R1’s 192.168.0.0 network

R2>en
R2#conf t
R2(config)#ip dhcp excluded-address 192.168.0.1 192.168.0.5
R2(config)#ip dhcp pool R1G0
R2(dhcp-config)#network 192.168.0.0 255.255.255.0
R2(dhcp-config)#default-router 192.168.0.1
R2(dhcp-config)#dns-server 209.165.200.225
R2(dhcp-config)#domain-name my-domain.com
R2(dhcp-config)#exit

What happens above is that you exclude the first five addresses of 192.168.0.0 network from .1 to .5 so that the rest of addresses can be available to be leased to clients. Make sure you do not exclude the network address 192.168.0.0
You then define the DHCP pool and its name for the network. You can set any other name but picking up something simple and obvious name helps your life a lot easier.
After that, define the network with its subnet mask and the default router so that client can use it as the default gateway.
You then set up DNS server (ISP) and give the domain name. You don’t have to set up domain name, but it’s available from the Packet Tracer 7.3


DHCPv4 Server setting on R2 for R1’s 192.168.1.0 network

Do the same as above with a set of the following values for 192.168.1.0 network of R1.

R2(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.5
R2(config)#ip dhcp pool R1G1
R2(dhcp-config)#network 192.168.1.0 255.255.255.0
R2(dhcp-config)#default-router 192.168.1.1
R2(dhcp-config)#dns-server 209.165.200.225
R2(dhcp-config)#domain-name my-domain.com

dhcp-server-re


Configure a DHCP Relay Agent

Make R1 work as an relay agent.
On R1, you will configure IP helper addresses in order to forward all DHCP requests to the DHCP server, which is R2 in our scenario.

R1>en
R1#conf t
R1(config)#int g0/0
R1(config-if)#ip helper-address 192.168.2.254
R1(config-if)#exit
R1(config)#int g0/1
R1(config-if)#ip helper-address 192.168.2.254
R1(config-if)#exit


In each of the interfaces at R1, the command ip helper-address 192.168.2.254 indicates 192.168.2.254 which is the serial port 0/0/0 at R2. ip-helper-addresses-at-R1


Request an IP address from the DCHP Server

Once you enable DHCP by clicking the DHCP radio button on each of the end devices (PCs), each of them receives the first available IP address except the excluded addresses. r2-show-run

As seen below, PC-A takes 192.168.1.6 and PC-B takes 192.168.0.6 dhcp-enabled-at-devices

By typing show ip dhcp binding on R2 (server), you can view current DHCP address leases. show ip dhcp binding

convert your manuscript to epub (fiverr gig @whatthehekkist) convert your manuscript to epub (fiverr gig @whatthehekkist) dedicated assistance to your jekyll website, blog, portfolio, or project (fiverr gig @whatthehekkist) dedicated assistance to your jekyll website, blog, portfolio, or project (fiverr gig @whatthehekkist)



What The Hekk is HTML/CSS/JS? a complete guide to creating a web app in 5 min from scratch!

Kindle Edition

What The Hekk is HTML/CSS/JS? a complete guide to creating a web app in 5 min from scratch!

PDF






You May Also Enjoy

  • Web Dev

    [Gitpod] 웹에서 코딩하기

    2022-07-12

    Gitpod은 오픈소스 원격 개발 플랫폼이다. 이미 굉장히 많은 사용자들이 있고, 이 블로그 또한 처음부터 Gitpod 사용했다. 개인적으로 생각하는 Gitpod의 가장 큰 장점은 사용자가 본인 컴퓨터에 로컬 개발환경 세팅에 시간을 너무 많이 투자해야 할 필요가 없고, 모든 걸 Gitpod이 제공하는...

  • Web Hack

    Insert screenshot into Markdown doc in a second

    2022-07-11

    # What is Markdown? [Markdown](https://www.markdownguide.org/getting-started/) is a free open-source web-focused markup language that gives you hassle-free writing experiences (indeed, once you get familiar with it). As you can so easily find many of how-to-posts on syntax, structure, and so on...

  • Web Dev

    what is switch statement?

    2023-05-26

    what is switch statement? switch statement is a conditional statement in JS (and in most programming languages) to execute a certain action over multiple inner blocks called case. switch takes an expression (input condition) that looks for a match...

  • Web Dev

    Nelify에 Jekyll 웹사이트 배포하기

    2022-07-10

    정적 웹사이트나 블로그에 관심이 많다면 [Jekyll](http://Jekyllthemes.org/)에 대해 들어 봤을 것이다. 간단한 구글링만으로도 Jekyll을 사용하여 어떻게 웹사이트나 블로그를 만드는지 쉽게 알 수 있다. 이 블로그 또한 Jekyll 기반이고, [Better Jeong](https://betterjeong.github.io/blog/21042701/)님과 [Jihye Leee](https://www.jihyeleee.com/blog/third-designer-can-make-Jekyll-blog/)님의 블로그 포스트를 참고하여 커스터마이징하였다. # Nelify에 배포하기 Jekyll기반 블로그를...

  • ebook

    6 Useful Hacks for ebook Publish in 2023

    2023-07-19

    # Choose a legit ebook editing software/program If you plan to write and publish an ebook, it's best practice to pick a robust ebook editing program for your manuscript. There are plenty of ebook editing softwares/programs you can go for...