07-02-2020 01:49 PM
Hello,
I have configured a dhcp pool on my router, later I assign that dhcp pool to a port of one of my switches, if I assign the dhcp pool vlan to a port of the switch in access mode if it works:
Switch (config-if) #switchport acces vlan 80
Switch (config-if) #switchport mode access
But if I configure it in this way it doesn't work:
Switch (config-if) #switchport trunk allowed vlan 1.80
Switch (config-if) #switchport mode trunk
I want to configure it as trunk allowed because I want to assign other vlan to that port besides the DHCP VLAN
Am I skipping any settings?
Any suggestion
Thank you..
07-02-2020 02:01 PM
In the router port you must assign subinterfaces, because that way the packets will leave the router with a vlan tag.
If you have DHCP pool for vlan 1 and vlan 80, then you can configure subinterface f0/x.1 and f0/x.80.
Without subinterfaces, packets leave the router without a vlan tag.
If you have the switch port assigned vlan 80, then the packets are tagged with that vlan, but, when in trunk mode, the packets are not tagged.
Regards
07-02-2020 02:11 PM
Thanks for your answer.
I already have created the subinterfaces on the router:
GigabitEthernet0 / 0.80 interface
description DHCP-POOL
encapsulation dot1Q 80
ip address 192.168.80.30 255.255.255.224
GigabitEthernet0 / 0.122 interface
description PRINTERS
encapsulation dot1Q 122
ip address 172.16.22.30 255.255.255.224
And on the Switch I have this configuration:
GigabitEthernet interface
description Port DHCP-POOL
switchport trunk allowed vlan 1.80
switchport mode trunk
spanning-tree portfast
To this port I am connecting a PC to which I want to be assigned IP by DHCP, but it only works when I leave with this configuration:
GigabitEthernet interface
description Port DHCP-POOL
switchport access vlan 80
switchport mode access
spanning-tree portfast
VLAN 1 is the default.
07-02-2020 02:20 PM - edited 07-02-2020 02:21 PM
@CRUZPEREZ518 hello my friend, it wont work, because trunk ports you need mark which vlan will be untagged to your pc, in this case, you can introduce native vlan,
GigabitEthernet interface
description Port DHCP-POOL
switchport trunk allowed vlan 1.80
switchport trunk native vlan 80
switchport mode trunk
spanning-tree portfast
To this port I am connecting a PC to which I want to be assigned IP by DHCP, but it only works when I leave with this configuration:
GigabitEthernet interface
description Port DHCP-POOL
switchport access vlan 80
switchport mode access
spanning-tree portfast
VLAN 1 is the default.
07-02-2020 04:22 PM
Effectively, end devices, such as PCs and Printers, must have a vlan assigned to the switch port to which they are connected.
In your case, the PC will receive addressing associated with the DHCP pool of vlan 80.
The PC generates a DHCP / request packet, which reaches the switch and is tagged with tag 80, configured on the switch port.
This DHCP packet leaves the switch with the tag 80 and is processed by the router subinterface .80.
Then the PC is assigned the address of the pool of vlan 80, since the router occupies the gateway address configured in the subinterface to know which address to assign.
Regards
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