Showing posts with label configure. Show all posts
Showing posts with label configure. Show all posts

2011/05/29

DHCP Config

How to configure DHCP client of a embedded Linux device running a busy box?

1. Make sure you have udhcpc installed.
2. Find the configuration file at busybox-1.13.3 (this is the version of udhcp on my platform) /examples/udhcp/sample.renew.
3. Copy a configuration file to /usr/share/udhcpc/default.script, and change the RESOLV_CONF path to /etc/resolv.conf the content of the file looks like below:

#!/bin/sh # Sample udhcpc bound script RESOLV_CONF="/etc/resolv.conf" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" /sbin/ifconfig $interface $ip $BROADCAST $NETMASK if [ -n "$router" ] then echo "deleting routers" while /sbin/route del default gw 0.0.0.0 dev $interface do : done metric=0 for i in $router do /sbin/route add default gw $i dev $interface metric $((metric++)) done fi echo -n > $RESOLV_CONF [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF for i in $dns do echo adding dns $i echo nameserver $i >> $RESOLV_CONF done


4. To get the new ip
#udhcpc eth0

reference:
http://tinyurl.com/3pd45s8

2011/05/24

TFTP configure

yum install tftp tftp-server
mkdir /tftpboot
chmod o+w /tftpboot
/sbin/chkconfig --level 345 xinetd on
/sbin/chkconfig --level 345 tftp on
service xinetd restart

NFS config

Server side

add following lines to /etc/exports
/opt/perth *(rw,no_root_squash,no_all_squash)
/home/xgu/src/ *(rw,no_root_squash,no_all_squash)

service nfs stop
service nfs start


Client Side

mount 10.132.10.87:/opt/perth/refsw/BSEAV/bin /mnt/nfs/


For Ubuntu
to install
# sudo apt-get install nfs-kernel-server

to start service
# sudo /etc/init.d/nfs-kernel-server restart

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...