03-03-2017 12:41 PM - edited 03-08-2019 09:36 AM
How can I assign IP addresses as shown in attachment using DHCP?
Solved! Go to Solution.
03-03-2017 01:07 PM
Hi
You should create the gateway for each subnet and dhcp scopes on the router. Also a router on a stick must be applied to this scheme. Please let me share the configuration.
ROUTER
Asumming you are using 2 differents vlans, for example 2 and 3
*Create sub interface where the vlan identifier will be applied through encapsulation dot1q, it will help us to enable the routing inter_vlan.
interface FastEthernet0/0
no ip address
no shutdown
!
interface FastEthernet0/0.2
encapsulation dot1Q 2
ip address 10.5.2.1 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 3
ip address 10.5.3.1 255.255.255.0
*Create the DHCP scopes.
ip dhcp excluded-address 10.5.2.1 <---- excluding the IP associated to the gateway of vlan 2
ip dhcp excluded-address 10.5.3.1 <---- excluding the IP associated to the gateway of vlan 3
ip dhcp pool DHCP-VLAN2
network 10.5.2.0 255.255.255.0
default-router 10.5.2.1
dns-server 8.8.8.8 4.2.2.2
!
ip dhcp pool DHCP-VLAN3
network 10.5.3.0 255.255.255.0
default-router 10.5.3.1
dns-server 8.8.8.8 4.2.2.2
SWITCH
You must configure the interface facing to the router as trunk. Example:
interface g1/1/1
description Point-to-Point_with_Router
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
Also remember to create the vlans on both switches. And the trunk interfaces between both switches.
conf t
vlan 2
name VLAN-X
vlan 3
name VLAN-Y
Please rate the comment if it is useful
:-)
03-03-2017 01:07 PM
Hi
You should create the gateway for each subnet and dhcp scopes on the router. Also a router on a stick must be applied to this scheme. Please let me share the configuration.
ROUTER
Asumming you are using 2 differents vlans, for example 2 and 3
*Create sub interface where the vlan identifier will be applied through encapsulation dot1q, it will help us to enable the routing inter_vlan.
interface FastEthernet0/0
no ip address
no shutdown
!
interface FastEthernet0/0.2
encapsulation dot1Q 2
ip address 10.5.2.1 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 3
ip address 10.5.3.1 255.255.255.0
*Create the DHCP scopes.
ip dhcp excluded-address 10.5.2.1 <---- excluding the IP associated to the gateway of vlan 2
ip dhcp excluded-address 10.5.3.1 <---- excluding the IP associated to the gateway of vlan 3
ip dhcp pool DHCP-VLAN2
network 10.5.2.0 255.255.255.0
default-router 10.5.2.1
dns-server 8.8.8.8 4.2.2.2
!
ip dhcp pool DHCP-VLAN3
network 10.5.3.0 255.255.255.0
default-router 10.5.3.1
dns-server 8.8.8.8 4.2.2.2
SWITCH
You must configure the interface facing to the router as trunk. Example:
interface g1/1/1
description Point-to-Point_with_Router
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
Also remember to create the vlans on both switches. And the trunk interfaces between both switches.
conf t
vlan 2
name VLAN-X
vlan 3
name VLAN-Y
Please rate the comment if it is useful
:-)
03-06-2017 06:43 AM
Thank you so much for your quick replay and sorry for my late response. That was really helpfull.
03-06-2017 06:48 AM
Hi
It was a pleasure my friend.
Have a great day!
:-)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide