Anda di halaman 1dari 4

23/3/2014

isc-dhcp-server - Community Help Wiki

Partners Support Community Ubuntu.com Login to edit


Search

isc-dhcp-server Dynamic Host Configuration Protocol (DHCP)


Contedo 1. Dynamic Host Configuration Protocol (DHCP) 2. Installation 3. Configuration 4. dhcp3-server and multiple interfaces 1. multiple interfaces example

The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host computers to be automatically assigned settings from a server as opposed to manually configuring each network host. Computers configured to be DHCP clients have no control over the settings they receive from the DHCP server, and the configuration is transparent to the computer's user. note: this package was in the past called dhcp3-server.

Installation
At a terminal prompt, enter the following command to install dhcpd:
s u d oa p t g e ti n s t a l li s c d h c p s e r v e r

You will probably need to change the default configuration by editing /etc/dhcp3/dhcpd.conf to suit your needs and particular configuration. You also need to edit /etc/default/isc-dhcp-server to specify the interfaces dhcpd should listen to. By default it listens to eth0. Also, you have to assign a static ip to the interface that you will use for dhcp. If you will use eth0 for providing addresses in the 192.168.1.x subnet then you should assign for instance ip 192.168.1.1 to the eth0 interface using NetworkManager. Without this step you will get an error from dhcpd when starting the service.
https://help.ubuntu.com/community/isc-dhcp-server 1/4

23/3/2014

isc-dhcp-server - Community Help Wiki

Configuration
The error message the installation ends with might be a little confusing, but the following steps will help you configure the service: Most commonly, what you want to do is assign an IP address randomly. This can be done with settings as follows:
n a n ow/ e t c / d h c p / d h c p d . c o n f #S a m p l e/ e t c / d h c p d . c o n f #( a d dy o u rc o m m e n t sh e r e ) d e f a u l t l e a s e t i m e6 0 0 ; m a x l e a s e t i m e7 2 0 0 ; o p t i o ns u b n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0 ; o p t i o nb r o a d c a s t a d d r e s s1 9 2 . 1 6 8 . 1 . 2 5 5 ; o p t i o nr o u t e r s1 9 2 . 1 6 8 . 1 . 2 5 4 ; o p t i o nd o m a i n n a m e s e r v e r s1 9 2 . 1 6 8 . 1 . 1 ,1 9 2 . 1 6 8 . 1 . 2 ; o p t i o nd o m a i n n a m e" m y d o m a i n . e x a m p l e " ; s u b n e t1 9 2 . 1 6 8 . 1 . 0n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0{ r a n g e1 9 2 . 1 6 8 . 1 . 1 01 9 2 . 1 6 8 . 1 . 1 0 0 ; r a n g e1 9 2 . 1 6 8 . 1 . 1 5 01 9 2 . 1 6 8 . 1 . 2 0 0 ; }

This will result in the DHCP server giving a client an IP address from the range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will lease an IP address for 600 seconds if the client doesn't ask for a specific time frame. Otherwise the maximum (allowed) lease will be 7200 seconds. The server will also "advise" the client that it should use 255.255.255.0 as its subnet mask, 192.168.1.255 as its broadcast address, 192.168.1.254 as the router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers. If you need to specify a WINS server for your Windows clients, you will need to include the netbios-name-servers option, e.g.
n a n ow/ e t c / d e f a u l t / d h c p 3 s e r v e r o p t i o nn e t b i o s n a m e s e r v e r s1 9 2 . 1 6 8 . 1 . 1 ;

Start and stop service


s u d os e r v i c ei s c d h c p s e r v e rr e s t a r t s u d os e r v i c ei s c d h c p s e r v e rs t a r t s u d os e r v i c ei s c d h c p s e r v e rs t o p

dhcp3-server and multiple interfaces


multiple interfaces example
Interface
n a n ow/ e t c / n e t w o r k / i n t e r f a c e s
https://help.ubuntu.com/community/isc-dhcp-server 2/4

23/3/2014

isc-dhcp-server - Community Help Wiki

