Monday, June 16, 2008

setup dhcp, nfs on FC5

setup dhcp server
I need to setup dhcp server under my router.
Here is the configuration file (/etc/dhcpd.conf)


ddns-updates on;
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option domain-name "local.net";
option domain-name-servers ns.local.net;
host trgt {
hardware ethernet 08:00:28:01:15:F7;
fixed-address 192.168.2.110;
option root-path "/opt/eldk/ppc_8xx";
option host-name "trgt";
next-server 192.168.2.151;
filename "tftpboot/pImage";
}
}
ddns-update-style ad-hoc;

Here "trgt" is a linux device which has fixed ip address, and need boot image through NFS from linux host with ip "192.168.2.151".

Start dhcp-server with: `/etc/rc.d/init.d/dhcpd start`

Setup nfs

Edit /etc/exports

/tftp 192.168.2.110(rw,no_root_squash,sync)


Edit /etc/hosts.allow

portmap: 10.10.10.20
lockd: 10.10.10.20
mountd: 10.10.10.20
rquotad: 10.10.10.20
statd: 10.10.10.20


And edit /etc/hosts.deny

portmap: ALL
lockd: ALL
mountd: ALL
statd: ALL



run: `exportfs -ra`




scripts on start nfs

/etc/init.d/portmap start
/etc/init.d/nfslock start
/etc/init.d/nfs start
/etc/init.d/netnfs start


Check nfs status with: `/sbin/service nfs status`

rpc.mountd (pid 4181) is running...
nfsd (pid 4183 4182 4181 4180) is running
rpc.rquotead (pid 4170) is running


You may need to "/sbin/service iptables stop" sometimes if you can the ip but can not mount while getting "no route and host" message.