WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: configuration of Tiny Core, as DHCP server and client DHCP  (Read 18047 times)

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #30 on: January 11, 2017, 12:19:37 PM »
thanks,
I will see if dnsmasq will create it but for dnsmasq.leases, I have to create it ???
thanks again,

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #31 on: January 12, 2017, 03:42:03 AM »
Good morning,
I have a question, when I configure an ip address with
Ifconfig 192.168.99.14 netmask 255.255.255.0 gw 192.68.99.1


After reboot,
I lose my configuration.

What can cause this?

On Tiny core,
I can not get this command:
Sudo service dnsmasq restart ?????

someone can help me please???.

Thank you,

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #32 on: January 12, 2017, 04:15:57 AM »
Hi,
In Tiny Core,
Is there some other way to execute the network setup that is in /etc/network/interfaces?or /etc/networking restart????

Thanks for helping me.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #33 on: January 12, 2017, 04:27:03 AM »
The cause is the nature of Tiny Core.
You really should read the Core book.
http://tinycorelinux.net/corebook.pdf

If the connection has been configured via  network  tool, then a script with the name of the interface (e.g. eth0.sh) is stored in  /opt  and a respective entry is written to  /opt/bootlocal.sh  (so it's started at boot).

As always, refreshing the backup is needed in order to survive reboots.
The directory  /opt  is configured to be included in the backup by default.

If you have created the connection manually, directly in the console via commands, then there is nothing to be saved.
If you have created a script to start your connection, then you have to add this script to your backup manually (except for files in /opt) and create a respective entry, for example in  /opt/bootlocal.sh , if you want it to be started at boot.

Services are managed differently on Core:
Code: [Select]
sudo /usr/local/etc/init.d/dnsmasq restart
For most services, you can also use the  services  tool.
Download a copy and keep it handy: Core book ;)

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #34 on: January 13, 2017, 10:45:53 AM »
Hi there,
I have a problem,
When I put information in
/opt/resolv.conf
/ Etc / hosts

After reboot,
I dont find this information,

someone Could  help me?

thanks

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #35 on: January 13, 2017, 11:14:08 AM »
/etc/hosts  is recreated at boot to include the hostname.
You could add something like this to  /opt/bootsync.sh
Code: [Select]
cat /path/to/your-custom-hosts-file >> /etc/hosts &
just below
Code: [Select]
/usr/bin/sethostname box
Download a copy and keep it handy: Core book ;)

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #36 on: January 13, 2017, 11:28:08 AM »
Hi,
I didn't understand,
Please,

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #37 on: January 13, 2017, 11:33:58 AM »
Maybe I misunderstood you.
I thought you have edited  /etc/hosts , added it to  /opt/.filetool.lst  and made a backup but your edits were gone after reboot.
If that's correct, then I don't know how to give better instructions.
Otherwise, please rephrase your question.
Download a copy and keep it handy: Core book ;)

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #38 on: January 13, 2017, 11:44:01 AM »
I dit this,
But i lose my data after reboot

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #39 on: January 13, 2017, 02:57:30 PM »
Here is my configuration:

cat /opt/bootsync.ch
/etc/hosts
/usr/bin/sethostname box
/etc/resolv.conf


cat /etc/hosts
127.0.0.1  localhost
@ip        name1.domain.com
@ip        name2.domain.com


cat /etc/resolv.conf
domain    domain.com
search    domain.com

cat /opt/eth0.sh
echo nameserver @ip > /etc/resolv.conf
echo nameserver @ip >> /etc/resolv.conf
I lose this after reboot

cat /etc/hosts
@ip        name1.domain.com
@ip        name2.domain.com

cat /etc/resolv.conf
domain    domain.com
search    domain.com

cat /opt/eth0.sh
echo nameserver @ip > /etc/resolv.conf
echo nameserver @ip >> /etc/resolv.conf

I try to understand why I lose my configuration, that's my question or my questions????

Thanks for help

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #40 on: January 14, 2017, 01:51:17 PM »
cat /opt/bootsync.ch
/etc/hosts
/usr/bin/sethostname box
/etc/resolv.conf

Sorry, this doesn't make sense to me.

I suggest you read this
http://tinycorelinux.net/book.html
to get an understanding how Core Linux works.
Download a copy and keep it handy: Core book ;)

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #41 on: January 15, 2017, 02:06:10 AM »
Hello,
Do you have the same documentation in French?
I ask a lot of questions, it's true
I had never worked on Linux distributions.
please,
Thanks

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #42 on: January 15, 2017, 03:38:52 PM »
Good evening,

On tiny core,
There is a command to get an ip address from a dhcp server ??

thanks,

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #43 on: January 15, 2017, 04:27:34 PM »
The documentation is English only, I'm afraid.

Core Linux tries to get an IP via DHCP for ethernet at boot by default unless the  nodhcp  boot code is used.

To get an IP assigned via DHCP after boot, you can use something like this:
Code: [Select]
#!/bin/sh

[ "`id -u`" -eq 0 ] || { echo "Must be root." ; exit 1 ; }

pkill udhcpc
udhcpc -b -i eth0 -x hostname:box -p /var/run/udhcpc.eth0.pid

You could safe it as, for example,  /opt/eth0-dhcp.sh  and it needs to be run with  sudo .

Or use the  Network  GUI tool.
Download a copy and keep it handy: Core book ;)

Offline amonel

  • Newbie
  • *
  • Posts: 29
Re: configuration of Tiny Core, as DHCP server and client DHCP
« Reply #44 on: January 16, 2017, 05:17:02 AM »
Thanks,

On tiny core,
There is a command to configure an ipv6 address

thanks,