cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1451
Views
15
Helpful
4
Replies

vlan trunking not work

CRUZPEREZ518
Level 1
Level 1

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..

4 Replies 4

luis_cordova
VIP Alumni
VIP Alumni

Hi @CRUZPEREZ518 

 

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

@luis_cordova 

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.

@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.

 

Jaderson Pessoa
*** Rate All Helpful Responses ***

Hi @CRUZPEREZ518 

 

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

Review Cisco Networking for a $25 gift card