a u t ol o i f a c el oi n e tl o o p b a c k m a p p i n gh o t p l u g s c r i p tg r e p m a pe t h 1 i f a c ee t h 1i n e td h c p a u t oe t h 0 i f a c ee t h 0i n e ts t a t i c a d d r e s s1 0 . 1 5 2 . 1 8 7 . 1 n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0 a u t ow l a n 0 i f a c ew l a n 0i n e ts t a t i c a d d r e s s1 9 2 . 1 6 8 . 1 . 1 n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0 u p / s b i n / i w c o n f i gw l a n 0m o d eT T T T T T& &/ s b i n / i w c o n f i gw l a n 0e n c r e s t r i c t e d& &/ s b i n / i w c o n f i gw l a n 0k e y[ Y ]X X X X X X X X& &/ s b i n / i w c o n f i g w l a n 0e s s i dS S S S S S S S a u t oe t h 1

Select Interface card


n a n ow/ e t c / d e f a u l t / i s c d h c p s e r v e r I N T E R F A C E S = " w l a n 0e t h 0 "

Configure Subnet
n a n ow/ e t c / d h c p 3 / d h c p d . c o n f d d n s u p d a t e s t y l en o n e ; l o g f a c i l i t yl o c a l 7 ; s u b n e t1 9 2 . 1 6 8 . 1 . 0n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0{ o p t i o nr o u t e r s o p t i o ns u b n e t m a s k o p t i o nb r o a d c a s t a d d r e s s o p t i o nd o m a i n n a m e s e r v e r s o p t i o nn t p s e r v e r s o p t i o nn e t b i o s n a m e s e r v e r s o p t i o nn e t b i o s n o d e t y p e2 ; d e f a u l t l e a s e t i m e8 6 4 0 0 ; m a x l e a s e t i m e8 6 4 0 0 ; 1 9 2 . 1 6 8 . 1 . 1 ; 2 5 5 . 2 5 5 . 2 5 5 . 0 ; 1 9 2 . 1 6 8 . 1 . 2 5 5 ; 1 9 4 . 1 6 8 . 4 . 1 0 0 ; 1 9 2 . 1 6 8 . 1 . 1 ; 1 9 2 . 1 6 8 . 1 . 1 ;

h o s tb l a 1{ h a r d w a r ee t h e r n e tD D : G H : D F : E 5 : F 7 : D 7 ; f i x e d a d d r e s s1 9 2 . 1 6 8 . 1 . 2 ; } h o s tb l a 2{ h a r d w a r ee t h e r n e t0 0 : J J : Y U : 3 8 : A C : 4 5 ; f i x e d a d d r e s s1 9 2 . 1 6 8 . 1 . 2 0 ; } }
https://help.ubuntu.com/community/isc-dhcp-server 3/4

23/3/2014

isc-dhcp-server - Community Help Wiki

s u b n e t 1 0 . 1 5 2 . 1 8 7 . 0n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0{ o p t i o nr o u t e r s o p t i o ns u b n e t m a s k o p t i o nb r o a d c a s t a d d r e s s o p t i o nd o m a i n n a m e s e r v e r s o p t i o nn t p s e r v e r s o p t i o nn e t b i o s n a m e s e r v e r s o p t i o nn e t b i o s n o d e t y p e2 ; d e f a u l t l e a s e t i m e8 6 4 0 0 ; m a x l e a s e t i m e8 6 4 0 0 ; h o s tb l a 3{ h a r d w a r ee t h e r n e t0 0 : K K : H D : 6 6 : 5 5 : 9 B ; f i x e d a d d r e s s1 0 . 1 5 2 . 1 8 7 . 2 ; } } 1 0 . 1 5 2 . 1 8 7 . 1 ; 2 5 5 . 2 5 5 . 2 5 5 . 0 ; 1 0 . 1 5 2 . 1 8 7 . 2 5 5 ; 1 9 4 . 1 6 8 . 4 . 1 0 0 ; 1 0 . 1 5 2 . 1 8 7 . 1 ; 1 0 . 1 5 2 . 1 8 7 . 1 ;

Check Route
i pr o u t e 1 9 2 . 1 6 8 . 1 . 0 / 2 4d e vw l a n 0 s c o p el i n k 8 2 . 1 6 . T T . 0 / 2 4d e ve t h 1 s c o p el i n k 1 0 . 1 5 2 . 1 8 7 . 0 / 2 4d e ve t h 0 s c o p el i n k d e f a u l tv i a8 2 . 1 6 . T T . U Ud e ve t h 1

isc-dhcp-server (ltima edio 2014-03-10 00:51:45 efectuada por hansdg1 @ dhcp24910.cis.ksu.edu[129.130.10.249]:hansdg1)

https://help.ubuntu.com/community/isc-dhcp-server

4/4

Anda mungkin juga menyukai