Latest Entries »

How to Install and Configure DHCP Server


My sincere gratitude goes to Mr. Anuradha Jayakody and Mr. Rajitha Tennekoon of Sri Lanka Institute of Information Technology for teaching me these valuable concepts. Most of the below configurations are taken from the lab sheets written by them. 

Prerequisites

Centos 5.5 installed in VMWare.
Stop the LDAP service.
Set VMware network settings to NAT and make your server IP settings to obtain IP address automatically.
Restart the network service on CentOS.

Installation and configuration Steps

Type the following command and install DHCP.
yum install –y *dhcp*
After you install the DHCP service, change your network settings to VMNET2 and assign your server static IP address.

Warning: If you do not configure the network settings to VMNET2 this installation will mess-up and harm entire company network.

Check the server’s IP is configured to 10.0.1.2 ( Specially you have to make sure, your server has been configured to static IP address)

 What is the command you have used to check the IP settings?
ifconfig
Type following command to copy the sample DHCP file given by the installation. Importantly, you have to remember that, this is the file we are going to configure as the DHCP server. Any misconfiguration of this file will effect to the smooth functionality of the DHCP server.
cp -f /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcpd.conf
If it asks to over write the file, over write it. Understand and write down what is the backup file here? And what is the configuration file we will be using here?
Back up file - dhcpd.conf.sample Configuration file - dhcpd.conf
Type following command to edit the dhcpd.conf file
gedit /etc/dhcpd.conf
If you don’t have following 3 lines in your DHCPD.conf file add them. And google for them and find what are meanings of those lines.

ddns-update-style interim;
#ignore client-updates;
allow client-updates; 


DYNAMIC DNS UPDATES

The DHCP server has the ability to dynamically update the Domain Name System.Within the configuration files, you can define how you want the Domain Name System to be updated. These updates are RFC 2136 compliant so any DNS server supporting RFC 2136 should be able to accept updates from the DHCP server.

Two DNS update schemes are currently implemented, and another is planned. The two that are currently available are the ad-hoc DNS update mode and the interim DHCP-DNS interaction draft updatemode. If and when the DHCP-DNS interaction draft and the DHCID draft make it through the IETF standards process, there will be a third mode, which will be the standard DNS update method. The DHCPserver must be configured to use one of the two currently-supported methods, or not to do dns updates. This can be done with the ddns-update-style configuration parameter.

THE INTERIM DNS UPDATE SCHEME

The interim DNS update scheme operates mostly according to several drafts that are being considered by the IETF and are expected to become standards, but are not yet standards, and may not be standardized exactly as currently proposed.

These are:
draft-ietf-dhc-ddns-resolution-??.txt
draft-ietf-dhc-fqdn-option-??.txt
draft-ietf-dnsext-dhcid-rr-??.txt

Because our implementation is slightly different than the standard, we will briefly document the operation of this update style here.

The first point to understand about this style of DNS update is that unlike the ad-hoc style, the DHCP server does not necessarily always update both the A and the PTR records. The FQDN option includes a flag which, when sent by the client, indicates that the client wishes to update its own A record. In that case, the server can be configured either to honor the client's intentions or ignore them. This is done with the statement allow client-updates;or the statement ignore client updates; By default, client updates are allowed.  

ddns-update-style interim : Now we have our information, so let's configure the server by creating a text file named /etc/dhcpd.conf. The first line in the file must be the DNS update scheme. There are 2 choices, but only one that works reliably ... so we will use that one.That is ddns-update-style interim  

ignore client-updates : allow the DHCP to update client info to a Dynamic DNS server. In our example, we are not going to try and update a Dynamic DNS via our DHCP server, so we will not allow client updates.

Dynamic DNS service

Dynamic DNS is provided by companies to allow users with Dynamic IP addresses to obtain a Domain Name that will always by linked to their changing IP address. The IP address is updated by either client software running on a computer or by a router that supports Dynamic DNS, whenever the IP address changes.

Carefully change following areas and understand each and every line and make a note that why exactly those lines are?

