WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TINY CORE as DHCP SERVER ?  (Read 17240 times)

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
TINY CORE as DHCP SERVER ?
« on: July 13, 2009, 09:15:36 AM »
Hi there.

I am thinking of using my FitPC2, which is running Tiny Core,  as DHCP server. ( I need static DHCP capability in the network)

Is anybody running Tiny Core as DHCP server? Is there a tce?

THX.

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: TINY CORE as DHCP SERVER ?
« Reply #1 on: July 13, 2009, 10:10:11 AM »
The BusyBox in Tiny Core was built with udhcpd included. Start options can be found on the BusyBox Commands Index. A copy of the config file man page can be found here.  And of course you can use /opt/bootlocal.sh to automate the startup of udhcpd.

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: TINY CORE as DHCP SERVER ?
« Reply #2 on: July 13, 2009, 11:16:08 AM »

THX. I read some stuff. It doesn't seem to be that trivial if you start from scratch.

Do you, or anybody else, have an example config file by chance? ;)

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: TINY CORE as DHCP SERVER ?
« Reply #3 on: July 13, 2009, 10:13:47 PM »
Here is the /etc/udhcpd.conf file on my TC firewall/router:

Code: [Select]
start 192.168.0.100                                                             
end 192.168.0.200                                                               
interface eth0                                                                 
option subnet 255.255.255.0                                                     
option router 192.168.0.1                                                       
option lease 259200                                                             
option dns 192.168.1.254                                                       
lease_file /tmp/udhcpd.leases                                                   
option domain home                                                             
pidfile /tmp/udhcpd.pid   

started with the command

$ udhcpd /etc/udhcpd.conf &


Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: TINY CORE as DHCP SERVER ?
« Reply #4 on: July 14, 2009, 12:00:33 AM »

THX a lot Jason. Looks great. :D

Finally (for now) there is a question of how to put it into bootlocal.

How about startup sequence?

I guess it should be: 1. udhcp 2. eth0.sh  3. nfs   

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: TINY CORE as DHCP SERVER ?
« Reply #5 on: July 14, 2009, 01:46:12 AM »
I'd guess: eth0, udhcp, nfs

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: TINY CORE as DHCP SERVER ?
« Reply #6 on: July 14, 2009, 01:39:47 PM »
Since udhcpd is binding to an interface and not an address, its not a big deal whether you configure your net card (eth0.sh) first or start udhcpd first.  personally I would do as hats suggested and configure the card first.
In your original post you mentioned static DHCP, did you mean that you were looking for a DHCP server that can hand out the same address to a machine every time?   udhcpd is not capable of doing that, although the DHCP protocol is accommodating in that if the machine has not been powered off through its lease expiration, it will try to renew its IP and server will usually oblige. If you need a server that can hand out "static leases" I can take a look at making a tce of DnsMasq which is a lightweight dns and dhcp server that is highly and easily configurable.
BTW - when talking about udhcp, it is best to say either udchpd or udhcpc, udhcpc being the client side and udhcpd being the server side.

Offline soundcheck

  • Newbie
  • *
  • Posts: 46
Re: TINY CORE as DHCP SERVER ?
« Reply #7 on: July 14, 2009, 02:01:40 PM »

The main reason for running this exercise - I need the static DHCP feature. It connects MAC to IP. My old router doesn't support it.
I need to have fixed and dynamic IPs in one network.

Typical config would be like that:

Code: [Select]

host fit1
       {
         hardware ethernet 00:10:5f:58:43:9b;
         fixed-address 192.168.22.101;
       }


Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: TINY CORE as DHCP SERVER ?
« Reply #8 on: July 14, 2009, 03:07:32 PM »
I had searched the internet for static leases with udhcpd before my earlier post and most of what I found said it was not possible.  Just now I did some more searching and ran across this forum thread which may have a few possible solutions: http://forum.openwrt.org/viewtopic.php?id=162.  Keep in mind that if neither of those dont work, its possible that udhcpd has been patch in that firmware to make static leases work.  If those arent successful, dnsmaq is a strait forward compile that you can try, or I will do and submit.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: TINY CORE as DHCP SERVER ?
« Reply #9 on: July 14, 2009, 03:45:32 PM »
Why don't you use BIND?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."


Offline echo123

  • Newbie
  • *
  • Posts: 3
Re: TINY CORE as DHCP SERVER ?
« Reply #11 on: October 18, 2009, 03:25:39 PM »
please answer, how i can to disable dhcp client? i have static adress in my lan, but after any reebot dhcp client was on, and static ip settings reset

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: TINY CORE as DHCP SERVER ?
« Reply #12 on: October 18, 2009, 08:01:02 PM »
the bootcode "nodhcp" will do it:

http://www.tinycorelinux.com/faq.html#bootcodes

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: TINY CORE as DHCP SERVER ?
« Reply #13 on: March 23, 2010, 02:25:50 PM »
Sorry for bumping such an old thread, but it pertains to a problem I'm having as well.  I'm trying to setup a DHCP server in TC and just test assigning IPs to a Windows machine (manually first, then I'll automate it through bootlocal).  Assigning of IP works fine to my target machine but I cannot ping it either way (running Wireshark shows that TC is sending echo request packets, but I don't get a response so it's useless).  Here is how I'm configuring eth0:

Code: [Select]
ifconfig eth0 192.168.1.23 netmask 255.255.255.0 broadcast 192.168.1.255
route add default gw 192.168.1.1 eth0

And here is my udhcpd.conf file (using the cmd udhcpd /etc/udhcpd.conf & to start it):

Code: [Select]
start 192.168.1.100                                                            
end 192.168.1.200                                                              
interface eth0                                                                  
option subnet 255.255.255.0                                                    
option router 192.168.1.1                                                                                                          
lease_file /tmp/udhcpd.leases                                                                                                        
pidfile /tmp/udhcpd.pid

What am I missing?  Again, the udhcpd assigns the IP just fine, but I can't talk to the target machine.  This is all local (LAN) so I don't think setting up nameservers or DNS is necessary but I may be mistaken here.  My ultimate goal is to boot TC as a live CD and have it act as a PXE boot environment, so my plan is to setup eth0 first, then start DHCP server, then TFTP server.

EDIT: Think I got it working.  One of the other adapters was on the 192.168.1.* subnet as well and seemed to have been interfering with it.  Now just working on mounting it and then automating the process.  Thanks.  Will leave this post here for those who are having problems as well.
« Last Edit: March 23, 2010, 04:02:14 PM by nim108 »