Cisco – How to set up DHCP in tagged VLAN with Cisco 300 switch

ciscodhcpvlan

I have been searching for a while but not yet found the correct answer. First, I am pretty green with networking, so I will try to explain as precise as possible.

I am tasked with setting up a dhcp server on a tagged vlan. The dhcp server is a Debian machine with four interfaces, two of which are tagged with .100 and .200 respectively. Each of those is connected to the same Cisco SG300 52P. On the switch, I created two vlans, 100 and 200, and assigned a couple of ports to each of them. What I want to achieve is getting a lease when I plug into one of the vlan ports. I got it to work with untagged ports before, but as soon as I switch the ports to tagged, it's not working anymore.

I have the outgoing traffic from the server on the dhcp interfaces tagged with the correct vlan tag. Do I need to do the same somehow on the client machines that should get a lease in this vlan?

I am at it for a few hours now and don't exactly know where I am going wrong. Any hints are much appreciated. I'll also gladly provide further information as necessary.

Thanks a bunch in advance!

Best Answer

You have not explained your network very well. In general you would have something like this:

                       ----------
                       | Router |
                       ----------
                           |
                           | Trunk with tagged VLANs 100 and 200
                           |
                       ----------
                       | Switch |
                       ----------
                        | | | | Untagged interfaces to hosts

You connect your hosts, including the DHCP server to untagged interfaces that are assigned to one of the VLANs. Set up DHCP scopes for all your networks on the DHCP server, and configure DHCP relay (Cisco ip helper) on the VLAN interfaces in the router.

Some servers can be configured to understand VLANs tags and use a trunk. Unfortunately, server configurations are off-topic here.