Difference between revisions of "DHCP3 Conf"
From MS Computech
Line 54: | Line 54: | ||
</pre> | </pre> | ||
สั่งสตาร์ท sudo /etc/init.d/networking restart | สั่งสตาร์ท sudo /etc/init.d/networking restart | ||
+ | |||
+ | --- | ||
+ | For Debian Squeeze | ||
+ | |||
+ | <pre> | ||
+ | apt-get install dhcp3-server | ||
+ | </pre> | ||
+ | |||
+ | Config file directory /etc/dhcp/dhcpd.conf | ||
+ | <pre> | ||
+ | # ddns-update-style interim; | ||
+ | |||
+ | subnet 192.168.1.0 netmask 255.255.255.0 { | ||
+ | |||
+ | option subnet-mask 255.255.255.0; | ||
+ | option domain-name-servers 192.168.1.1; | ||
+ | option routers 192.168.1.1; | ||
+ | option time-offset -16000; | ||
+ | |||
+ | range 192.168.1.100 192.168.1.254; | ||
+ | |||
+ | # Phat Computer | ||
+ | #host pc01 { | ||
+ | # hardware ethernet 00:c0:4f:a0:ba:85; | ||
+ | # fixed-address 192.168.1.150; | ||
+ | # option domain-name-servers 192.168.1.1; | ||
+ | # option routers 192.168.1.1; | ||
+ | #} | ||
+ | |||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | Restart Service | ||
+ | <pre> | ||
+ | /etc/init.d/isc-dhcp-server start | ||
+ | </pre> |
Revision as of 10:40, 10 April 2012
DHCP3 Installation
apt-get -y install dhcp3-server nano /etc/default/dhcp3-server
# Defaults for dhcp initscript #sourced by /etc/init.d/dhcp #installed at /etc/default/dhcp3-server by the maintainer scripts # # This is a POSIX shell fragment # # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. "eth0 eth1". INTERFACES="eth0"
/etc/dhcp3/dhcpd.conf
# ddns-update-style interim; subnet 192.168.1.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option domain-name-servers 192.168.1.1; option routers 192.168.1.1; option time-offset -16000; range 192.168.1.100 192.168.1.254; # Phat Computer #host pc01 { # hardware ethernet 00:c0:4f:a0:ba:85; # fixed-address 192.168.1.150; # option domain-name-servers 192.168.1.1; # option routers 192.168.1.1; #} }
สำหรับ Unubtu 9 แก้ไข /etc/init.d/dhcp3-server
# Allow ltsp to override #if [ -f /etc/ltsp/dhcpd.conf ]; then # CONFIG_FILE=/etc/ltsp/dhcpd.conf #fi
Set Network interface /etc/network/interfaces
auto eth0 iface eth0 inet static address 192.168.1.1 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255
สั่งสตาร์ท sudo /etc/init.d/networking restart
--- For Debian Squeeze
apt-get install dhcp3-server
Config file directory /etc/dhcp/dhcpd.conf
# ddns-update-style interim; subnet 192.168.1.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option domain-name-servers 192.168.1.1; option routers 192.168.1.1; option time-offset -16000; range 192.168.1.100 192.168.1.254; # Phat Computer #host pc01 { # hardware ethernet 00:c0:4f:a0:ba:85; # fixed-address 192.168.1.150; # option domain-name-servers 192.168.1.1; # option routers 192.168.1.1; #} }
Restart Service
/etc/init.d/isc-dhcp-server start