Diff for /wikisrc/tutorials/how_to_set_up_a_dhcp_server.mdwn between versions 1.1 and 1.2

version 1.1, 2011/11/20 21:35:54 version 1.2, 2012/02/05 07:14:36
Line 1 Line 1
 Setting up a DHCP Server for your home or company network is pretty simple with NetBSD. You don't need to install any software, because everything you need, is part of the base system. Just create the file /etc/dhcpd.conf like this:  Setting up a DHCP Server for your home or company network is pretty simple with NetBSD. You don't need to install any software, because everything you need, is part of the base system. Just create the file /etc/dhcpd.conf like this: 
          
          
     deny unknown-clients;            deny unknown-clients;       
     ddns-update-style none;            ddns-update-style none;      
     subnet 192.168.0.0 netmask 255.255.255.0 {      subnet 192.168.0.0 netmask 255.255.255.0 {
             range 192.168.0.200 192.168.0.254;              range 192.168.0.200 192.168.0.254; 
             default-lease-time 28800;              default-lease-time 28800;
             max-lease-time 86400;              max-lease-time 86400;
             option broadcast-address 192.168.0.255;              option broadcast-address 192.168.0.255;
             option domain-name "mycompanydomainname.com";              option domain-name "mycompanydomainname.com";
             option domain-name-servers 194.152.64.35, 194.25.2.132;              option domain-name-servers 194.152.64.35, 194.25.2.132;
             option routers 192.168.0.1;              option routers 192.168.0.1;
             
             host ftp-server {              host ftp-server {
                     hardware ethernet 00:00:0a:d8:39:ee;                      hardware ethernet 00:00:0a:d8:39:ee;
                     fixed-address 192.168.0.199;                      fixed-address 192.168.0.199;
                     }                      }
             host sparc {              host sparc {
                     hardware ethernet 00:50:04:01:ee:20;                      hardware ethernet 00:50:04:01:ee:20;
                     fixed-address 192.168.0.198;                      fixed-address 192.168.0.198;
                     }                      }
     }      }
          
   
 Now add the service to your /etc/rc.conf. This way the DHCP will be started on every reboot.  Now add the service to your /etc/rc.conf. This way the DHCP will be started on every reboot. 
          
     dhcpd=yes      dhcpd=yes
     dhcpd_flags="-q ex0"      dhcpd_flags="-q ex0"
          
   
 ex0 is the Network Interface to listen on for dhcp requests. This is important if you have more than one Network Interface. If you don't, you can omit the second line.  ex0 is the Network Interface to listen on for dhcp requests. This is important if you have more than one Network Interface. If you don't, you can omit the second line. 
   
 Before starting the service, you have to create a lease file, that the dhcp server needs.  Before starting the service, you have to create a lease file, that the dhcp server needs. 
          
     # touch /var/db/dhcpd.leases      # touch /var/db/dhcpd.leases
          
   
 Now start the service:  Now start the service: 
          
     # /etc/rc.d/dhcpd start      # /etc/rc.d/dhcpd start
          
   
 To test if your dhcp server is running, run _dhclient_ on another host on the same network.  To test if your dhcp server is running, run _dhclient_ on another host on the same network. 
          
     # dhclient      # dhclient
          
   
 Also check your /var/db/dhcpd.leases file. That's it. Have fun.  Also check your /var/db/dhcpd.leases file. That's it. Have fun. 
   
 ##  Additional Information  ##  Additional Information 
   
   * [dhcpd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?dhcpd+8+NetBSD-current)    * [dhcpd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?dhcpd+8+NetBSD-current)
   

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb