How to configure the switch to perform DHCP service in a VLAN

Zyxel_Arisa
Zyxel_Arisa Posts: 25  Zyxel Employee
First Answer First Comment Friend Collector
edited November 7 in Port & VLAN settings

The example shows administrators how to configure the switch to provide dynamic IP addresses to hosts in each VLANs.

Note:

All network IP addresses and subnet masks are used as examples in this article. Please replace them with your actual network IP addresses and subnet masks. This example was tested using XGS4600-32 (Firmware Version: V4.50).

Only L3 Switch supports the function of DHCP Server. (The models: 3700 series, 3800 series, 4500 series and 4600 series)


1.Configure VLAN 10

1-1. Use AdministratorPC to create VLAN 10. Enter the web GUI and go to Menu > Advanced Application > VLAN > VLAN Configuration > Static VLAN Setup. Check the ACTIVE box. Type the Name and VLAN Group ID=10. Select port 1 as Fixed and uncheck Tx Tagging (Untagged). Click “Apply”.

1-2. Go to Menu > Advanced Application > VLAN > VLAN Configuration > VLAN Port Setup. Set the PVID. Set port 1 as PVID=10 (VLAN 10). Click “Apply”.

1-3. Create a Static IP Address for Switch in VLAN 10 (IP Address to be DHCP Server in VLAN 10): Go to Menu > Basic Setting > IP Setup > IP Configuration > IP Interface. Set the Static IP Address: 192.168.10.1 for Switch in VLAN 10. Click “Add”.


2.Configure VLAN 20

2-1. Create VLAN 20. Follow the same steps. Go to Menu > Advanced Application > VLAN > VLAN Configuration > Static VLAN Setup. Check the ACTIVE box. Type the Name and VLAN Group ID=20. Select port 2 as Fixed and uncheck Tx Tagging (Untagged). Click “Apply”.

2-2. Go to Menu > Advanced Application > VLAN > VLAN Configuration > VLAN Port Setup. Set the PVID. Set port 2 as PVID=20 (VLAN 20). Click “Apply”.

2-3. Create Static IP Address for Switch in VLAN 20 (IP Address to be DHCP Server in VLAN 20): Go to Menu > Basic Setting > IP Setup > IP Configuration > IP Interface. Set the Static IP Address: 192.168.20.1 for Switch in VLAN 20. Click “Add”.


3.Configure the Switch and PC

3-1. Set up DHCP Server in VLAN 10: Go to Menu > IP Application > DHCP > DHCPv4 > Click Here > VLAN. Set up the VID (VLAN of PC-1) and DHCP Status as Server. The Client IP Pool Starting Address refers to the first IP Address the Switch will assign to DHCP clients. The Size of Client IP Pool refers to the maximum number of IP addresses the switch will provide. Set the gateway as the IP of the Switch in VLAN 10 (192.168.10.1). Click “Add”.

Note:

In this example, the pool size is 10 and the starting IP address is 192.168.10.11. Therefore, the IP range that the DHCP Server will assign is between 192.168.10.11 and 192.168.10.20.


3-2. Set up DHCP Server in VLAN 20: Go to Menu > IP Application > DHCP > DHCPv4 > Click Here > VLAN. Set up the VID (VLAN of PC-2) and DHCP Status as Server. The Client IP Pool Starting Address refers to the first IP Address the Switch will assign to DHCP clients. The Size of Client IP Pool refers to the maximum number of IP addresses the switch will provide. Set the gateway as the IP of the Switch in VLAN 20 (192.168.20.1). Click “Add”. Click “Add”.

Note:

In this example, the pool size is 10 and the starting IP address is 192.168.20.11. Therefore, the IP range that the DHCP Server will assign is between 192.168.20.11 and 192.168.20.20.


3-3. Set PC-1 and PC-2 as DHCP clients by configuring IPv4 to “Obtain an IP Address automatically”.


4.Test the Result

4-1. PC-1 can get the IP Address assigned by Switch successfully. We can check this by using the command “ipconfig” in command prompt. PC-1 will get an IP address in the range of: 192.168.10.11-192.168.10.20 and the gateway is 192.168.10.1.

4-2. PC-2 can get the IP Address assigned by Switch successfully. We can check this by using the command “ipconfig” in command prompt. PC-2 will get an IP address in the range of: 192.168.20.11-192.168.20.20 and the gateway is 192.168.20.1.


5.What Could Go Wrong

5-1. If some devices are no longer receiving any dynamic IP address from the DHCP server, consider increasing the Size of Client Pool.

5-2. If you want to surf the Internet using a URL or domain name, please remember to set up DNS Server.


Tagged: