---
Hi all,
It is very useful to connect to the ZedBoard from ssh, but unfortunately
the file system in the card is very small, just 8Mbyte, so a lot of files have been removed in order to fit this small size;
this file pruning yielded some misbehavior, and one of this is the dhcp client, that is already present in the system from Busybox
in order to have dhcp service you can start the eth0 with:
tzynq> ifup eth0
you should even start the lo interface with
tzynq> ifup lo
this command is based on udhcpc, and if everything worked, after asserting the above commands you should send ifconfig and get something like this:
zynq> ifconfig
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:01:22
inet addr:141.137.89.125 Bcast:141.137.89.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4215 (4.1 KiB) TX bytes:1010 (1010.0 B)
Interrupt:54 Base address:0xb000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
But with your original ZedBoard this does not work!
In order to have this result you must do some work on your file system;
PLEASE BACK-UP YOUR FILE SYSTEM BEFORE APPLYING ANY MODIFICATION
The following steps show hot to have dhcp service (and ntp) on the ZedBoard
Add the file host in /etc with the following line: 127.0.0.1 localhost
You should modify the file with the starting procedure, /etc/init.d/rcS
by removing:
echo "++ Configure static IP 192.168.1.10"
ifconfig eth0 down
ifconfig eth0 192.168.1.10 up
(if you do this then the zedboard shall no more the default address 192.168.1.10)
If you whish to have ntp service you could add this line:
echo "++ Starting ntp daemon"
ntpd -dp 193.204.114.232
(modify the address of the dhcp server if you like, I put the closest to my office;
you can even avoid this line and start the service by hand; it will take a while to get synchronized)
then you must add the following files and folders:
folder /etc/network
file interfaces in /etc/network containing:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
folder /etc/network/if-down.d
folder /etc/network/if-post-down.d
folder /etc/network/if-pre-up.d
folder /etc/network/if-up.d
you can get the proper files in the previous folders from a working linux filesystem, I got mine from ubuntu 12.04;
please consider that the wpa_supplicant in these folders is a link
folder /etc/wpa_supplicant
again, get the content of this folder from a working linux filesystem
file /etc/ntp.conf
get the content of this file from a working linux filesystem
folder /run/network
you do not to add files here; udhcpc shall fill this folder
folder /usr/share
file /usr/share/default.script containing the file from:
http://www.linuxquestions.org/questions/linux-networking-3/how-can-i-use-udhcpc-800236/
(remove the first line: ~ $ cat /usr/share/udhcpc/default.script)
then modify the rights of the file:
tchmod 755 default.script
once everything works you can add in /etc/init.d/rcS the following lines:
echo "++ Starting lo interfaces"
ifup lo
echo "++ Starting dhcp service on eth0"
ifup eth0
and youu2019ll have eth0 configured by dhcp and lo active just after the bootstrap of the card
if you need to disable these interfaces the command is
tifdown lo
tifdown eth0
have fun!
Roberto