Configuring a LAN with DHCP and VLANs – PART I

March 2, 2019 | Views: 3123

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

While working on things which require time and more practice, sometimes you forget the baby steps you take along the way. That’s what happened when one of my colleagues asked a very simple question. I had to brainstorm different ideas in my mind before I finally had the answer. To explain the idea in a better way, learning by doing is the best approach.

My colleague wanted to know how the users on the LAN are assigned an IP Address. He logged onto each device on the network and found no DHCP related configuration on the devices. I actually had to re-think before answering him in the best possible way. For this purpose, I prepared a lab on EVE-NG. While brainstorming ideas for writing this blog, another idea popped up in my mind so I’m breaking the blog into two sections. In the first section, IP Address assignment for a single VLAN is shown. In the next section, multiple VLANs will be considered.

Below is a simple topology explaining the use of DHCP Server with a single VLAN.

vlan1

 

Let’s begin with the DHCP Server configuration. In the diagram above, Cisco IOS is used a DHCP server. However, DHCP server can also be set up on Windows or Linux OS.

 

Initially, there’s no DHCP server setup on the router. Let’s try to fetch an IP Address first from Host1. As expected, Host 1 will never receive any IP Address from DHCP server.

Host1> ip dhcp
DDD
Can’t find dhcp server

 

Let’s configure the DHCP Server on the Cisco IOS. Configure the DHCP Pool and assign an IP address on interface Ethernet0/0.

 

ip dhcp pool VLAN_ONE
network 192.168.1.0 255.255.255.0
!
interface Ethernet0/0
ip address 192.168.1.1 255.255.255.0

 

By default, all the ports on the switch reside in VLAN1 as can be confirmed from the output below. This means that all the hosts are in the same broadcast domain and the DHCP server will assign an IP address to each of the hosts in VLAN1.

 

Switch#show vlan

VLAN             Name             Status             Ports
—- ——————————– ——— ——————————-
1               default              active             Et0/0, Et0/1, Et0/2, Et0/3
<output omitted>

 

Once the DHCP pool has been configured, let’s run the ip dhcp command on the hosts to fetch an IP Address from the DHCP.

 

Host1> ip dhcp
DDORA IP 192.168.1.2/24

Host1> ping 192.168.1.1

84 bytes from 192.168.1.1 icmp_seq=1 ttl=255 time=1.393 ms
84 bytes from 192.168.1.1 icmp_seq=2 ttl=255 time=1.283 ms
84 bytes from 192.168.1.1 icmp_seq=3 ttl=255 time=1.077 ms
84 bytes from 192.168.1.1 icmp_seq=4 ttl=255 time=1.104 ms
84 bytes from 192.168.1.1 icmp_seq=5 ttl=255 time=1.228 ms

 

As expected, Host1 has been assigned an IP address from the DHCP pool. The same command can be run on Hosts 2 and 3 for IP Address assignment from the DHCP server.

 

Host2> ip dhcp
DDORA IP 192.168.1.3/24

Host3> ip dhcp
DDORA IP 192.168.1.4/24

 

In the next section, we will consider the same topology but with multiple VLANs configured.

 

Share with Friends
FacebookTwitterLinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterLinkedInEmail
Ready to share your knowledge and expertise?
Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Support Cybrary

Donate Here to Get This Month's Donor Badge

 

Cybrary|0P3N

Is Linux Worth Learning in 2020?
Views: 295 / December 14, 2019
How do I Get MTA Certified?
Views: 893 / December 12, 2019
How much does your PAM software really cost?
Views: 1344 / December 10, 2019
How Do I Get into Android Development?
Views: 1723 / December 8, 2019

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel