Wednesday, May 13, 2015

VyOS Configure DHCP Server

Before configuring DHCP server, you should have IP address. Verify by typing show interfaces and press Enter.




Type show configuration and press Enter to check if dhcp server is already configured.



Type configure and press Enter to enter configuration mode.



type set service dhcp-server shared-network-name MyDHCP subnet 192.168.1.0/24 default-router 192.168.1.1 and press Enter. This will set the default router which should be the IP address of the interface eth0.



type set service dhcp-server shared-network-name MyDHCP subnet 192.168.1.0/24 start 192.168.1.1 stop 192.168.1.254 and press Enter.This will set the range of the IP address will less to DHCP clients.



type set service dhcp-server shared-network-name MyDHCP subnet 192.168.1.0/24 exclude 192.168.1.1 and press Enter. This will exclude 192.168.1.1 to lease because it is our router IP address.



type set service dhcp-server shared-network-name MyDHCP subnet 192.168.1.0/24 lease 86400 and press Enter. This will set how long the IP address will lease to DHCP clients.



type show configuration and press Enter to show the dhcp server configuration.


Watch this video for reference.


1 comment: