setup dhcp Fedora core 5
วันนี้ได้ทดสอบติดตั้ง dhcp กับ fc5 ครับ โดยเป็นการทดสอบเครื่องผมเองครับ 2 เครื่อง
-dchp—–lan utp— switch —–lan utp— Com 1 -
ตามแผนผังครับ
1. ข้อมูลเบื้องต้น (ข้อมุลสมมุติใช้ในการทดสอบ)
- dhcp ip 10.10.10.1
- net id 10.10.10.0 netmask 255.255.255.0
- scope ip 10.10.10.2-10.10.10.200
- default gateway 10.10.10.254
- dns 10.10.10.1
2. install dhcp
- คำสั่ง yum install dhcp หรือ apt-get install dhcp
จากนั้นรอสักครู่ครับ
3. เมื่อติดตั้งเสร็จแล้ว ต้องทำการแก้ file /etc/dhcpd.conf
- ใช้ nano /etc/dhcpd.conf หรือ pico /etc/dhcpd.conf แล้วแต่ครับ
*ค่าบังคับที่เวอร์ชั้น 3.x ต้องมีคือ
ddns-update-style ad-hoc;
***ต่อด้วย
subnet 10.10.10.0 netmask 255.255.255.0 {
range 10.10.10.2 10.10.10.200;
option domain-name-servers 10.10.10.1;
option routers 10.10.10.254;
}
4. สั่งให้ dhcp งาน ด้วยคำสั่ง
/etc/init.d/dhcpd start
ถ้าไม่มีอะไรผิดพลาดจะได้ดังนี้คับ
Starting dhcpd: [ OK ]
แต่ถ้าเขียน file dhcp.conf ผิดก็จะขึ้น error เตือนครับ
*** ลองทดสอบเครื่อง com 1 จะได้ ip ใน scope ที่เรากำหนดครับ
*** หากมีการแก้ไขไฟล์ dhcp.conf ใช้คำสั่ง
/etc/init.d/dhcpd reload
Shutting down dhcpd: [ OK ]
Starting dhcpd: [ OK ]
————————————————————–
Ref 1.http://rd.cc.psu.ac.th/content/view/37/46/
2. http://www.itwizard.info/technology/linux/dhcp_config_on_redhat.html


















