Network Setup: VLANs, DHCP, DNS, and Router Configuration
In today's world, it's important to create networks that save money and keep information safe.
This report explains how to connect and set up a network with three switches, each
connecting virtual networks, one main router, and two external servers. The aim is to make
sure all these devices work well together and can share information easily and assign ip
automatically by using DHCP server and activated DNS server .
This introduction provides an overview of the equipment: three switches (Switch 1, Switch 2,
and Switch 3) and the main router (Router 0).
Each switch connects to the router using a cable. In addition, each switch connects to two
separate networks called VLAN (Virtual Local Area Network), which is a technology that
allows you to divide the physical network into several smaller, isolated networks and is used
to improve security, reduce cost, and make network management easier .
Additionally, the network includes a DHCP (Dynamic Host Configuration Protocol) server
for automatic IP address assignment and a DNS (Domain Name System) server for
translating domain names to IP addresses
Network Topology Diagram showing Switches 1, 2, and 3 connected to Router 0 via cable. DHCP server,
DNS server, and VLANS
Task1 :
As shown in the picture above, the network infrastructure consists of three virtual LANs
(VLANs), each configured with specific IP addresses and subnet masks calculated using the
CIDR (Classless Inter-Domain Routing) table.
Below is a summary table detailing the ip and subnet of each VLAN:
Table 1
VLAN Name VLAN Num. IP Address Subnet Mask Default Gateway
Sales 1 20 10.0.0.2 255.255.248.0 10.0.0.1
ENG1 10 10.0.0.3 255.255.254.0 10.0.0.1
Sales 2 20 172.16.0.2 255.255.248.0 172.16.0.1
IT1 30 172.16.0.3 255.255.248.0 172.16.0.1
IT2 30 192.168.0.2 255.255.248.0 192.168.0.1
ENG2 10 192.168.0.3 255.255.254.0 192.168.0.1
after that we assign the vlan number and name in switch by using this command for the three
vlan for example:
SW1(config)#vlan 20
SW1(config-vlan)#name Sales
SW1(config-vlan)#exit
Then, We begin by defining the link between networks and the switch. We begin with the
network A ,When referring to the link between switch 1 and sales 1, it is given as ”Fa 0/2 “
and When we say "fa 0/2" for the link between switch 1 and sales 1, it means we're talking
about the specific connection at slot 0, port 2 on the switch. This helps us identify exactly
where that connection is on the device
After understanding that, we access the Command Line Interface (CLI) on the switch. Then,
we input the following command
SW1(config)#int fa0/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 20
SW1(config-if)#end
“switchport mode access” This command configures an interface on a Cisco switch to
operate in "access mode." In access mode, the interface belongs to a single VLAN and carries
traffic only for that VLAN
We use the same command for vlan 10 called ENG but the interface is ‘Fa0/3” :
SW1(config)#int fa0/3
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#end
so in this step we identify the vlans and the links
These methods are applied to the other switches (switch 2 and 3 ) by focusing on each
interface and assigning the appropriate VLAN number to them ,
To simplify this process, this table explain the interface and the vlan name and number :
Table 2
Switch Interface Vlan Number Vlan Name
Switch1 Fa 0/2 20 Sales1
Switch1 Fa 0/3 10 ENG1
Switch2 Fa 0/2 20 Sales2
Switch2 Fa 0/3 30 IT1
Switch3 Fa 0/2 30 IT2
Switch3 Fa 0/3 10 ENG2
In the next step, we determine the link between the switch and the router from the side of the
switch device in the same way that we used previously, we find the interface.
Then we use this command
SW1(config)#int fa0/1
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport access vlan 20
SW1(config-if)#end
Switchport mode trunk: This command configures an interface on a Cisco switch to be a
trunk port. A trunk port is used to carry traffic for multiple VLANs across a single physical
link between switches or between a switch and a router.
Now on the router side, interface fa 0/0 is designated as the interface connected to the link
between the switch and the router. but there are two network connect t in this cable , so we
use a sub interface way , access the cli in router then input this command
Router0(config)# interface Fa 0/0.20
Router0(config-subif)# encapsulation dot1q 20
Router0(config-subif)# ip address 10.0.0.1 255.255.248.0
Router0(config-subif)# ip address 10.0.0.1 255.255.254.0
“Router0(config)# interface Fa 0/0.20”:Subinterface: It allows the main physical interface
(Fa 0/0 in this case) to be divided into multiple virtual interfaces, each with its own
configuration. (20): Denotes that this subinterface is configured to handle traffic tagged with
VLAN ID 20. This allows the router to differentiate and process traffic from VLAN 20
separately from other VLANs on the same physical interface.
“Router0(config-subif)# encapsulation dot1q 20”: encapsulation dot1q: This command
specifies the VLAN encapsulation method for the subinterface. dot1q refers to IEEE 802.1Q,
which is the industry standard for VLAN tagging( 20): This number specifies the VLAN ID
(Virtual LAN Identifier) that will be tagged on incoming and outgoing Ethernet frames on
this subinterface.
In the last command, we used the Default Gateway (10.0.0.1), which was previously defined,
and used the subnet mask specific to each network.
We have done these steps for all the interfaces that connect the router to the switch
To simplify this process, this table explain the interface and the switch and the vlan :
Table 3
Router Interface Switch Vlan number
Router0 Fa 0/0 Switch1 20
Router0 Fa 0/1 Switch2 30
Router0 Eth1/0 Switch3 10
Router0 Eth1/1 Switch4 -
Task 2:
After configuring the server's IP address(172.17.0.10) and enabling the DHCP service, we
created multiple DHCP pools. Each pool was assigned a distinct name, and we adjusted the
IP addresses and subnet masks to align with the existing networks.
Following that, we activated the DNS(172.17.0. 11)server and assigned it an IP address and
default gateway. Subsequently, we enabled the DNS service and added a record for
"test.com"
.Instead of configuring DNS IP individually for each DHCP pool, we integrated it centrally
within the DHCP server settings.
And Since the router drop any broadcast messages by default, we used the `ip helper`
command.
The” ip helper “ command is employed to forward certain types of network traffic that are
typically broadcast or multicast packets (such as DHCP requests)
After access the cli mode of router , choose the right interface (in this case we use the
interface of the router where you want to enable the ip helper functionality for example
network A) and then assign the ip of server
So we use the following command :
interface Fa 0/0.20
ip helper-address 172.17.0.10
Now, if you activate DHCP on the A, B and C network, it will work correctly
Summary:
In summary, we set up a network using VLANs to separate different departments, configured
a router to manage traffic between these VLANs using sub interfaces, and ensured automatic
IP assignment through DHCP. Additionally, we enabled DNS for easy name-to-address
resolution and used the `ip helper` command to ensure DHCP requests reach the server across
VLAN boundaries. This setup ensures efficient communication, security, and simplified
network management.