User Tools

Site Tools


computers:dhcp_server_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computers:dhcp_server_configuration [2011/08/24 23:29] – [Configuration] chkuocomputers:dhcp_server_configuration [2020/08/16 00:52] (current) chkuo
Line 2: Line 2:
  
 ===== Installation ===== ===== Installation =====
-Download and install the dhcp3-server package+Download and install the package
 <code bash> <code bash>
-sudo apt-get install dhcp3-server+sudo apt-get install isc-dhcp-server
 </code> </code>
  
 ===== Configuration ===== ===== Configuration =====
-Specify the interfaces dhcpd should listen to in ''/etc/default/dhcp3-server'', for example:+Specify the interfaces dhcpd should listen to in ''/etc/default/isc-dhcp-server'', for example:
 <code bash> <code bash>
-INTERFACES="eth1+INTERFACESv4="eno1np0"
 </code> </code>
  
-Configure the interface used in ''/etc/network/interfaces'', for example:+Edit ''/etc/dhcp/dhcpd.conf'', for example:
 <code bash> <code bash>
-auto eth1 +# /etc/dhcp/dhcpd.conf 
-iface eth1 inet static +ddns-update-style none; 
-    address 192.168.0.1 +log-facility local7; 
-    netmask 255.255.255.0 +option domain-name-servers 192.168.1.1, 140.109.1.10, 8.8.8.8; 
-    gateway 192.168.0.254+default-lease-time 86400; 
 +max-lease-time 86400; 
 + 
 +subnet 192.168.1.0 netmask 255.255.255.0 { 
 + option routers                  192.168.1.1; 
 + option subnet-mask              255.255.255.0
 + option broadcast-address        192.168.1.255; 
 +  
 + range 192.168.1.200 192.168.1.250; 
 +
 + 
 +# printer 
 +host poplar { 
 + hardware ethernet XX:XX:XX:XX:XX:XX; 
 + fixed-address 192.168.1.11; 
 +
 + 
 +# server 
 +host oak { 
 + hardware ethernet XX:XX:XX:XX:XX:XX; 
 + fixed-address 192.168.1.21; 
 +
 + 
 +# workstation 
 +host sage { 
 + hardware ethernet XX:XX:XX:XX:XX:XX; 
 + fixed-address 192.168.1.101; 
 +}
 </code> </code>
  
-Edit ''/etc/dhcpd.conf'', for example:+===== Activation ===== 
 +To start/stop/restart the service: 
 +<code bash> 
 +sudo service isc-dhcp-server start 
 +sudo service isc-dhcp-server stop 
 +sudo service isc-dhcp-server restart 
 +</code>
  
-To start/stop/restart the service or to check the status:+===== Monitoring ===== 
 +To check dhcpd status:
 <code bash> <code bash>
-sudo /etc/init.d/dhcp3-server start +sudo service isc-dhcp-server status 
-sudo /etc/init.d/dhcp3-server stop +</code> 
-sudo /etc/init.d/dhcp3-server restart + 
-sudo /etc/init.d/dhcp3-server status+To see the leases: 
 +<code bash> 
 +more /var/lib/dhcp/dhcpd.leases
 </code> </code>
  
 ===== References ===== ===== References =====
   * [[https://help.ubuntu.com/10.04/serverguide/C/dhcp.html]]   * [[https://help.ubuntu.com/10.04/serverguide/C/dhcp.html]]
 +  * [[https://help.ubuntu.com/community/dhcp3-server]]
 +  * [[http://wiki.ubuntu-tw.org/index.php?title=UbuntuTW_Guide_ch15]]
 +
 +
computers/dhcp_server_configuration.1314199778.txt.gz · Last modified: 2011/08/24 23:29 by chkuo