Linux Software Developers Kit (SDK) User Guide
49
8
8
.
.
µ
µ
C
C
l
l
i
i
n
n
u
u
x
x
N
N
e
e
t
t
w
w
o
o
r
r
k
k
i
i
n
n
g
g
Introduction
µClinux supports a full TCP/IP networking stack. Several networking protocols are supported
through the kernel and various shell utilities. Networking is initialized on the target through the
/etc/netstart script.
DHCP
The target can obtain an IP address automatically through the DHCP protocol. Two DHCP clients
are supported, udhcpc and dhcpcd. Udhcpc is included as part of busybox and takes up less
flash and RAM space. Dhcpcd is a standalone program with more options than udhcpc. The
/etc/netstart script will attempt to start whichever one is present, starting with udhcpc. Select the
client that best suits your needs.
Static Address Configuration
By default Linux will attempt to get an IP address through DHCP. To set a static address, perform
the following steps on the target:
1. Use the vi text editor to create and edit
/etc/netcfg
. Note that by default
etc/netcfg
is a
symlink to
/usr/local/etc/netcfg
. You can either delete this symlink and create
/etc/netcfg
, or
make sure that the path to
/usr/local/etc/netcfg
exists.
2. Add lines to /etc/netcfg as follows:
IPADDR=<target_ip>
NETMASK=<target_netmask>
GATEWAY=<target_gateway>
3. Reboot the target for the changes to take effect.
NOTE:
The static address in the dBUG configuration will also be updated during the reboot.
DNS
The target supports name resolution via the DNS protocol. The DNS configuration is found in
/etc/resolv.conf
.