DHCP Server in VigorSwitch

DHCP server is a function that is available in DrayTek layer 2+ Vigorswitches.

The DHCP server only needs to configured on the core switch and this will also help to reduce the workload on the main Internet router. It will continue to privide DHCP services even if the router is offline.

Devices connected to edge switches will also be assigned an IP address from the core switch.

In addition the Bind IP to MAC function can also be used to assign a static IP address for important devices.

As a DHCP server, VigorSwitch assigns dynamic IP addresses for up to 8 VLANs.

 

Setting up the DHCP Server

To set up the DHCP server in the VigorSwitch follow the steps below:

  1. Go to Switch >> VLAN Management >> Create VLAN
  • Select ADD as Action
  • Enter the VLAN ID
  • Enter the VLAN Name

  1. Go to VLAN Routing >> Interface Settings
  • Select the VLAN ID we created in the previous step
  • Enter a description
  • Enter the IP address
  • Enter the Subnet Mask

  1. Go to Switch LAN >> DHCP server >> DHCP server Settings
  • Select the VLAN ID we created as Interface(VID)
  • Select Enable server as Mode
  • Enter in the Start IP address
  • Enter in the IP Pool Counts
  • Enter in the Gateway IP address
  • Click Apply to save the settings

The Status will now become Green Light showing “Server is running”

Testing the DHCP Server

Once the DHCP server is configured in the VigorSwitch you are ready to test it using the following procedure:

  1. Go to Switch LAN >> VLAN Management >> Interace Settings.
  • Select the required ports
  • Select Access as Interface VLAN mode
  • Enter the PVID that we created: 100
  • We can see VLAN ID 100 is automatically filled in Untagged VLAN
  • Click Apply

You can connect a PC to VigorSwitch and capture the packets to verify DHCP is working correctly.
As we can see below, 192.168.100.2 responds to the DHCP discover packets and assigns the PC an IP address.

Bind IP to MAC

DrayTek layer 2+ Vigorswitches also support the Bind IP to MAC feature. This can be used to reserve LAN IP addresses for certain devices.

With the DHCP server and Bind IP to MAC features, we could have a strengthening control in network.

To set up the Bind IP to MAC follow the steps below:

 

Go to Swtich >> LAN >> DHCP Server/Relay >> Bind IP to Mac

  • Enter the MAC address of the specific device
  • Enter the IP address for the specific device
  • Click Apply

 

 

DHCP Relay on VigorSwitch

DHCP clients use local broadcast packets to obtain IP addresses from the DHCP server. And in some situations, the DHCP server may not be in the same subnet as the DHCP clients. As a result, DHCP clients will not receive IP addresses from the DHCP server. In such a situation, we could configure DHCP Relay on VigorSwitch to make this work.

Please note that we couldn’t set up the DHCP server as the VigorSwitch built-in DHCP server

1. Go to Switch LAN >> VLAN Management >> Create VLAN, create two VLAN profiles as ID 10, 20.

2. Go to VLAN Routing >> Interface Setting, set up IP address and Subnet Mask for two VLAN profiles.

  • VLAN ID 10 192.168.10.2/255.255.255.0
  • VLAN ID 20 192.168.20.2/255.255.255.0

3. Go to Switch LAN >> DHCP Server/Relay >> DHCP Relay >> Global Setting.

  • Select Enable as Append Agent Option
  • Select Keep as Packets Contain Relay Agent Options
  • Click Apply

When we enable Append Agent Option, it allows the  VigorSwitch to add DHCP Option 82 to the forwarded DHCP packets.

When we select Keep as Packets Contain Relay Agent Options, it means all the packets will be forwarded, but the relay information which is already present will be ignored.

 

4. Go to Switch LAN >> DHCP Server/Relay >> DHCP Relay >> Interface Setting

  • Select VLAN20 as Interface(VID)
  • Enter in 192.168.10.10 as Server Address
  • Select As Global as Append Agent Option
  • Select As Global as Packets Contain Relay Agent Options

Testing DHCP Relay

1.  Go to Swtich LAN >> VLAN Management >> Interface Settings

  • GE2 Access PVID10, untag10
  • GE6 Access PVID20, untag20

2.  Go to Switch LAN >> Mirror, set up port mirror for GE2, GE6

2.  VigorRouter as the DHCP server

  • LAN2 on port5 without tag that connects to GE2
    Static Route: Des 192.168.20.0/24, Gateway 192.168.10.2, Interface: LAN2
  • Now we can connect a PC to GE6 and check the result and packet to confirm DHCP relay is working.

 

  • The PC sends out a broadcast DHCP discover
  • 192.168.10.2 forwards an unicast DHCP discover to DHCP server 192.168.10.10
  • DHCP server 192.168.10.10 replies an DHCP Offer to VLAN 20 192.168.20.2
  • 192.168.20.2 forwards the DHCP offer to the DHCP client(PC)
  • DHCP request and ACK are sent based on the same order
  • DHCP client get an IP address as 192.168.10.11