element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development dhcp service
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 315 subscribers
  • Views 341 views
  • Users 0 members are here
Related

dhcp service

Former Member
Former Member over 12 years ago

---


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

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 12 years ago

    in order to avoid to get an error during the bootstrap phase you can add an empty initctl file in /sbin

    you can do:
    vi /sbin/initctl

    and then, within vi type ESC :wq
    the file must be executable by root:

    chmod 755 /sbin/initctl


    BR,
         Roberto

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube