Re-blogged from Zahidhaseeb’s Blog:
Step # 1
# pwd
/etc/yum.repos.d
Step # 2
# vi rhel-source.repo
Step # 3
You may see a result like below
[rhel-source]
name=Red Hat Enterprise Linux $releasever – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Step # 4
Add the below lines on the top of file above
[Media]
name=RHELmedia
baseurl=file:///media/RHEL_6.2\ x86_64\ Disc\ 1/Server/
enabled=1
gpgcheck=0
Please Note: Keep enabled=1 for [Media] and mark enabled=0 for[rhel-source-beta] and [rhel-source] .
Conclusion
Now you will be able to use yum command and the request will redirect to the DVD media of Redhat which you inserted in the CD/DVDrom (instead of going to internet/RHN)
Helpful Link
http://blog.sriunplugged.com/linux/adding-redhat-dvd-as-repository/