1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

NAS200 how to modify IP address from my script ?

Discussion in 'Cisco/Linksys Network Storage Devices' started by matsimoto, Mar 27, 2008.

  1. matsimoto

    matsimoto LI Guru Member


    I have programmed a small python skript, that is able to listen on a multicast address und set the IP number of the NSLU2.

    I would like to put it on the NAS200, but I am confused about the fact, that, the configuration data is stored in the file /etc/CGI_ds.conf.

    When entering mount I get :
    /dev/rom1 on / type squashfs (ro)
    none on /proc type proc (rw)
    none on /etc type ramfs (rw)
    none on /var type ramfs (rw)
    none on /harddisk type ramfs (rw)
    none on /tmp type ramfs (rw)
    none on /dev type ramfs (rw)
    none on /mnt type ramfs (rw)
    /dev/sda1 on /harddisk/volume_1/data type xfs (rw,usrquota)
    /dev/sda2 on /harddisk/volume_1/conf type xfs (rw)
    If /etc/CGI_ds.conf is stored in the ramfs how can it persist a power down/up ???

    Is there another place where the IP address is persistently stored.

  2. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The CGI_ds.conf file is also stored in flash memory, in /dev/mtd2 to be precise. The file is preceded in flash by the length as a binary DWORD. This is how the NAS200 stores your configuration, even when there is no harddisk installed. All other configuration files are either generated from the CGI_ds.conf file, or stored in the configuration partition on each of the harddisks and recovered from the first harddisk on startup.

    I tried to update the file in flash from the shell (telnet) but that didn't work: only a small amount of bytes gets written, and the rest is replaced by garbage. I tried cp, cat and dd with various block sizes and then I gave up, because it wasn't essential for what I wanted to do anyway (I was trying to see what would happen if I would change "telnet_enable=no" to "telnet_enable=yes" but I already had a telnetd running).

    If you want to make a change to your configuration that you can't accomplish through the web pages, the easiest way is to make the change to /etc/CGI_ds.conf, then use the web page to download a backup of your configuration, then restore that backup. When you click backup it copies the file from /etc, and when you click restore it writes the file to flash.

    Hopefully this is enough information to help you with your project.

  3. matsimoto

    matsimoto LI Guru Member

    Hi Jac,

    ok cool, not the answer I hoped for, but I think I will start a small job from rc.1 to setup the parameters I need.

    Thanks for your immediate answer.


Share This Page