Tuesday, May 25, 2010

NFS (Network File System) in SUSE Linux

NFS server allows transparent acess to programs,files or storage space on the server.

Service:Program/Daemon:Start Script

Port mapper: /sbin/portmap : /etc/init.d/portmap

NFS Server: /usr/sbin/rpc.nfsd and /usr/sbin/rpc.mountd : /etc/init.d/nfsserver

NFS server configuration overview:

All configurations for NFS server are stored in the file /etc/exports. Client-side configuration takes place using the file /etc/fstab.
For the NFS server to start automatically when the computer is booted, the coressponding symbolic links in the runlevel directories must be generated. If you configure the NFS server with YaST, this is done automatically; otherwise, you need to generate them with

#insserv nfsserver

or
#chkconfig nfsserver on


In SUSE Linux, it's very easy to setup NFS server using YaST.

Configure and start NFS server:

To use YaST to configure the NFS server, start Yast and then select Network Services > NFS Server.

or
you can do everything manually
You need to set permissions for exported directories in /etc/exports

#vi /etc/exports
/var/backup *(ro)
/var/work *(rw,sync)


[
Note: if you are specifying the write permission, make sure that the directory has write permission for OTHER user. You can add the write permission to the directory/file by
#chmod o+w /var/work
]

Restart the server to reflect the changes

#rcnfsserver restart


Configure and start NFS Client:

To configure the NFS server, start Yast and then select Network Services > NFS Client. Add all the NFS server and mount point information.

I would recommend YaST for client setup, as it will automatically populate /etc/fstab with the provided NFS server information. You can check /etc/fstab file after you configure NFS client using YaST.

Monday, May 17, 2010

Router ARP Cache not releasing Server IP Address

I moved all IP address from old to a new server. However, I can't ping those servers as those IP addresses are not get updated due to arp cache issues ( IPs are cached on the router). How to solve this issue?

As ARP stands Address Resolution Protocol, it is used to resolve IP address to the corresponding Ethernet address. ARP maintains the mapping betweeen IP address and MAC address in a table in a memory called ARP cache. The entries in this table are dynamicaly added and removed. This is common and well known issue as most network admin configure their routers with a long ARP cache timeout. As a result my requests are going to the old server. If I move IP address, it may take hours before server can communicate. To get rid of this problem, we need to request the MAC address for it's own IP which will cause routers and other hardware update ARP cache. This is called a 'unsolicited ARP' or 'gratuitous ARP'

We can use 'arping command' to send an ARP request to resolve its won IP address.

#arping -U -I [Interface Name] [IP Address]

e.g
#arping -U -I eth1 192.168.1.2

where,
-U : Unsolicited ARP mode to update neighbours ARP cache. No replies are expected
-I eth1: Name of network device where to send ARP request packets.