WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Easiest way to persist networking configuration?  (Read 4414 times)

Offline notfed

  • Newbie
  • *
  • Posts: 5
Easiest way to persist networking configuration?
« on: August 31, 2011, 01:19:57 PM »
Hi,

I'd like to use Tiny Core as a machine to test out some software. TC's major advantage for me is that I can just reboot the machine to bring it back to a pristine state (I don't have to worry about other software conflicting with my installation, and I don't have to worry about uninstallation). I have an automated build system that connects to Tiny Core via ssh, builds some source code, then installs it. 

However, each time I reboot, I have to reconfigure the network, and install OpenSSH.  If I could get it so that I could reboot and get back into an "almost" pristine state--with just the network configured and OpenSSH installed--that would be ideal.

Is there a Tiny Core mode of operation that would best meet this requirement?  I've considered creating a custom tiny core iso with OpenSSH preinstalled, but that's sort of inconvenient and I'm hoping I don't need to do this.

Thanks,
Jay

Offline christophed

  • Newbie
  • *
  • Posts: 10
Re: Easiest way to persist networking configuration?
« Reply #1 on: August 31, 2011, 01:55:15 PM »
Have a look at the wiki (you have different options):

http://wiki.tinycorelinux.net/wiki:persistence_for_dummies

What exactly do you mean by 'reconfiguring your network'?
If you are a bit more specific you'll probably get more specific advice ;-)

Offline vitex

  • Full Member
  • ***
  • Posts: 113
Re: Easiest way to persist networking configuration?
« Reply #2 on: August 31, 2011, 03:28:19 PM »
  I've considered creating a custom tiny core iso with OpenSSH preinstalled, but that's sort of inconvenient and I'm hoping I don't need to do this.

I always use remastered ISOs, which are easy to build from a running system with qremaster http://forum.tinycorelinux.net/index.php/topic,8522.msg45715.html#msg45715.  Those ISOs can also be booted directly using grub4dos.

My basic Tiny Core system is one that I have remastered to include an ssh server (dropbear instead of openssh in my case) and the ~/.ssh/authorized_keys file to let me access the system remotely.  If you want to try that approach, I will document the steps involved.

Offline notfed

  • Newbie
  • *
  • Posts: 5
Re: Easiest way to persist networking configuration?
« Reply #3 on: August 31, 2011, 03:30:50 PM »
Oops, I should have clarified. 

When I start Tiny Core, I have to set it to a specific IP address (we have a local DNS server entry pointing to it at a specific local IP address).  When I say "configure", I mean simply (1) opening ControlPanel->Network, (2) typing in an IP address, and (3) clicking Apply.  That's it.

I don't really care if it's OpenSSH or dropbear, I just need a way to connect via SSH, (if anyone cares).

Offline notfed

  • Newbie
  • *
  • Posts: 5
Re: Easiest way to persist networking configuration?
« Reply #4 on: August 31, 2011, 03:34:37 PM »
  I've considered creating a custom tiny core iso with OpenSSH preinstalled, but that's sort of inconvenient and I'm hoping I don't need to do this.

I always use remastered ISOs, which are easy to build from a running system with qremaster http://forum.tinycorelinux.net/index.php/topic,8522.msg45715.html#msg45715.  Those ISOs can also be booted directly using grub4dos.

My basic Tiny Core system is one that I have remastered to include an ssh server (dropbear instead of openssh in my case) and the ~/.ssh/authorized_keys file to let me access the system remotely.  If you want to try that approach, I will document the steps involved.

Sounds like you've been in the same boat I am in.  Believe it or not, as noobish as I sound, I've actually done that in the past (it's been over a year), but I was thinking maybe it was overkill.  I might be able to pick up on it quickly again if you have any links/tips/documentation to how to remaster tiny core.  There must have been a good tutorial somewhere if I was able to do it in the past.

Offline vitex

  • Full Member
  • ***
  • Posts: 113
Re: Easiest way to persist networking configuration?
« Reply #5 on: August 31, 2011, 05:10:09 PM »
When I start Tiny Core, I have to set it to a specific IP address (we have a local DNS server entry pointing to it at a specific local IP address).  When I say "configure", I mean simply (1) opening ControlPanel->Network, (2) typing in an IP address, and (3) clicking Apply.  That's it.

How are you booting your system?  Are the system components stored on a hard drive, on a CD-ROM, or some place else.  Are you attempting to save any state from one execution to the next?

It seems that what you need to do is find whatever files are modified by the network control panel.  After you click Apply, execute the following
 
Code: [Select]
find / -xdev -type f -mmin -3
which shows you all files that have been changed in the last 3 minutes.

It looks like /opt/eth0.sh is the file that you need to save, either in your backup or in a remaster.  It also looks like /opt/eth0.sh is automatically added to /opt/.flletool.lst, so /opt/eth0.sh should be retained if you are doing TC backups.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Easiest way to persist networking configuration?
« Reply #6 on: August 31, 2011, 07:35:13 PM »
Yes, I can confirm the reported finding: If you select 'Yes' for the 'Save Configuration?' radio button in the 'network' GUI it will:
  • Create a script named '/opt/eth0.sh' (if 'eth0' is the interface in question), that contains the three required commands to:
    • configure the interface with the fixed IP address, the netmask and the broadcast address,
    • add a default gateway route, and
    • define which DNS server to use
  • Add a call of this freshly created script to '/opt/bootlocal.sh so that these settings will be re-applied at rebooting (provided persistence is set up properly to ensure that the changed '/opt/eth0.sh' and '/opt/bootlocal.sh' "survive" the next reboot).
  • Add '/opt/eth0.sh' to '/opt/.filetool.lst' (i.e. the backup "white-list" to assist with persistence via the defaul backup method).
So it might just be the case of selecting the right radio button and ensuring that a backup of those files has happened (e.g. by running a one-off filetool.sh -b to be sure).

For further generic questions WRT persistence please consult the wiki or search this forum as this has been handled now countless times.