subnet 10.0.1.0 netmask 255.255.255.0 {
# --- default gateway
option routers 10.0.1.1;
option subnet-mask 255.255.255.0;
option nis-domain "blogspot.com"; 
option domain-name "blogspot.com"; 
option domain-name-servers ; 
option time-offset -18000; # Eastern Standard Time 
allow booting; 
allow bootp; 
range dynamic-bootp 10.0.1.6 10.0.1.254;
default-lease-time 21600 max-lease-time 43200; 

Then comment the function named as 

host ns { ......
}

What is BootP? 

BOOTP, short for Bootstrap Protocol, is a protocol used to allow an Ethernet network device to obtain an IP Address over the network. 

A device that wants to obtain an IP address broadcasts a BootP request that identifies the device by its MAC address, an identifying six octet number ( ex: 00:A0:45:08:CD:8D) that is uniquely assigned to a device by its manufacturer. A BootP server on the network, sees the request and sends a BootP reply containing a desired IP address (ex: 192.168.1.10) to the device, thereby making it now become accessible to higher level network communications using that IP address. 

Save the file. 

Edit the following file and give the IP address that client need to contact and the Ethernet interfaceclients need to contact to obtain IP address from the server.

gedit /etc/sysconfig/dhcrelay 

INTERFACES="eth0" 
DHCPSERVERS="10.0.1.1" 

dhcrelay agent 

DESCRIPTION 

The Internet Systems Consortium DHCP Relay Agent, dhcrelay, provides a means for relaying DHCP and BOOTP requests from a subnet to which no DHCP server is directly connected to one or more DHCP servers on other subnets. 

OPERATION 

The DHCP Relay Agent listens for DHCP and BOOTP queries and responses. When a query is received from a client, dhcrelay forwards it to the list of DHCP servers specified on the command line. When a reply is received from a server, it is broadcast or unicast (according to the relay agent’s ability or the client’s request) on the network from which the original request came. 

Save the file and restart the DHCP service using 

service dhcpd restart 

Configure your client centos machines to obtain IP address form the DHPC service and verify that client has obtained an IP address from the given range of the IP addresses.

References

http://www.daemon-systems.org/man/dhcpd.conf.5.html 
http://wiki.answers.com/Q/What_is_the_BOOTP_protocol_used_for_where_might_you_find_it_in_Windows_network 

හන්තාන ලිනක්ස් 15 නිකුත් වේ!



නොකඩවා පස්වන නිකුතුවත් නිකුත් කිරීමට අප හට හැකියාව ඇත්තේ අප හා බැදුණු ශක්තිමත් ප්‍රජාව බව නොරහසකි. හන්තාන 14 (ගගන) නිකුතුව මේ වන විට මෙරට පාසැල් 15කට අධික සංඛ්‍යාවක (පරිගණක 500කට වැඩි) භාවිත වන අතර ඉන් එක් පාසැලක් ප්‍රාථමික පාසැලක් වීමද සුවිශේෂී වේ. එමෙන්ම රුවන්පුර විද්‍යාපිඨයේ පරිගණක 80කින් යුත් පරිගණක විද්‍යාගාරයෙදි හන්තාන ලිනක්ස් භාවිතය සඳහා පහසුකම් මේ වන විට සලසා ඇත.
තවද හන්තාන පරිශීලක ප්‍රජාව සඳහා වූ ෆෝරමයද ඉතා සක්‍රීය ව ක්‍රියාත්මක වේ. එමෙන්ම පසු ගියදා නිකුත් කළ හන්තාන ප්‍රජා සඟරාව ද ප්‍රජාව වෙත තොරතුරු සහ දැණුම ගෙනයාමෙදි තවත් විශේෂ කාර්යයක් සිදු කරයි. තවද 2011 වසර තුළදි හන්තාන 14 නිකුතුව අඩංගු DVD තැටි 2000කට වඩා වැඩි ප්‍රමාණයක් ලංකාව පුරා බෙදි ගොස් ඇති අතර ප්‍රායෝගික පුහුණු වැඩසටහන් සහ දේශණ වැඩසටහන් සඳහා එක් වූ පිරිස 1000කට වඩා වැඩි වේ. එමෙන්ම ජාතික අධ්‍යාපන ආයතනයේ විවිධ දෙපාර්තුමෙන්තු තුළ පරිගණක 25 කට ආසන්න සංඛ්‍යාවක ස්ථාපිත කළ අතර කණ්ඩායම් 5කට මේ වන විට ප්‍රායෝගික පුහුණු වැඩසටහන් නිමකර ඇත. තවද ශ්‍රී ලංකා නාවික හමුදා මූලස්ථානයේදි තොරතුරු තාක්‍ෂණ අංශයේ සේවයේ නියැලෙන විවිධ නිළයන් වලට අයත් 35 දෙනෙක් තෙදින පුහුණු වැඩසටහනට එක් වුයේ හන්තාන ලිනක්ස් පදනම් කරගෙන සාමාන්‍ය කටයුතු සහ මෘදුකාංග සංවර්ධණ කටයුතු ඉදිරියට පවත්වාගෙන යාමට අවශ්‍ය දැනුම ලබා ගැනීමටයි.

පරණ Ubuntu Install කිරීම නවතමු.

අප සෑම විටම උබන්ටු ස්ථාපනය කරන්නේ අන්තර්ජාලයෙන් ලබාගත් iso එකක් මගිනි. නමුත් සෑම විටම එසේ ලැබෙන්නේ අළුත්ම update සහිත Ubuntu නොවේ.

නමුදු ඔබට වේගවත් අන්තර්ජාල සබදතාවක් ඇත්නම "Installation Minimal CD" මගින් ඔබ පරිගණකයට උබන්ටු ස්ථාපනය කරගන්නා විටම නවතම updates ටික ලබාගන්නට පුළුවන්. තවත් වාසියක් නම් එකම Installation Minimal CD එක යොදාගෙන විවිධ වූ උබන්ටු සංස්කරන පරිගණකයේ ස්ථාපනය කරගත හැකි වීමයි.

ඉතින් Ubuntu Minimal CD එක download කර ගන්න මේ සම්බන්දකය හරහා යන්න. එම iso එක 20MB තරම් කුඩා අගයක් ගනියි.

youtube වීඩියෝ download කිරීමට youtube-dl

ලිනක්ස් මෙහෙයුම් පද්ධති භාවිතා කරන බොහෝ දෙනෙකුගේ ප්‍රියතම youtube වීඩියෝ ඩවුන්ලෝඩරය වන්නේ youtube-dl ය. ඉතින් නොදන්න අය ඉන්නවනම් එය ඔබේ ලිනක්ස් පරිගණකයේ ස්ථාපනය කරගන්නා හැටි මෙම ලිපියෙන් කියන්නම්.

youtube-ld යනු ලිනක්ස් shell එක හරහා වැඩ කරන python script එකක්. මෙම youtube-dl ඔබේ පරිගණකයේ ස්ථාපනය කර ගැනීමට

yum install youtube-dl (hanthana/fedora ඇතිවිට)
sudo apt-get install youtube-dl (ubuntu ඇතිවිට) 

යන commands දෙකෙන් එකක් යොදා ගන්න. මෙසේ youtube-dl ස්ථාපනය කර ගත් පසු ඔබට අවශය වීඩියෝව download කිරීමට shell එක තුළ

youtube-dl -o <ඔබේ/වීඩියෝවට/ලබාදෙන/නම.flv>  <youtube URL>

ලෙස ලබා දෙන්න. උදාහරණයක් ලෙස දුෂාන්ගෙ "ඔබ ඉන්නෙ කොහෙද කියා" වීඩියෝව download කරමු. ඒ සදහා shell එකේ

youtube-dl -o ObaInnekohedaKiya.flv http://www.youtube.com/watch?v=wGh8OYeQWUc youtube-dl 

යොදා ගන්න. 



youtube-dl latest python script එක ලබා ගැනීමට මෙම සම්බන්ධකය හරහා යන්න. මෙම script එක shell එකේ

python youtube-dl -o ObaInnekohedaKiya.flv http://www.youtube.com/watch?v=wGh8OYeQWUc 

ලෙස යොදා ගෙන run කරන්නට පුළුවන්.

How To Install Contiki & Cooja Simulator

මුලින්ම මම UCSC එකේ අසංකට ස්තූතිවන්ත වෙනව මට මේක කියල දුන්නට. පළමුවෙන්ම කියන්න ඕනෙ මම Contiki ස්ථාපනය කළේ Ubuntu 11.04 වල ඉදගෙනයි. කෙලින්ම වැඩේට බැස්සොතින් පියවර වෂයෙන්

1. මුලින්ම මම Applications->Accessories හරහා ගිහිල්ල Terminal එක ඇරගත්ත.

2. මම පාවිච්චි කරන්න බලාපොරොත්තුවෙන්නෙ කොන්ටිකි වල CVS version එක නිසා ඊලගට CVS install කරගත්ත පහත command එකෙන්

sudo apt-get install cvs

3.ඊලගට මම කොන්‍ටිකි source code එක download කරගත්ත පහත command එකෙන්

cvs -z3 -d:pserver:anonymous@contiki.cvs.sourceforge.net:/cvsroot/contiki co contiki-2.x

4.දැන් මම download කරපු folder එකේ පොඩි සාම්පල් කෝඩ් ටිකක් තියෙනව. ඒකෙ තියෙන hello-world කියන සාම්පල් එක compile කරගන්න මම පහත කෝඩ් එක ලිව්වා

cd contiki-2.x.x/examples/hello-world
make TARGET=native

5. ඊට පස්සෙ ඒ compile කරපු එක පහත command එක දීල run කරා

./hello-world.native

6. ඊට පස්සෙ මම ඒ compile කරපු කෝඩ් එකට අදාලව හැදිච්ච temporary files තියෙනවනම් ඒව අයින් කරන්න පහත command එක දුන්න.

make clean

7. හරි දැන් Contiki වැඩ.

8. ඊලගට මට Contiki operating system එක run වෙන network devices simulate කරන්න හදල තියෙන cooja කියන application එක install කරගත්ත.

9. Cooja දුවන්නෙ java jre එක උඩ නිසා මට java download කරගන්න උනා. ඒ සදහා පහත පියවර සිදු කරා

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

10.cooja compile කරගන්න මට ant කියන tool එක download කරන්න උනා. පහත command එකෙන්

sudo apt-get install ant

11. හරි ඊලගට මට cooja compile cooja folder එකට ගියා

cd tools/cooja
ant run

12. හරි දැන් cooja වැඩ කරන්න පටන් ගන්න ඕනෙ. ඒක close කරාට පස්සෙ එය compile වෙනකොට හැදිච්ච temporary files අයින් කරන්න

ant clean දුන්න.

13. කොහොම හරි cooja එකේ මම අර කලින් run කරපු hello world example එකත් run කරන්න පුළුවන්. ඒත් ඒකට තව දේවල් ටිකක් install කරන්න වෙන නිසා ඒක කරන එක නවත්තල දැම්ම. දැන් ඔය අයට Ubuntu වල contiki install කරන හැටි පුළුවන්‍ වෙන්න ඕනෙ.

ලිනක්ස් වලදි partition table එක බලාගන්නෙ කොහොමද?

මුලින්ම Applications->System Tools හරහා ගොස් terminal එක විවෘත්ත කරගන්න. ඊට පස්සෙ su හෝ sudo ලෙස ලියා root ලෙස login වෙන්න. පහත පරිදි type කරන්න

parted /dev/sda print

එවිට ඔබේ පරිගණකයේ ඇති partition table එක පහත පරිදි පෙන්වාවි.

Model: ATA TOSHIBA MK2018GA (scsi)
Disk /dev/sda: 20.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 8390MB 8390MB primary ntfs boot
2 8390MB 14.8GB 6440MB primary ext3
3 14.8GB 15.9GB 1078MB primary linux-swap
4 15.9GB 20.0GB 4088MB extended lba
5 15.9GB 20.0GB 4088MB logical ntfs

මීට අමතරව පහත සදහන් විධානයෙන්ද ඔබට parttion table එක බලා ගන්න පුළුවන් හැබැයි ටිකක් තේරුම් ගන්න අපහසුයි. මෙම විධානය ලබා දීමට root වීම අවශ්‍ය නොවේ

fdisk -l

එවිට out-put එක මෙලෙස පෙනේවි.

Disk /dev/sda: 20.0 GB, 20003880960 bytes
255 heads, 63 sectors/track, 2432 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc273c273

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1020 8193118+ 7 HPFS/NTFS
/dev/sda2 1021 1803 6289447+ 83 Linux
/dev/sda3 1804 1934 1052257+ 82 Linux swap / Solaris
/dev/sda4 1935 2431 3992152+ f W95 Ext'd (LBA)
/dev/sda5 1935 2431 3992121 7 HPFS/NTFS

ලිනක්ස් install කලාට පස්සෙ windows default OS එක විදියට තියාගන්නෙ ‍කොහොමද?


බොහෝ දෙනෙකුට තියෙන ගැටළුවක්. නමුත් පිළිතුර නම් හරිම සරලයි. ඔබේ gnome desktop එකේ System->Administration->Bootloader තෝරන්න. ඊට පස්සේ එන වින්ඩෝවෙදි ඔබේ root password එක ලබා දෙන්න.


ඉන්පසුව ලැබෙන Boot Configuration කියන වින්ඩෝවෙ Please select the default boot entry for the system යටතේ එන other කියන එක තෝරල අවශ්‍ය නම් bootloader එක විවෘත්ත වෙලා තියෙන්න අවශ්‍ය කාලයත් සකස් කරල OK බොත්තම ඔබන්න.

Add to Google Reader or Homepage

Bloggers - Meet Millions of Bloggers

Add to My AOL Add to netvibes