This is G o o g l e's cache of http://www.debianclub.com/node/61 as retrieved on 17 Feb 2007 15:13:21 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?hl=en&q=cache%3Ahttp%3A%2F%2Fwww.debianclub.com%2Fnode%2F61&btnG=Search


Google is neither affiliated with the authors of this page nor responsible for its content.

User login

Links

debianclub.com
debian.org
ubuntuclub.com
blognone.com

Syndicate

Syndicate content

DHCP Server ช่วยทุ่นแรง

|

หลัง จากที่เราเตรียมเครื่อง Server พร้อมในระดับหนึ่งแล้ว ก่อนหน้านี้ เราต้องตั้งค่า IP ให้ Client แบบ Manual หรือตั้งเองนั่นหละครับ คงไม่สะดวกนัก ถ้าเราต้องไปตั้งค่า IP ให้กับเครื่อง 100-200 เครื่อง แต่ไม่ต้องตกใจครับ เรามีเครื่องทุ่นแรง นั่นก็คือ DHCP (Dynamic Host Configuration Protocol) Server ที่คอยช่วยตั้งค่าต่าง ๆ ให้เราอัตโนมัติ

# aptitude install dhcp3-server

เริ่มตั้งค่าต่าง ๆ ดังนี้

# cp /usr/share/doc/dhcp3-server/examples/dhcpd.conf /etc/dhcp3

# vi /etc/dhcp3/dhcpd.conf

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
.
.
.

แก้ไข

option domain-name "example.local";

option domain-name-servers 192.168.1.1

# This is a very basic subnet declaration.

subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.100 192.168.1.200;
   option routers 192.168.1.1;
}

หรือจะกำหนดเฉพาะเจาะจงไปเลยว่า เครื่องไหนจะได้ IP หมายเลขอะไร โดยกำหนดจาก MAC Address

host fantasia {
   hardware ethernet 08:00:07:26:c0:a5;
   fixed-address 192.168.1.50;
}

หลังจากนั้น comment หัวข้ออื่น ๆ ที่ไม่ได้ใช้ด้วยเครื่องหมาย "#" หน้าบรรทัด อย่างเช่น

# This decalration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
#   range dynamic-bootp 10.254.239.40 10.254.239.60;
#   option broadcast-address 10.254.239.31;
#   option routers rtr-239-32-1.example.org;
#}

# /etc/init.d/dhcp3-server restart

ต้องการดูว่า DHCP Server ปล่อยหมายเลขอะไรไปให้เครื่องไหน

# cat /var/lib/dhcp3/dhcpd.leases

lease 192.168.1.200 {
   starts 2 2006/12/19 08:16:14;
   ends 2 2006/12/19 20:16:14;
   tstp 2 2006/12/19 20:16:14;
   binding state active;
   next binding state free;
   hardware ethernet 08:00:07:26:c0:33;
   uid "\001\000\016\233\231\255\013";
   client-hostname "liverpool";
}

เป็นอันเรียบร้อยครับผม

​แจก​ routing table ​ไป​กับ​ dhcp

เอ ผมจำได้ว่าเคยอ่านบล็อกคุณ thep ว่าสามารถแจก routing table ไปกับ dhcp ได้ด้วยเดี๋ยวลองไปค้นดูก่อน เมื่อสัปดาห์ก่อนเห็นใน http://www.debian-administration.org/ เรื่องการแจก routing table ด้วยเหมือนกันแต่ไม่ทันได้อ่าน ต้องลองค้นๆ ดูหน่อย

- เจอแล้วที่ บล็อกคุณ thep เรื่อง แจก​ static route ​ด้วย​ DHCP
http://thep.blogspot.com/2005/09/static-route-dhcp.html

- ส่วนของ www.debian-administration.org นั้นเรื่องSupplying routing information using DHCP
http://www.debian-administration.org/articles/471

ขอบคุณครับ

Static routes ผมยังไม่เคยลองเหมือนกันครับ ได้ข้อมูลเพิ่ม ... ดีครับดี


**********************
Key ID: D4CEFD37
Fingerprint: 1ED3 27F6 48C8 5C9D 4285 F24D D64E C0AF D4CE FD37
**********************