How to set up DHCP Server on VigorSwitch
- task_configuration, product_switch, tech_vlan, tech_dhcp, tech_dhcp_reservation
DHCP server on 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.
DHCP Server Setup
Go to Switch >> VLAN Management >> Create VLAN
- Select ADD as Action
- Enter in the VLAN ID
- Enter in the VLAN name
Go to VLAN Routing >> Interface Settings
- Select the VLAN ID we created in the previous step
- Enter in the description
- Enter in the IP address
- Enter in the Subnet Mask
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
The status will now become Grenn Light showing Server is running
DHCP Server Test
Once the DHCP server is configured in the VigorSwitch you are ready to test it by the following procedure Go to Switch LAN >> VLAN Management >> Interface Settings
- Select ports
- Select Access as Interface VLAN mode
- Enter in 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, 192.168.100.2 responds to the DHCP discover packets and get 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.
Go to Switch LAN >> DHCP Server/Relay >> Bind IP to MAC
- Enter in the MAC address of the specific device
- Enter in the IP address for the specific device
- Click Apply
- Details
How to set up DHCP Relay on VigorSwitch
- tech_routing, task_configuration, product_switch, tech_vlan, tech_dhcp, tech_dhcp_relay
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.
DHCP Relay Setup
Go to Switch LAN >> VLAN Management >> Create VLAN Create two VLAN profiles as ID 10, 20.
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
Go to Switch LAN >> DHCP Server/Relay >> DHCP Relay >> Global Setting.
- Select Enable as Append Agent Option
- Select Keep 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 Conatin Relay Agent Options, it means all the packets will be fowarded, but the relay information which is already present will be ignored.
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
DHCP Relay Test
Go to Switch LAN >> VLAN Management >> Interface Settings
- GE2 Access PVID10, untag10
- GE3 Access PVID20, untag20
Go to Switch LAN >> Mirror, set up port mirror for GE2, GE3.
We use a VigorRouter as the DHCP server
- LAN2 on port5 without tag that connects to GE2
- Static Route: Destination 192.168.20.0/24, Gateway 192.168.10.2, Interface: LAN2
Now we can connect a DHCP client(PC) to GE3 and capture the packets on GE14 to confirm the 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
- Details
How to configure DHCP Server on VigorSwitch?
- dhcp server, draytek, VigorSwitch G2282x, VigorSwitch P2540x, VigorSwitch G2280, VigorSwitch P1085, VigorSwitch G1085, VigorSwitch G2100, VigorSwitch G2280x, VigorSwitch P2280x, VigorSwitch P2282x, VigorSwitch G2500, VigorSwitch P2500, VigorSwitch G2540x, VigorSwitch P1280, VigorSwitch P2280, VigorSwitch G1280, VigorSwitch P2121, VigorSwitch P2100, switch, DHCP, bind ip to MAC, server, bind
Many DrayTek layer 2+ VigorSwitches, such as the VigorSwitch P2280x, support DHCP server feature. It allows the switch to assign IP addresses to its local clients. It can be beneficial for the uplink between the core switch and your router. The allocation of IP addresses will still work, if the router is offline. In addition to the DHCP services, the Bind IP to MAC function is available to assign a static IP address for printers, servers, IP phones and other local devices.
These can be useful if we want to stop DHCP services on the router so that it can handle more important tasks.
This article demonstrates how to configure a DHCP Server on a VigorSwitch. The setup will be completed with the Bind IP to MAC feature setup.
It is important to check that a static IP address is configured on the switch first.
- Navigate to [Switch LAN] > [General Setup] > [Management IP/VLAN] and set the Mode to 'Static'. Configure your static IP Address, Subnet Mask, and the Gateway IP which all should match with the IP range used on your router. In this example my router's LAN IP is 192.168.87.1. Hence the gateway address configured on the switch is the same.
It is also important to have DHCP services disabled on your router. Here is how to do this on the DrayTek Vigor routers.
- Navigate to [LAN] > [
General Setup] and open the Details Page 
- Under the DHCP Server Configuration section select 'Disable' and click OK to save the settings
Now your router does not provide DHCP services and should not conflict with a new server enabled on your VigorSwitch. Note that you may need to configure your computer with a static IP address as illustrated here so that access to the switch during the configuration process is available.
DHCP Server Setup on a VigorSwitch
1. Go to [Switch] > [VLAN Management] > [Create VLAN]
- Select ADD as Action
- Enter in the VLAN ID *
- Enter in the VLAN name
* - note that VLAN ID is required and will allow your switch to offer DHCP services to ports that are part of defined VLAN ID
2. Navigate to [VLAN Routing] > [Interface Settings]
- Select the VLAN ID created in the previous step
- Enter the description
- Enter the IP address
- Enter the Subnet Mask

