Различия
Здесь показаны различия между двумя версиями данной страницы.
Следующая версия | Предыдущая версия Последняя версия Следующая версия справа и слева | ||
wiki:руководство_по_ubuntu_server:сеть:dhcp [2012/05/20 11:03] создано |
wiki:руководство_по_ubuntu_server:сеть:dhcp [2013/01/14 22:49] [Протокол динамического выделения адресов (DHCP)] |
||
---|---|---|---|
Строка 18: | Строка 18: | ||
-- Имя хоста | -- Имя хоста | ||
-- Имя домена | -- Имя домена | ||
- | -- Адрес серввера времени | + | -- Адрес сервера времени |
-- Адрес сервера печати | -- Адрес сервера печати | ||
Строка 39: | Строка 39: | ||
====Установка==== | ====Установка==== | ||
- | At a terminal prompt, enter the following command to install dhcpd: | + | В теринале введите следующую команду для установки dhcpd: |
+ | <code>sudo apt-get install isc-dhcp-server</code> | ||
- | sudo apt-get install isc-dhcp-server | + | Возможно вам потребуется изменить настройку по умолчанию редактированием /etc/dhcp/dhcpd.conf для удовлетворения вашим потребностям и специфическим настройкам. |
- | You will probably need to change the default configuration by editing /etc/dhcp/dhcpd.conf to suit your needs and particular configuration. | + | Вы также можете исправить /etc/default/isc-dhcp-server для определения интерфейсов, которые должен слушать dhcpd. |
- | You also may need to edit /etc/default/isc-dhcp-server to specify the interfaces dhcpd should listen to. | + | <note>Обратите внимание, что сообщения dhcpd будут посылаться в syslog. Смотрите его для диагностики.</note> |
- | NOTE: dhcpd's messages are being sent to syslog. Look there for diagnostics messages. | + | ====Настройка==== |
- | ====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: | + | |
+ | В большинстве случаев, все что вам нужно сделать, это выделять случайный IP адрес. Это можно сделать следующими настройками: | ||
+ | <code> | ||
# minimal sample /etc/dhcp/dhcpd.conf | # minimal sample /etc/dhcp/dhcpd.conf | ||
default-lease-time 600; | default-lease-time 600; | ||
Строка 64: | Строка 63: | ||
option domain-name-servers 192.168.1.1, 192.168.1.2; | option domain-name-servers 192.168.1.1, 192.168.1.2; | ||
option domain-name "mydomain.example"; | option domain-name "mydomain.example"; | ||
- | } | + | }</code> |
- | + | ||
- | This will result in the DHCP server giving clients an IP address from the range 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 to use 192.168.1.254 as the default-gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers. | + | |
- | + | ||
- | After changing the config file you have to restart the dhcpd: | + | |
- | + | ||
- | sudo /etc/init.d/isc-dhcp-server restart | + | |
- | + | ||
- | ====References==== | + | |
- | The dhcp3-server Ubuntu Wiki page has more information. | + | В результате DHCP сервер будет выдавать клиентам IP адреса из диапазона 192.168.1.150-192.168.1.200. адреса будут предоставляться на 600 секунд, если клиенты не запросят специфический промежуток времени. При этом максимально разрешенное время аренды будет 7200 секунд. Сервер будет также "рекомендовать" клиентам использовать адрес 192.168.1.254 в качестве шлюза и 192.168.1.1 и 192.168.1.2 как DNS сервера. |
- | For more /etc/dhcp/dhcpd.conf options see the dhcpd.conf man page. | + | После изменения настройки вам потребуется перзапустить dhcpd: |
+ | <code>sudo /etc/init.d/isc-dhcp-server restart</code> | ||
- | ISC dhcp-server | + | ====Ссылки==== |
+ | -- [[https://help.ubuntu.com/community/dhcp3-server|Страница dhcp3-server Ubuntu Wiki]] содержит дополнительную информацию. | ||
+ | -- Для дополнительных опций /etc/dhcp/dhcpd.conf смотрите [[http://manpages.ubuntu.com/manpages/precise/en/man5/dhcpd.conf.5.html|страницу руководства]] | ||
+ | -- [[http://www.isc.org/software/dhcp|ISC dhcp-server]] | ||
---- | ---- |