Академический Документы
Профессиональный Документы
Культура Документы
#vim /etc/dhcp/dhcpd.conf
Add the following lines to the main configuration file or edit the default scope :-
subnet 172.18.9.0 netmask 255.255.255.0 {
range 172.18.9.20 172.18.9.50;
option domain-name-servers ns1.internal.example.org;
option domain-name "mysolutions.com";
option routers 172.18.9.9;
option broadcast-address 172.18.9.255;
option domain-name-servers 172.18.9.1;
default-lease-time 21600;
max-lease-time 43200;
}
In the next step, start the "dhcpd" daemon.
to start the "dhcpd" daemon, execute the following command.
#service dhcpd start
to restart "dhcpd" daemon, execute the following command.
#service dhcpd restart
to start "dhcpd" daemon on boot time, execute the following command.
#chkconfig dhcpd on
to check the "dhcpd" daemon status, execute the following command.
#service dhcpd status
Note :- If DHCP daemon did not start then check the syntax error.
To check DHCP syntax error in RHEL 6, execute the following command :-
#dhcpd -t
this will show you that where did you make mystake in main configuration file of DHCP Server.
#ifconfig eth0
Now generate the lease database in the DHCP Server :-
#touch /var/lib/dhcpd/dhcpd.leases
#cat /var/lib/dhcpd/dhcpd.leases
NFS Server
A Network File System (NFS) allows remote hosts to mount file systems over a network
and interact with those file systems as though they are mounted locally. This enables
system administrators to consolidate resources onto centralized servers on the
network.
By default RHEL6 use NFSv4 if the server supports it.
TCP 2049 is the default port number for NFS.
Benefits of NFS Server
NFS allows local access to remote files.
It uses standard client/server architecture for file sharing between all *nix based
machines.
With NFS it is not necessary that both machines run on the same OS.
With the help of NFS we can configure centralized storage solutions.
Users get their data irrespective of physical location.
No manual refresh needed for new files.
Newer version of NFS also supports acl, pseudo root mounts.
Can be secured with Firewalls and Kerberos.
NFS Services
The NFS Server package includes three facilities, included in the
portmap/rpcbind and nfs-utils packages.
portmap/rpcbind: It maps calls made from other machines to the correct RPC
service(not required with NFSv4).
nfs: It translates remote file sharing requests into requests on the local file
system.
rpc.mountd: This service is responsible for mounting and unmounting of file
systems.
Step 4:- In the next step we need to install NFS packages on our NFS Server as well as
on NFS Client
machine. We can install it via yum (Red Hat Linux) and apt-get (Debian and
Ubuntu) package
installers.
To install NFS packages using yum in RHEL 6 execute following command it: -
# yum install nfs-utils nfs-utils-lib
#yum install rpcbind (not required with NFSv4)
To install NFS packages using apt-get in Debian or Ubuntu execute following
command it: -
#apt-get install nfs-utils nfs-utils-lib
In this step you have to verify that NFS Server packages are installed.
#rpm qa nfs-utils*
#rpm qa rpcbind*
Step 6:- In the next step, create a new directory to share with client and
named it whatever you want,
you can also share an already existing directory with NFS.
#mkdir /nfsshare
Now we need to make an entry in /etc/exports and restart the services to
make our directory
shareable in the network.
Step 9:- To turn on the above services at boot time, execute the following
command.
#chkconfig rpcbind on (not required with NFSv4)
#chkconfig nfs on
Step 10:- Now execute the following command to show the available shares
your NFS server.
#showmount -e
NFS Client Configuration
check the connectivity with NFS Server:-
#ping 172.18.209.9
Step 3:- In the next step we need to install NFS packages on our NFS Server as well as on NFS Client
machine. We can install it via yum (Red Hat Linux) and apt-get (Debian and Ubuntu)
package
installers.
To install NFS packages using yum in RHEL 6 execute following command it: -
To install NFS packages using apt-get in Debian or Ubuntu execute following command it:
-
In this step you have to verify that NFS Server packages are installed.
#rpm qa nfs-utils*
#rpm qa rpcbind*
Step 5:- at the NFS client end, we need to mount that directory in our server to
access it locally. To
do so, first we need to find out that share available on the remote server
or NFS Server.
Execute the following command to find out the available share on the NFS
Server.
#showmount e 172.18.209.9
Use the following command to mount that NFS share on our client machine.
#mount t nfs 172.18.209:/nfsshare /mnt
The above command will mount that shared directory in /mnt/ on the client
server. You can verify it
following command.
#mount | grep nfs
Step 7:- In the previous step we mounted the nfs shared directory on to nfs
client temporarily, to
mount an NFS directory permanently on your system across the
reboots, we need to make an
entry in /etc/fstab.
Now edit the /etc/fstab file and add the following line to this file.
#vim /etc/fstab
172.18.209.9:/nfsshare /mnt nfs defaults 0 0
#umount /mnt
You can see that the mounts were removed by then looking at the file system again.
#df h F nfs