Настройка dhcpd.conf

настройка
Ответить
Аватара пользователя
Роман Торопов
Администратор
Сообщения: 134
Зарегистрирован: 24 мар 2008, 10:49
Откуда: г. Пермь
Контактная информация:

Настройка dhcpd.conf

Сообщение Роман Торопов » 31 июл 2010, 16:09

Код: Выделить всё

ddns-update-style none;
# server
subnet 192.168.2.0 netmask 255.255.255.128 {
	# default gateway
	option routers 192.168.1.1;
	option subnet-mask 255.255.255.128;
	option domain-name "server";
	# Seting up an ip address is better here
	option domain-name-servers 10.0.59.10;
#	option nis-domain "server";
	range dynamic-bootp 192.168.2.2 192.168.2.126;
	default-lease-time 21600;
	max-lease-time 43200;
	# we want the nameserver to appear at a fixed address
	host hostname {
		hardware ethernet ff:00:ff:00:ff:00;
		fixed-address 192.168.2.2;
		}
	}

Аватара пользователя
Роман Торопов
Администратор
Сообщения: 134
Зарегистрирован: 24 мар 2008, 10:49
Откуда: г. Пермь
Контактная информация:

Re: Настройка dhcpd.conf с передачей прокс-сервера

Сообщение Роман Торопов » 31 июл 2010, 16:22

Передача настройки прокси-сервера:

На вэб-хосте создать файл wpad.dat
с текстом:

Код: Выделить всё

function FindProxyForURL(url, host) {
  if (isInNet(host, "192.168.0.0", "255.255.255.128")) {
     return "DIRECT";
    }
    if (isInNet(myIpAddress(), "192.168.0.0", "255.255.255.128")) {
    return "PROXY 192.168.0.1:3128";
    }
}
В настройке апача добавить строку:

Код: Выделить всё

AddType application/x-ns-proxy-autoconfig .dat
В настройке МIME добавить строку:

Код: Выделить всё

application/x-ns-proxy-autoconfig dat
В глобальной настройке DHCP добавить:

Код: Выделить всё

option wpad-url code 252 = text;
option wpad-url "http://192.168.0.1/wpad.dat\n";
# option wpad code 252 = text;
# option wpad "http://192.168.0.1/wpad.dat";
# option wpad-curl code 252 = text;
# option wpad-curl "http://192.168.0.1/wpad.dat\000";
В настройке браузера указать автоматическая настройка и путь к сценарию:

Код: Выделить всё

http://192.168.0.1/wpad.dat
Литература:
http://www.wlug.org.nz/WPAD
http://wiki.squid-cache.org/SquidFaq/Co ... _with_DHCP
http://opennet.ru/openforum/vsluhforumID12/2983.html

Аватара пользователя
Роман Торопов
Администратор
Сообщения: 134
Зарегистрирован: 24 мар 2008, 10:49
Откуда: г. Пермь
Контактная информация:

Re: Настройка dhcpd.conf дефолтовый конфиг

Сообщение Роман Торопов » 31 июл 2010, 16:44

Настройка dhcpd.conf - дефолтовый конфиг

Код: Выделить всё

ddns-update-style none;
allow booting;
allow bootp;

# Your dhcp server is not master on your network !
#not authoritative;
# Your dhcpd server is master on your network !
authoritative;
#not authoritative;

#Interface where dhcpd is active
DHCPD_INTERFACE = "eth2";
option wpad code 252 = text;
option wpad "http://192.168.0.1/wpad.dat";
# option wpad-curl code 252 = text;
# option wpad-curl "http://192.168.0.1/wpad.dat\000" ;

# Definition of PXE-specific options
# Code 1: Multicast IP address of bootfile
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of secondes a client must listen for activity before trying
#         to start a new MTFTP transfer
# Code 5: Number of secondes a client must listen before trying to restart
#         a MTFTP transfer

# define Option for the PXE class
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;

#Define options for pxelinux
option space pxelinux;
option pxelinux.magic      code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
site-option-space "pxelinux";
# These lines should be customized to your setup
#option pxelinux.configfile "configs/common";
#option pxelinux.pathprefix "/pxelinux/files/";
#filename "/pxelinux/pxelinux.bin";
				
option pxelinux.magic f1:00:74:7e;
option pxelinux.reboottime 30;
#if exists dhcp-parameter-request-list {
	# Always send the PXELINUX options
#	append dhcp-parameter-request-list 208, 209, 210, 211;
#	append dhcp-parameter-request-list 208,211;
#					}

#Class that determine the options for Etherboot 5.x requests
class "Etherboot" {

#if The vendor-class-identifier equal Etherboot-5.0
match if substring (option vendor-class-identifier, 0, 9) = "Etherboot";

# filename define the file retrieve by the client, there nbgrub
# our tftp is chrooted so is just the path to the file
filename "/etherboot/nbgrub";

#Used by etherboot to detect a valid pxe dhcp server
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer        
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "Etherboot";

vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server 192.168.0.1;
}


# create the Class PXE
class "PXE" {
# if the "vendor-class-identifier" is set to "PXEClient" in the client dhcp request
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
  
# filename define the file retrieve by the client, there pxelinux.0
# our tftp is chrooted so is just the path to the file
# If you prefer use grub, use pxegrub compiled for your ethernet card.
#filename "/PXEClient/pxegrub";
filename "/X86PC/linux/linux.0";

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "PXEClient";

				  
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server 192.168.0.1;
}

# the class know exist just for deny the response to other DHCP request
class "known" {
  match hardware;
  one-lease-per-client on;
  ddns-updates on;
  ddns-domainname = "";
  option domain-name "10.0.59.10";
  option domain-name-servers  192.168.0.1;   
  ddns-hostname = pick-first-value(ddns-hostname, option host-name);
  option fqdn.no-client-update on;
  set vendor_class_identifier = option vendor-class-identifier;
}

# TAG: COMPUTER_LIST_BEGIN
#host compute9{
#    hardware ethernet 00:02:b3:3f:7e:b7;
#    fixed-address compute9;
# TAG: COMPUTER_LIST_END

#  subnet 192.168.200.0 netmask 255.255.255.0 {
subnet 192.168.0.0 netmask 255.255.255.128 {
  option subnet-mask 255.255.255.128;
  option routers 192.168.0.1;
  default-lease-time 28800;
  max-lease-time 86400;
  option domain-name "10.0.59.10";
  option domain-name-servers  192.168.0.1; 
  next-server 192.168.0.1;
   
    pool { 
       range 192.168.0.70 192.168.0.126;
deny members of "PXE";
#       deny members of "Etherboot";
    	}

#   pool {
#     range 192.168.200.200 192.168.200.254;
# give an address of the the pool for PXE client and deny the other
#allow members of "PXE";
#deny members of "known";
#allow members of "Etherboot";
#        }
}

Ответить