3. In the [Switch LAN] > [DHCP Server Settings] section
- Select the matching VLAN ID as Interface (VID)
- Set Mode to Enable Server
- Enter the Start IP address
- Enter the IP Pool Counts
- Enter the Gateway IP address
- Click Apply

The DHCP Server Status should become green as illustrated below

VigorSwitch DHCP Server Test (optional)
4. The DHCP Server should be working. This can be tested with a computer connected to a selected port of our switch.
Go to [Switch LAN] > [VLAN Management] > [Interface Settings]
- Select a testing port(s)
- Set the Interface VLAN mode to Access
- Enter the PVID of your DHCP-enabled network. We have used 100
- Note that the VLAN ID 100 automatically populates as Untagged VLAN
- Click Apply

You can capture the packets to confirm that the DHCP handshake has occurred. Below, our switch on 192.168.100.2 responds to the DHCP Discover packets and assigns an IP address to the computer.

Bind IP to MAC (optional)
DrayTek layer 2+ VigorSwitches also support the Bind IP to MAC feature. This can be used to reserve LAN IP addresses for certain clients.
5. Link a MAC address of your device(s) with a selected IP address on [Switch LAN] > [DHCP Server/Relay] > [Bind IP to MAC] page
- Enter the MAC address of the specific device
- Specify its static IP address
- Click Apply

- Details
How to configure VLAN routing on a VigorSwitch
- VigorSwitch G2282x, VigorSwitch P2540x, VigorSwitch G2100, VigorSwitch G2280x, VigorSwitch P2280x, VigorSwitch P2282x, VigorSwitch G2540x, VigorSwitch P2100, wirespeed, static route, vlan routing, layer 3, Routing, Wire speed, ip routing
A DrayTek VigorSwitch provides connectivity for multiple network segments with 802.1Q VLAN tags, which separate networks at Layer 2 (MAC level). In a typical network that uses Layer 2 VLAN tags, the router provides the routing between VLANs, which can limit throughput between VLANs to the router's Firewall throughput, instead of the 1Gbps link speed.
The VigorSwitch P2280x and G2280x switches can be used to perform routing between separate networks at Layer 3 (IP level) for higher performance.
This guide demonstrates how to configure the VigorSwitch to provide fast routing between separate networks.
1. Create your VLAN's with the usual Trunk port, and tags.
In the following example we use port 3 on the router as a trunk.

2. Create the LANs to accommodate your network's needs.
We will be using just 2 subnets for this routing example, LAN2, and LAN3.

The LAN DHCP Gateway configuration must be set to use the Switch's VLAN Routing interface address, which will be configured later in this setup process.
For reference, the "192.168.111.1" address will be configured as the VigorSwitch's VLAN Routing gateway IP.
LAN Clients are directed to this address using the DHCP server, which will allow traffic to be routed through the VigorSwitch.
3. Create the VLAN's on the switch, under Switch LAN>> VLAN Management>> Create VLAN

The Switch has port 1 configured as a "Hybrid Port", that connects to port 3 on the Router.
Ports 4, and 5 of the switch were configured as "Access Ports", one on the "Voice" VLAN and one on the "Data" VLAN, for initial set up and testing of VLAN Routing.
4. Enable routing under VLAN Routing>> Properties>> Global settings

5. Create the interfaces on the switch for each VLAN
The Interface IP addresses need to be configured as suggested in step 2, these must not conflict with the router's LAN address.
These IP addresses will be used by the VigorSwitch for the purpose of IP Routing. The Subnet Mask should be the same as the subnet mask configured on the router for each of the LAN subnets.

6. Create a Default Route for traffic that doesn't match either of the 2 subnets
In the VLAN Routing>> Static Route section, add a new static route to use the Router's IP as the Default Route.
- Action: Add
- Destination IP Address: Tick "Default"
- Subnet Mask: This is greyed out when the "Default" option is selected
- Next Hop: Gateway
- Gateway IP Address: Specify the IP address of the Router.
Click Apply to create the Static Route, which will take effect immediately.
This sends traffic outside of the LAN(s) to the router, and ultimately out to the internet. If the default route is not set, there will be no traffic going out on the internet.
It is very important that the Gateway of the Default Route points to one of the Router's interfaces.

Controlling Routed Traffic
Since the router is not involved in the traffic that is routed between the Local LANs, the router's Firewall Filter Rules will not apply for this type of traffic.
Configure the Access Control List of the VigorSwitch to control traffic between the LAN subnets instead.
Troubleshooting
Use ICMP (Ping) to test the connectivity, and check the TCP settings as well.

Pinging a host on Data VLAN, comes back successful, with minimum of latency.
- Details

