01-08-2019 10:38 AM - edited 03-08-2019 04:58 PM
I am using a router as server dhcp.
And i set three pool in this router with their networks.
This router is connect to the port the switch.
This networks are in the different vlans.
My doubts:
How is it the router knows which client, that he should assign the ip address?
It is need to set trunk in the port tha connect switch with router ?
At the router , is it need to set subinterfaces ?
Solved! Go to Solution.
01-08-2019 10:45 AM - edited 01-08-2019 10:52 AM
Hi @eduangelo,
Effectively, the port of the switch that connects to the router must be in trunk mode.
In the router, you must configure subinterfaces and these must be encapsulated with the 802.1q protocol.
This method is called router-on-a-stick.
With the tag that you assign in the encapsulation, the router will filter to which vlan each DHCP request corresponds.
R(config )#interface <int>
R(config-if)#no shutdown
R(config)#interface <int.n°> <- I recommend it to be the same n° vlan
R(config-subif)#encapsulation dot1q <n°> <- n° vlan
R(config-subif)#ip address <ip> <másk>
Regards
01-08-2019 11:05 AM - edited 01-08-2019 11:12 AM
adding to other post you need IP helper address for the user to IP address from respected VLAN
example :
ip dhcp excluded-address 10.10.10.1
ip dhcp excluded-address 10.10.20.1
ip dhcp excluded-address 10.10.30.1
!
ip dhcp pool vlan10
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
dns-server x.x.x.x
ip dhcp pool vlan20
network 10.10.20.0 255.255.255.0
default-router 10.10.20.1
dns-server x.x.x.x
ip dhcp pool vlan30
network 10.10.30.0 255.255.255.0
default-router 10.10.10.1
dns-server x.x.x.x
!
!
interface x/x
no ip address
duplex auto
speed auto
!
interface x/x/0.10
encapsulation dot1Q 10
ip address 10.10.10.1 255.255.255.0
!
interface x/x/0.20
encapsulation dot1Q 20
ip address 10.10.20.1 255.255.255.0
!
interface x/x/0.30
encapsulation dot1Q 30
ip address 10.10.30.1 255.255.255.0
01-08-2019 11:09 AM
Hi @eduangelo,
The DHCP pools are configured in the global configuration mode, not in the subinterfaces.
Regards
01-08-2019 12:02 PM
01-08-2019 10:45 AM - edited 01-08-2019 10:52 AM
Hi @eduangelo,
Effectively, the port of the switch that connects to the router must be in trunk mode.
In the router, you must configure subinterfaces and these must be encapsulated with the 802.1q protocol.
This method is called router-on-a-stick.
With the tag that you assign in the encapsulation, the router will filter to which vlan each DHCP request corresponds.
R(config )#interface <int>
R(config-if)#no shutdown
R(config)#interface <int.n°> <- I recommend it to be the same n° vlan
R(config-subif)#encapsulation dot1q <n°> <- n° vlan
R(config-subif)#ip address <ip> <másk>
Regards
01-08-2019 11:05 AM
01-08-2019 11:09 AM
Hi @eduangelo,
The DHCP pools are configured in the global configuration mode, not in the subinterfaces.
Regards
01-08-2019 11:29 AM
01-08-2019 11:38 AM
01-08-2019 05:52 PM - edited 01-08-2019 05:59 PM
Hi, @luis_cordova
When i configure a dhcp server, i am obliged to the to set domain-name ?
This command is opcional in the configuration the dhcp server ?
Do i can to set two subnetworks for dns-server in the configuration dhcp ?
01-08-2019 06:01 PM
Hi @eduangel,
That command is not mandatory.
Now, you must remember that the parameters configured in the DHCP pool are the parameters that you want the devices connected to that network to acquire.
Therefore, if you do not assign a DNS server for your devices, they will not be able to resolve the names of the pages on the internet.
Regards
01-08-2019 11:05 AM - edited 01-08-2019 11:12 AM
adding to other post you need IP helper address for the user to IP address from respected VLAN
example :
ip dhcp excluded-address 10.10.10.1
ip dhcp excluded-address 10.10.20.1
ip dhcp excluded-address 10.10.30.1
!
ip dhcp pool vlan10
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
dns-server x.x.x.x
ip dhcp pool vlan20
network 10.10.20.0 255.255.255.0
default-router 10.10.20.1
dns-server x.x.x.x
ip dhcp pool vlan30
network 10.10.30.0 255.255.255.0
default-router 10.10.10.1
dns-server x.x.x.x
!
!
interface x/x
no ip address
duplex auto
speed auto
!
interface x/x/0.10
encapsulation dot1Q 10
ip address 10.10.10.1 255.255.255.0
!
interface x/x/0.20
encapsulation dot1Q 20
ip address 10.10.20.1 255.255.255.0
!
interface x/x/0.30
encapsulation dot1Q 30
ip address 10.10.30.1 255.255.255.0
01-08-2019 12:02 PM
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