This shows you the differences between the selected revision and the current version of the page.
| my_debian_linux_on_the_nslu2_installation_and_configuration_guide 2007/09/12 13:20 | my_debian_linux_on_the_nslu2_installation_and_configuration_guide 2009/08/20 17:50 current | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== What is this? ==== | + | A step-by-step practical guide to installing & configuring Debian  |
| - | This is a guide on installing the Linux distribution 'Debian' [[http://www.debian.org]] on the Linksys NSLU2 | + | Linux on the NSLU2, together with some very common applications and  |
| + | instructions on how to do some hardware modifications on the  | ||
| + | Linksys NSLU2, | ||
| + | by Sebastiaan Giebels [sgie bels_nslu2ATpc probleemloos.nl]. | ||
| === What is a NSLU2? === | === What is a NSLU2? === | ||
| {{ nslu2-backside.jpg|}}{{ nslu2.jpg|}} | {{ nslu2-backside.jpg|}}{{ nslu2.jpg|}} | ||
| - | The [[http://nl.wikipedia.org/wiki/NSLU2|NSLU2]] is a small form factor networking device, with a 100Mbit ethernet connection and 2 USB2.0 ports for attaching USB storage devices (disk drives and flash drives) to be used on the network (Windows file sharing, FTP, etc). It is distributed by Linksys (a Cisco division) and it runs on Linux. Some people like to call it a NAS (Network Attached Storage device). | + | The [[http://wikipedia.org/wiki/NSLU2|NSLU 2]] is a small form factor  |
| + | networking device, with a 100Mbit ethernet connection and 2 USB2.0 ports  | ||
| + | for attaching USB storage devices (disk drives and flash drives) to be  | ||
| + | used on the network (Windows file sharing, FTP, etc). It is distributed  | ||
| + | by Linksys (a Cisco division) and it runs on Linux. Some people like to  | ||
| + | call it a NAS (Network Attached Storage device), although no  | ||
| + | drives/disks are supplied with it. Â | ||
| + | [[http://www.linksys.com/servlet/Satellite?c=L_Product_C2&childpagename=US%2FLayout&cid=1115416906769&pagename=Linksys%2FCommon%2FVisitorWrapper|Linksys NSLU2 product page]]Â | ||
| + | Â | ||
| + | === What is Debian ===Â | ||
| + | A distribution of the Linux operating system [[http://www.debian.org]] available for many  | ||
| + | architectures (=types of processors), including the 'ARM' (the processor in the NSLU2). | ||
| + | Â | ||
| + | === Why would one want to run Linux on the NSLU2 or perform hardware modifications to it? ===Â | ||
| + | The Linux distribution preinstalled by Linksys on the device is rather  | ||
| + | limited, for example it's only possible to use USB storage devices. By  | ||
| + | installing linux yourself (and the proper drivers) you can use other USB Â | ||
| + | devices (such as camera's, printers, wireless network adapters), run  | ||
| + | many more software titles (all freely available), just as you could with  | ||
| + | a real linux machine. \\Â | ||
| + | Â | ||
| + | It's like turning a shopping cart into a shiny looking car, and  | ||
| + | the good thing: all of this can be done for free!\\ | ||
| - | === Why would one want to modify the NSLU2? ===Â | + | URL: [[http://www.nslu2-linux.org/|Linux on the NSLU2 page]] |
| - | The Linux distribution preinstalled by Linksys on the device is rather limited, for example it's only possible to use USB storage devices. By installing linux yourself (and the proper drivers) you can use other USB devices (such as camera's, printers, wireless network adapters), run many more software titles (all freely available), just as you could with a real linux machine. It's like turning a shopping cart into a car, and the good thing: it's free! | + | |
| Besides the software aspect of mods, it's also possible to tinker with the hardware: enable the 'hidden' USB ports, have the device power up automatically when power is applied, or change the CPU speed from 133Mhz to 266Mhz (newer models however are already running at 266Mhz factory-default). All these hardware modifications require soldering, so you might start with 'just running Linux on it' if you're not that much of a hero ;) | Besides the software aspect of mods, it's also possible to tinker with the hardware: enable the 'hidden' USB ports, have the device power up automatically when power is applied, or change the CPU speed from 133Mhz to 266Mhz (newer models however are already running at 266Mhz factory-default). All these hardware modifications require soldering, so you might start with 'just running Linux on it' if you're not that much of a hero ;) | ||
| Line 16: | Line 40: | ||
| === Who am I? === | === Who am I? === | ||
| - | I work as an IT consultant for [[http://www.pcprobleemloos.nl|PC Probleemloos]] in Eindhoven, The Netherlands and I'm a Linux & BSD enthousiast. Besides being a supporter of open source software, I like good technology and properly designed products. | + | I work as an IT consultant for [[http://www.pcprobleemloos.nl|PC Probleemloos]] in Eindhoven, The Netherlands and I'm a Linux & BSD enthousiast.  |
| - | I have an electrotechnical/electromechanical background. | + | I have an computer-science/electrotechnical/electromechanical background. |
| + | Besides being a supporter of open source software, I like good technology and properly designed products like the NSLU2. Â | ||
| + | However, with a broken power adapter for one of my NSLU2's  | ||
| + | (noticable by the high pitch sound coming from the adapter and the NSLU2 not booting)Â | ||
| + | and the Linksys policy requiring me to send both power adapter _AND_ my (heavily modded, but not broken) NSLU2 back for repair (read: complete product replacement), I've removed the words 'sold by a customer-friendly company' from the previous line. | ||
| ===== Getting started ===== | ===== Getting started ===== | ||
| - | === Getting a NSLU2 === | ||
| + | I'll show step-by-step how to get common applications running on the Linksys NSLU2 (Network Storage Link for USB 2.0 Disk Drives), and I'll show you how I've configured mine. | ||
| - | I'm going to show you step-by-step how to get Linux & some common applications running on the Linksys NSLU2 (Network Storage Link for USB 2.0 Disk Drives) | + | A good starting point for getting Linux on the NSLU2 is http://www.nslu2-linux.org/wiki/Debian/HomePage\\Â |
| + | I've used the 'manual' Debian installation method, described at the website | ||
| + | http://www.cyrius.com/debian/nslu2/unpack.html\\Â | ||
| + | It's dedicated to the NSLU2 (so a lot of settings are set up properly for NSLU2 use) and worked perfectly on my device. | ||
| + | Follow the instructions (first, create the neccessary partitions, minimun 500MB for /dev/sda1, on an USB stick, unpack the Debian distribution to this partitions, and flash the firmware your NSLU2 using the upslug2 tool. | ||
| + | After installation, there are a few things you should not forget (there is mention of it in the cyriuys.com article, but the exact commands are not given): | ||
| - | [[http://www.linksys.com/servlet/Satellite?c=L_Product_C2&childpagename=US%2FLayout&cid=1115416906769&pagename=Linksys%2FCommon%2FVisitorWrapper|Linksys NSLU2 product page]] | ||
| - | [[http://www.nslu2-linux.org/|Linux on the NSLU2 page]] | + | . Change the root password:Â |
| + | Login as root, then enter:Â | ||
| + | passwd | ||
| + | Enter a new password (twice) | ||
| - | Quote:If you install to flash, you'll want to spare it as many writes as  | + | Add normal user accounts |
| - | you can, so mount it with the 'noatime' parameter. | + | adduser <my_username>Â |
| + | Fill in the details (such as the password) | ||
| - | and  | + | Regenerate the system SSH-key: |
| - | Set the syslog defaults  | + | cd /etc/ssh/ |
| - | in /etc/default to "-m 0" to disable periodic MARK entries to the file. Â | + | ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''Â |
| - | Specifically, add "SYSLOGD="-m 0" to /etc/default/syslogd. | + | ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''Â |
| + | ('-N' specifies the password, in our case it's empty. 'rsa1' probably not required)Â | ||
| + | There is a tool to check your key against a recent OpenSSH attach, where the Debian (and Ubuntu) ssh keygenerator wasn't creating secure keys. See OpenSSH.org for more details. | ||
| + | If you have previously connected to this machine, the next time you'll connect, you will get a 'key has changed' warning. Â | ||
| + | Remove the corresponding entry in ~/.ssh/known_hosts and retry. | ||
| - | ==== Flash drive as boot drive ==== | + | Change the timezone you live in:Â |
| + | tzconfig | ||
| + | Â | ||
| + | Add additional user accounts | ||
| + | Â | ||
| + | As a security measure, you might want to disable root ssh logins in /etc/ssh/sshd (?)Â | ||
| + | Â | ||
| + | Â | ||
| + | ===== Flash drive as boot drive ===== | ||
| I've connected a 1GB flash disk to the NSLU2, and I'm going to put my Debian on this drive. | I've connected a 1GB flash disk to the NSLU2, and I'm going to put my Debian on this drive. | ||
| + | I suggest using 1GB or larger. 512MB might work too, but will probably require you to decide which parts of the debian system you won't use that could be deleted. | ||
| + | |||
| + | Ýou can mount the flash drive inside the casing and hard-wire it (or use a header?), but having the option to disconect the flash disk and 'do repairs' on another computer can be quite usefull, so leave it external for now. | ||
| + | |||
| + | ==== Preventing flash writes / Reduce wear on flash memory ==== | ||
| + | URL: http://www.nslu2-linux.org/wiki/Unslung/Ext3flash | ||
| + | URL: http://www.nslu2-linux.org/wiki/Debian/FAQ | ||
| + | |||
| + | How can I avoid swapping / beating up my flashdrive? | ||
| + | You want to minimize the writes to your flash drives, as flash/usb drive media quality decreases after a number of writes. | ||
| + | I won't disable swapping to flash however. Using flash temporarily is better than crashing totally I think. | ||
| + | |||
| + | |||
| + | 1: Mount your partitions with the 'noatime' parameter. | ||
| + | |||
| + | My /etc/fstab file, note the 'noatime' option, to prevent updating the file-access-timestamp each time a file is read (atime='access-timestamp'), thus preventing a lot of write actions to the flash disk. | ||
| + | If you don't use noatime, every file read will also perform a write to update the access time information. See Ext3flash for up to date information on achieving this. | ||
| + | <html> | ||
| + | # /etc/fstab: static file system information. | ||
| + | # | ||
| + | # <file system> <mount point> <type> <options> <dump> <pass> | ||
| + | proc /proc proc defaults 0 0 | ||
| + | /dev/sda1 / ext3 defaults,errors=remount-ro,noatime 0 1 | ||
| + | /dev/sda6 /home ext3 defaults,noatime 0 2 | ||
| + | /dev/sda5 none swap sw 0 0 | ||
| + | /dev/sda1 /media/usb0 auto rw,user,noauto,noatime 0 0 | ||
| + | /dev/sda5 /media/usb1 auto rw,user,noauto,noatime 0 0 | ||
| + | /dev/sda6 /media/usb2 auto rw,user,noauto,noatime 0 0 | ||
| + | </html> | ||
| + | http://www.nslu2-linux.org/wiki/HowTo/FixSlowBootup | ||
| + | |||
| + | 2: Let the system know not to hammer the flash memory and wear it out | ||
| + | |||
| + | Create a file .ext3flash in the root folder: | ||
| + | touch /.ext3flash | ||
| + | |||
| + | 3: Minimizing the swap usage: | ||
| + | |||
| + | If you have a swap partition on flash, it might be a good idea to change the kernel's swapping behaviour to minimize swapping: | ||
| + | |||
| + | View the current kernel/proc/system setting on swapping behaviour: | ||
| + | cat /proc/sys/vm/swappiness | ||
| + | <html> | ||
| + | 60 | ||
| + | </html> | ||
| + | 'Depreciate' swapping, by setting it to '0': | ||
| + | echo "0" > /proc/sys/vm/swappiness | ||
| + | |||
| + | |||
| + | 4: Disable 'MARK' messages in syslogd options: | ||
| + | |||
| + | nano /etc/default/syslogd | ||
| + | Add: | ||
| + | <html> | ||
| + | SYSLOGD="-m 0" | ||
| + | </html> | ||
| + | |||
| + | |||
| + | 5: Prevent logging of unimportant stuff | ||
| + | |||
| + | Look at your log files, and see if you are recording more than you need. You can also instruct syslog to buffer its output, avoiding writes after every line, by putting a - before the filename in syslog.conf. | ||
| + | .bash_history logging | ||
| + | |||
| + | |||
| + | == Optional: == | ||
| + | Disable disk integrity checks. This is done because in some situation, it would take forever at boot time (or even don't boot as some have reported). | ||
| + | /sbin/tune2fs -c 0 -i 0 /dev/sda1 | ||
| + | Note: | ||
| + | * "-c 0" disables disk integrity checks that normally occuring every 33 mounts. | ||
| + | * "-i 0" disables disk integrity checks that normally occuring every 180 days | ||
| + | |||
| + | |||
| + | ===== Flash Read and write speeds ===== | ||
| + | |||
| + | Some flash drives are faster than others. You can measure the speed of your drive as follows: | ||
| + | |||
| + | My model (no-name 'USB DISK 20X'): | ||
| + | <html> | ||
| + | drivers/usb/input/hid-core.c: v2.6:USB HID core driver | ||
| + | Vendor: Model: USB DISK 20X Rev: PMAP | ||
| + | Type: Direct-Access ANSI SCSI revision: 00 | ||
| + | (no-name brand) | ||
| + | </html> | ||
| + | |||
| + | |||
| + | === Read speed === | ||
| + | <html> | ||
| + | nslu2:/# dd if=/dev/sda1 of=/dev/null bs=10000 count=10000 | ||
| + | 10000+0 records in | ||
| + | 10000+0 records out | ||
| + | 100000000 bytes (100 MB) copied, 11.1673 seconds, 9.0 MB/s | ||
| + | </html> | ||
| + | === Write speed === | ||
| + | dd if=/dev/zero of=/home/delete_me.tmp bs=1M count=30 | ||
| + | <html> | ||
| + | 30+0 records in | ||
| + | 30+0 records out | ||
| + | 31457280 bytes (31 MB) copied, 10.3701 seconds, 3.0 MB/s | ||
| + | </html> | ||
| + | rm /home/delete_me.tmp | ||
| + | |||
| + | |||
| + | |||
| + | ===== Memmory issues ===== | ||
| + | The NSLU2 has just 32MB of RAM. Don't use more RAM than you have, or it will swap portions of memmory to your flash drive (which is not good) | ||
| + | Check 'top' to make sure the swapping stays low (look for '0.0%wa' or '0.0%swap', and 'Swap ... ..k used'), or else your NSLU2 is slowly destroying your flash drive... | ||
| + | |||
| + | A Few lines of 'top' output of my NSLU2: | ||
| + | <html> | ||
| + | Tasks: 37 total, 1 running, 36 sleeping, 0 stopped, 0 zombie | ||
| + | Cpu(s): 1.0%us, 0.3%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.0%hi, 0.0%si, | ||
| + | 0.0%st | ||
| + | Mem: 29988k total, 28436k used, 1552k free, 6232k buffers | ||
| + | Swap: 56188k total, 40k used, 56148k free, 8752k cached | ||
| + | </html> | ||
| + | |||
| + | To save more memmory: | ||
| + | Disable appletalk?\\ | ||
| + | exim or postfix?\\ | ||
| + | dropbear or openssh?\\ | ||
| + | proftpd or ...?\\ | ||
| + | apache, httpd, boa?\\ | ||
| + | |||
| + | Use apt-get instead of the user-interface 'aptitude', and don't update the cpan 'available perl modules' database. Install cpan modules by hand. | ||
| + | |||
| + | |||
| + | Use 'ps auxww' or 'free' to view the memmory used by the applications. | ||
| + | |||
| + | To see which kernel modules are loaded into memory: | ||
| + | lsmod | ||
| + | Example output: | ||
| + | <html> | ||
| + | Module Size Used by | ||
| + | ledtrig_heartbeat 3040 0 | ||
| + | dm_snapshot 17180 0 | ||
| + | dm_mirror 20948 0 | ||
| + | dm_mod 59120 2 dm_snapshot,dm_mirror | ||
| + | rtc_dev 7432 0 | ||
| + | ixp4xx_mac 19572 0 | ||
| + | evdev 10400 0 | ||
| + | ixp4xx_qmgr 8652 5 ixp4xx_mac | ||
| + | ixp4xx_npe 14368 2 ixp4xx_mac | ||
| + | ixp4xx_beeper 3616 0 | ||
| + | firmware_class 10656 1 ixp4xx_npe | ||
| + | ext3 137704 2 | ||
| + | jbd 59368 1 ext3 | ||
| + | mbcache 9188 1 ext3 | ||
| + | sd_mod 19248 4 | ||
| + | usbhid 53252 0 | ||
| + | usb_storage 77707 3 | ||
| + | scsi_mod 102800 2 sd_mod,usb_storage | ||
| + | ehci_hcd 31240 0 | ||
| + | ohci_hcd 17156 0 | ||
| + | usbcore 126920 5 usbhid,usb_storage,ehci_hcd,ohci_hcd | ||
| + | </html> | ||
| + | |||
| + | ===== Beep ip address trough internal speaker ===== | ||
| + | Make sure 'beep' is installed | ||
| + | |||
| + | apt-get install beep | ||
| + | |||
| + | Basic usage: beep -l <LENGTH> -f <FREQUENCY>\\ | ||
| + | -l length, in ms (I use 10 - 1000)\\ | ||
| + | -f (frequency, between 1 and 130 works here)\\ | ||
| + | -d <DELAY>: wait a number of ms after beeping\\ | ||
| + | |||
| + | Here's a shell script to beep an IP address trough the internal speaker on the NSLU2 | ||
| + | I use it to find out which ip address my NSLU2 got assigned by DHCP. It simply plays/beeps the numbers of the ip addres trough the speaker. We'll configure it to auto start on boot, so you'll never have to worry which ip addres the device is on. | ||
| + | |||
| + | <html> | ||
| + | #!/bin/sh | ||
| + | # Beep ip address trough internal pc speaker | ||
| + | # Tested on Debian Linux @NSLU2 | ||
| + | # Author: Sebastiaan Giebels, 2007 | ||
| + | |||
| + | # Retreive dot-separated ipv4 address from the ifconfig information, using grep and cut: | ||
| + | IPADDRESS=`/sbin/ifconfig | grep -A1 "eth0" | grep "inet" | cut -d: -f 2 |cut -d" " -f1` | ||
| + | |||
| + | # Enable next line for debugging: | ||
| + | #echo $IPADDRESS | ||
| + | |||
| + | #Uncomment this for an example with zeroes in the ip address: | ||
| + | #IPADDRESS="10.0.0.1" | ||
| + | |||
| + | # For all characters in dotted ipv4 address: | ||
| + | for ((a=0; a < ${#IPADDRESS} ; a++)) | ||
| + | do | ||
| + | # Get the next character to process: | ||
| + | NUMBER=${IPADDRESS:$a:1} | ||
| + | |||
| + | if [ "." == "$NUMBER" ] | ||
| + | then | ||
| + | # Different note to signal a '.' in the address: | ||
| + | `/usr/bin/beep -l 20 -f 25 -d 20` | ||
| + | else if [[ "$NUMBER" -ge "0" && "$NUMBER" -le "9" ]] | ||
| + | then | ||
| + | # Beep 'NUMBER' times, except for 0 (=beep 10 times): | ||
| + | if [ "$NUMBER" == "0" ] | ||
| + | then | ||
| + | NUMBER=10 | ||
| + | fi | ||
| + | `/usr/bin/beep -l 45 -f 15 -d 150 -r $NUMBER` | ||
| + | |||
| + | fi | ||
| + | fi | ||
| + | sleep 1 | ||
| + | done | ||
| + | </html> | ||
| + | Save the script as '/bin/beep_ip.sh', then: | ||
| + | chmod ugo+x /bin/beep_ip.sh | ||
| + | Test it: | ||
| + | /bin/beep_ip.sh | ||
| + | Configure it to auto-start upon next boot: | ||
| + | nano /etc/rc.local | ||
| + | Insert the following text just above the last 'exit 0' line: | ||
| + | <html> | ||
| + | /bin/beep_ip.sh | ||
| + | </html> | ||
| + | Although not required, you can now reboot to test it. | ||
| + | |||
| + | |||
| + | I've written another (simpler) script, that just outputs a few tones. I use it in /etc/rc.local to signal to me that the NSLU2 has finished booting. | ||
| + | <html> | ||
| + | #!/bin/sh | ||
| + | #Output a few notes trough the internal speaker: | ||
| + | #You can play multiple notes with one command, use the -n between the -f/-l/-D parameters | ||
| + | # Tested on Debian Linux @NSLU2 | ||
| + | # Author: Sebastiaan Giebels, 2007 | ||
| + | |||
| + | /usr/bin/beep -e /dev/input/event0 -f 329.628 -l 100 -D 20 | ||
| + | /usr/bin/beep -e /dev/input/event0 -f 391.995 -l 100 -D 20 | ||
| + | /usr/bin/beep -e /dev/input/event0 -f 523.251 -l 100 -D 20 | ||
| + | /usr/bin/beep -e /dev/input/event0 -f 261.626 -l 300 | ||
| + | </html> | ||
| + | I saved this text as /bin/beep_1234.sh, and to make it executable, I entered: | ||
| + | chmod ugo+x /bin/beep_1234.sh | ||
| + | |||
| + | |||
| + | ===== Change function of power button ===== | ||
| + | URL: http://www.nslu2-linux.org/wiki/Debian/FAQ | ||
| + | Quote: 'How do I change the function of the power button on the NSLU2 to shut the system down as opposed to rebooting it?' | ||
| + | nano /etc/inittab | ||
| + | Change the line: | ||
| + | <html> | ||
| + | ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now | ||
| + | </html> | ||
| + | to: | ||
| + | <html> | ||
| + | ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now | ||
| + | </html> | ||
| + | ('-r' means reboot, '-h' means 'halt') | ||
| + | |||
| + | |||
| + | ===== Disable IPV6 ===== | ||
| + | I don't use ipv6 on my NSLU2 at the moment, so I'll turn it off. | ||
| + | First, check if it's really enabled: | ||
| + | ifconfig | ||
| + | Look for a line beginning with 'inet6' (actual numbers will vary): | ||
| + | <html> | ||
| + | inet6 addr: fe80::213:10ff:fed3:a853/64 Scope:Link | ||
| + | </html> | ||
| + | lsmod | grep ipv6 | ||
| + | <html> | ||
| + | ipv6 269672 12 | ||
| + | </html> | ||
| + | Presence of these lines confirm that ipv6 is enabled. | ||
| + | |||
| + | To disable IPv6: | ||
| + | nano /etc/modprobe.d/aliases | ||
| + | Change: | ||
| + | <html> | ||
| + | alias net-pf-10 ipv6 | ||
| + | </html> | ||
| + | to: | ||
| + | <html> | ||
| + | #alias net-pf-10 ipv6 | ||
| + | alias net-pf-10 off | ||
| + | </html> | ||
| + | |||
| + | You can check the result using ifconfig after you have rebooted. | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ====== Connecting USB peripherals to the NSLU2 ====== | ||
| + | |||
| + | |||
| + | {{ silvershield-sis-pm.jpg|}} | ||
| + | ===== Silvershield/Gembird SiS-PM ===== | ||
| + | Some instructions for if you have Debian Linux installed on your NSLU2, | ||
| + | and you want to connect the Gembird SISPM USB controlled power socket/outlet with the NSLU2 | ||
| + | |||
| + | |||
| + | Download the latest version of sispmctl | ||
| + | from the official website http://sispmctl.sourceforge.net and extract ut | ||
| + | cd /usr/src | ||
| + | wget http://switch.dl.sourceforge.net/sourceforge/sispmctl/sispmctl-2.4b.tar.gz | ||
| + | tar -zxvf sispmctl-2.4b.tar.gz | ||
| + | It comes distributed as source, so we will need to compile it: | ||
| + | cd sispmctl-2.4b | ||
| + | ./configure | ||
| + | <html> | ||
| + | configure: error: no acceptable C compiler found in $PATH | ||
| + | </html> | ||
| + | Ok, so we'll install a C compiler, like 'gcc' together with the libc sources, and the 'make' tool: | ||
| + | apt-get install gcc libc6-dev make | ||
| + | We also need the libusb sources: | ||
| + | apt-get install libusb-dev | ||
| + | Retry configure: | ||
| + | ./configure | ||
| + | If all went well, you should see: | ||
| + | <html> | ||
| + | ... | ||
| + | Good - your configure finished. Start make now | ||
| + | </html> | ||
| + | make | ||
| + | make install | ||
| + | |||
| + | After installation, the folder /usr/local/share/httpd/sispmctl/ will | ||
| + | contain some web interface stuff, and the main application is | ||
| + | here: /usr/local/bin/sispmctl | ||
| + | |||
| + | Let's try to start it: | ||
| + | /usr/local/bin/sispmctl | ||
| + | <html> | ||
| + | No GEMBIRD SiS-PM found. Check USB connections, please! | ||
| + | </html> | ||
| + | Have I already told you to connect it? If not, please do so now. | ||
| + | Avoid USB hubs at first, till things work. You can always 'expand' | ||
| + | your situation by adding an USB hub, but please try plugging it | ||
| + | in directly to your NSLU2 first | ||
| + | |||
| + | /usr/local/bin/sispmctl -s | ||
| + | <html> | ||
| + | Gembird #0 is USB device 003.This device is a 4-socket SiS-PM. | ||
| + | </html> | ||
| + | Indicating the device has been detected. | ||
| + | You can use the parameters '-o #' or '-f #' to power On or power oFf a | ||
| + | socket, where # is the socket number (1,2,3 or 4). | ||
| + | E.g.: power off device at socket 2: | ||
| + | /usr/local/bin/sispmctl -f 2 | ||
| + | I have only one SiS-PM device, haven't tested more of them connected | ||
| + | togeter to one NSLU2. | ||
| + | |||
| + | Silver Shield | ||
| + | |||
| + | |||
| + | |||
| + | ====== Hardware modifications ====== | ||
| + | |||
| + | ===== Opening the case ===== | ||
| + | I have to make a video for this one. Please remind me to do so. | ||
| - | ===== Hardware modifications =====Â | + | ===== De-underclocking ===== |
| - | === Opening the case ===Â | + | |
| - | I have to make a video for this one | + | |
| - | === Checking the CPU speed === | + | |
| The models produced before ../2006? have their IXP4 processors underclocked. They're running on 133Mhz, instead of the 266Mhz it can run. | The models produced before ../2006? have their IXP4 processors underclocked. They're running on 133Mhz, instead of the 266Mhz it can run. | ||
| + | |||
| + | == Checking the CPU speed to determine if your NSLU2 is underclocked == | ||
| + | |||
| To check if your NSLU2 is running at the fastest speed (266Mhz), enter the linux command: | To check if your NSLU2 is running at the fastest speed (266Mhz), enter the linux command: | ||
| cat /proc/cpuinfo | cat /proc/cpuinfo | ||
| Line 60: | Line 462: | ||
| The number at the 'BogoMIPS' line is not very accurate, but it should show a value of about 266. If it's 133, it's time to [[http://www.nslu2-linux.org/wiki/HowTo/OverClockTheSlug|OverClockTheSlug]] | The number at the 'BogoMIPS' line is not very accurate, but it should show a value of about 266. If it's 133, it's time to [[http://www.nslu2-linux.org/wiki/HowTo/OverClockTheSlug|OverClockTheSlug]] | ||
| - | === Automatically boot-up on power === | + | ==== Automatically boot-up on power ==== |
| To have the NSLU2 automatically start/boot whenever power is applied to it, requires a tiny bit of soldering, and just one component: ... | To have the NSLU2 automatically start/boot whenever power is applied to it, requires a tiny bit of soldering, and just one component: ... | ||
| - | === Connecting USB peripherals to the NSLU2 === | + | Also check the software mod: Change function of power button, to have the NSLU2 powerdown instead of reboot when pressing the power button. |
| + | Â | ||
| + | Â | ||
| + | Â | ||
| + | ====== cpuinfo output ======Â | ||
| + | cat /proc/cpuinfo | ||
| + | <html>Â | ||
| + | Processor : XScale-IXP42x Family rev 1 (v5l)Â | ||
| + | BogoMIPS : 266.24Â | ||
| + | Features : swp half fastmult edsp | ||
| + | CPU implementer : 0x69Â | ||
| + | CPU architecture: 5TEÂ | ||
| + | CPU variant : 0x0Â | ||
| + | CPU part : 0x41f | ||
| + | CPU revision : 1Â | ||
| + | Cache type : undefined 5Â | ||
| + | Cache clean : undefined 5Â | ||
| + | Cache lockdown : undefined 5Â | ||
| + | Cache format : Harvard | ||
| + | I size : 32768Â | ||
| + | I assoc : 32Â | ||
| + | I line length : 32Â | ||
| + | I sets : 32Â | ||
| + | D size : 32768Â | ||
| + | D assoc : 32Â | ||
| + | D line length : 32Â | ||
| + | D sets : 32Â | ||
| + | Â | ||
| + | Hardware : Linksys NSLU2Â | ||
| + | Revision : 0000Â | ||
| + | Serial : 0000000000000000Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | ====== References ======Â | ||
| + | Â | ||
| + | http://www.mou.ch/cedric/docs/linux/NSLU2/nslu2.html | ||
| + | Â | ||
| + | Â | ||
| + | ===== Junk below this line =====Â | ||
| + | ===== Current issues =====Â | ||
| + | Â | ||
| + | http://www.nslu2-linux.org/wiki/HowTo/KeepRemoteConsoleSessionRunning | ||
| + | http://www.nslu2-linux.org/wiki/HowTo/AutoRebootOnPanic | ||
| + | echo "kernel.panic=5" >> /etc/sysctl.conf | ||
| + | what's this?:Â | ||
| + | /USR/SBIN/CRON[2806]: (root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$ ... | ||
| + | Â | ||
| + | Â | ||
| + | nano take_preview_photo.cgi | ||
| + | <html>Â | ||
| + | #!/bin/sh | ||
| + | Â | ||
| + | cd /mnt/Â | ||
| + | echo Content-Type: image/jpeg | ||
| + | /usr/bin/gphoto2 --camera STV0680 --stdout --capture-preview > /dev/null | ||
| + | echo | ||
| + | cat /mnt/capture.pnm | /usr/bin/pnmtojpeg | ||
| + | rm /mnt/capture.pnm | ||
| + | </html>Â | ||
| + | Â | ||
| + | Â | ||
| + | ===== Wireless network =====Â | ||
| + | Currently not working. | ||
| + | Â | ||
| + | List all connected USB devices:Â | ||
| + | Â | ||
| + | lsusb | ||
| + | <html>Â | ||
| + | Bus 003 Device 014: ID 083a:4505 Accton Technology Corp. | ||
| + | Bus 003 Device 012: ID 07d1:3c03 D-Link System | ||
| + | Bus 003 Device 002: ID 0d7d:1600 Phison Electronics Corp. | ||
| + | Bus 003 Device 001: ID 0000:0000Â | ||
| + | Bus 002 Device 001: ID 0000:0000Â | ||
| + | Bus 001 Device 001: ID 0000:0000Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | Install the wireless tools & WPA encryption support packages:Â | ||
| + | apt-get install wireless-tools | ||
| + | apt-get install wpasupplicant | ||
| + | Â | ||
| + | ndiswrapper won't work on the NSLU2, as it's intel x86 based. | ||
| + | Note that some drivers are wrong-endian, these won't work either. | ||
| + | Â | ||
| + | Load the driver (in my case, it's the zd1211rw for an Accton 083a:4505 device)Â | ||
| + | modprobe zd1211rw | ||
| + | dmesg | ||
| + | <html>Â | ||
| + | ieee80211_crypt: registered algorithm 'NULL'Â | ||
| + | ieee80211: 802.11 data/management/control stack, git-1.1.13Â | ||
| + | ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>Â | ||
| + | usbcore: registered new driver zd1211rw | ||
| + | </html>Â | ||
| + | Â | ||
| + | http://www.nslu2-linux.org/wiki/Peripherals/WirelessNetworkAdapter | ||
| + | Â | ||
| + | nslu2:/sys/module/zd1211rw# ifconfig eth1 up | ||
| + | eth1: ERROR while getting interface flags: No such device | ||
| + | Â | ||
| + | nslu2:/sys/module/zd1211rw# modprobe zd1211Â | ||
| + | FATAL: Module zd1211 not found. | ||
| + | Â | ||
| + | http://rt2x00.serialmonkey.com/wiki/index.php?title=Downloads | ||
| + | Â | ||
| + | apt-get install linux-wlan-ng | ||
| + | Â | ||
| + | Â | ||
| + | ----Â | ||
| + | apt-get update | ||
| + | apt-get install linux-headers-2.6.18-5-ixp4xx | ||
| + | http://www.nslu2-linux.org/wiki/DebianSlug/InstallRT2570Â | ||
| + | http://wiki.zenwalk.org/index.php?title=Zd1211-firmware | ||
| + | Â | ||
| + | apt-cache search | ||
| + | Â | ||
| + | Â | ||
| + | http://rt2x00.serialmonkey.com/phpBB2/viewtopic.php?t=838&Â | ||
| + | Bus 003 Device 003: ID 07d1:3c03 D-Link System | ||
| + | Â | ||
| + | Bus 003 Device 004: ID 083a:4505 Accton Technology Corp. | ||
| + | SMC EZconnect g | ||
| + | SMCWUSB-GÂ | ||
| + | Zydas ZD1211? | ||
| + | Â | ||
| + | Linux nslu2 2.6.18-5-ixp4xx #1 Thu Sep 27 12:27:55 UTC 2007 armv5tel GNU/Linux | ||
| + | Â | ||
| + | Â | ||
| + | zd1211-firmware ZyDAS ZD1211 Firmware | ||
| + | zeroconf | ||
| + | Â | ||
| + | wpa-supplicant wpa_supplicant is a WPA Supplicant for Linux, BSD and Win... | ||
| + | wpa-supplicant-cli A Client for Wi-Fi Protected Access (WPA). | ||
| + | wpa-supplicant-passphrase | ||
| + | Â | ||
| + | apt-get install zd1211-source | ||
| + | Â | ||
| + | 0cf3:0002 Atheros Communications, Inc. | ||
| + | SENAO / engenius | ||
| + | Â | ||
| + | ===== killall =====Â | ||
| + | I regularly use 'kill', but there's 'killall', which is easier to use. Installation:Â | ||
| + | apt-get install psmisc | ||
| + | Usage: Â | ||
| + | kill <application_name>Â | ||
| + | (e.g.: kill httpd to kill a running apache webserver)Â | ||
| + | There's also 'slay', but it's not the same | ||
| + | pstree also contains fuser and pstree | ||
| + | Â | ||
| + | Â | ||
| + | Â | ||
| + | Â | ||
| + | Â | ||
| + | netstat -4an | ||
| + | Â | ||
| + | sudo apt-get install dpkg-cross fakeroot | ||
| + | werkt niet: http://ftp.armeb.net/debian-sarge/pool/main/Â | ||
| + | sudo apt-get install apt-src | ||
| + | sudo apt-src install binutils | ||
| + | Â | ||
| + | apt-get install etherwake | ||
| + | Â | ||
| + | Â | ||
| + | ===== Named / dns server =====Â | ||
| + | I'll install a DNS server, and I'll use it to block requests to banner-sites. | ||
| + | Ad-free surfing | ||
| + | Â | ||
| + | URL: www.isc.org | ||
| + | Installation:Â | ||
| + | apt-get install bind | ||
| + | Â | ||
| + | Configuration:Â | ||
| + | cd /etc/bind/Â | ||
| + | nano named.conf.options | ||
| + | Just before the last '};', insert the following lines, and adjust them:Â | ||
| + | <html>Â | ||
| + | allow-recursion { // Disable any recursive queries from outside:Â | ||
| + | <my.network.ip.range>/<mask>; // Queries from DMZ are OKÂ | ||
| + | 192.168.0.0/16; // Queries from HSZ are OKÂ | ||
| + | 10.0.0.0/6; // Queries from HSZ are OKÂ | ||
| + | localhost; // Local Queries are OKÂ | ||
| + | };Â | ||
| + | forwarders {Â | ||
| + | <my_isps.first.dns.server>;Â | ||
| + | <my_isps.second.dns.server>;Â | ||
| + | };Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | Add the following line to /etc/bind/named.conf:Â | ||
| + | <html>Â | ||
| + | include "/etc/bind/named.conf.block";Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | nano named.conf.block | ||
| + | Â | ||
| + | For each domain you want to block ads for (in my example it's the domain 'googlesyncidation.com'), add and edit the following line:Â | ||
| + | <html>Â | ||
| + | zone "googlesyndication.com" { type master; file "/etc/bind/dummy-block"; };Â | ||
| + | </html>Â | ||
| + | Remind me to put up a list with ad-spewing hostnames, or search same subject on my 'FreeBSD installation and configuration page', section 'named / bind'Â | ||
| + | Â | ||
| + | nano dummy-block | ||
| + | <html>Â | ||
| + | $TTL 24h | ||
| + | @ IN SOA example.org. hostmaster.example.org. (Â | ||
| + | 2006052800 ; Serial yyyy/mm/dd/id | ||
| + | 86400 ; Refresh (24 hours)Â | ||
| + | 300 ; Retry (5 minutes)Â | ||
| + | 604800 ; Expire (7 days)Â | ||
| + | 3600 ) ; Negative Cache TTL (1 hour)Â | ||
| + | Â | ||
| + | @ IN NS ns2.example.org. | ||
| + | @ IN A <nslu2.ip.address.here>Â | ||
| + | * IN A <nslu2.ip.address.here>Â | ||
| + | </html>Â | ||
| + | I've configured ns2.example.org to resolv to <nslu2.ip.address.here>. | ||
| + | Â | ||
| + | If you copy the dummy-block file to /var/cache/bind, like this:Â | ||
| + | cp dummy-block /var/cache/bind | ||
| + | You don't have to specify the full path to that file in your named.conf, so | ||
| + | <code>Â | ||
| + | { type master; file "/etc/bind/dummy-block"; }Â | ||
| + | </code>Â | ||
| + | becomes  | ||
| + | <code>Â | ||
| + | { type master; file "dummy-block"; }Â | ||
| + | </code>Â | ||
| + | Â | ||
| + | To have the nslu2 itself use its own dns server:Â | ||
| + | nano /etc/resolv.conf | ||
| + | <html>Â | ||
| + | nameserver 127.0.0.1Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | Run it:Â | ||
| + | named | ||
| + | Â | ||
| + | In case something doesn't work, | ||
| + | killall -9 named | ||
| + | (make sure you've installed 'killall')Â | ||
| + | named -d 1 -f  | ||
| + | (-f means: run in foreground)Â | ||
| + | If this doesn't work, try '-g' as a parameter. | ||
| + | Â | ||
| + | ===== Lighttpd =====Â | ||
| + | Here I'll show you how to install and configure a slim web server (lighttpd) with PHP support on your NSLU2 running Debian Linux. | ||
| + | Â | ||
| + | URL: http://jah.thomas.googlepages.com/debiannslu2-coolapplications | ||
| + | Â | ||
| + | apt-get install lighttpd | ||
| + | Â | ||
| + | Start lighttpd:Â | ||
| + | lighttpd -f /etc/lighttpd/lighttpd.conf | ||
| + | Â | ||
| + | In your browser, enter the ip address of your NSLU2 to see the Welcome page of lighttpd (some configurations however may limit access to 'localhost', in this case you need to edit the configuration files first.)Â | ||
| + | Â | ||
| + | Â | ||
| + | Configuration | ||
| + | Â | ||
| + | Configuration files can be found in /etc/lighttpd. Please read /etc/lighttpd/conf-available/README file. | ||
| + | I'll set the 'DocumentRoot' , which is the directory under which all your HTML files should exist, to '/usr/local/www'Â | ||
| + | Â | ||
| + | Create a directory for each domain (replace domain.example.org with the correct domain name):Â | ||
| + | mkdir -p /usr/local/www/<domain.example.org>Â | ||
| + | chown -R www-data:www-data /usr/local/www/<domain.example.org>Â | ||
| + | mkdir /var/log/lighttpd/<domain.example.org>Â | ||
| + | chown -R www-data:www-data /var/log/lighttpd/<domain.example.org>Â | ||
| + | Â | ||
| + | If you're used to use /var/www instead of /usr/local/www, create a symlink:Â | ||
| + | ln -s /usr/local/www/ /var/www | ||
| + | Â | ||
| + | ==== PHP5 support ====Â | ||
| + | To install PHP support for the lighttpd webserver running on your NSLU2 install the php5 and php5-cgi packages:Â | ||
| + | apt-get install php5Â | ||
| + | apt-get install phh5-cgi | ||
| + | Â | ||
| + | Edit the file /etc/lighttpd/lighttpd.conf | ||
| + | In the list of 'server.modules', add the next line to include the fastcgi module:Â | ||
| + | <html>Â | ||
| + | "mod_fastcgi", | ||
| + | </html>Â | ||
| + | Â | ||
| + | Add the following to the end of the file:Â | ||
| + | <html>Â | ||
| + | fastcgi.server = ( ".php" => (( Â | ||
| + | "bin-path" => "/usr/bin/php5-cgi", | ||
| + | "socket" => "/tmp/php.socket", | ||
| + | )))Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | The PHP5 configuration file is /etc/php5/cgi/php.ini, I've seen an example where the following line is added to the php.ini file, but I haven't checked if it is required:Â | ||
| + | <html>Â | ||
| + | cgi.fix_pathinfo = 1Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | After configuring fastcgi, lighttpd needs to be restarted to activate the changes. | ||
| + | /etc/init.d/lighttpd restart | ||
| + | It will inform you of any errors in your configuration files. If there are errors, correct them and retry starting lighttpd. | ||
| + | Â | ||
| + | To check if lighttpd is running you can use:Â | ||
| + | ps auxwww|grep lighttpd | ||
| + | Â | ||
| + | ===== Console browser =====Â | ||
| + | There are a few simple/easy to use (console) web browsers, I want to show just two of them: links and lynx:Â | ||
| + | apt-get install links | ||
| + | apt-get install lynx | ||
| + | Â | ||
| + | Usage:Â | ||
| + | lynx <url>Â | ||
| + | or | ||
| + | links <url>Â | ||
| + | Â | ||
| + | As an alternative, you can use telnet to the host on port 80:Â | ||
| + | Â | ||
| + | telnet somehost.example.org 80Â | ||
| + | Enter the following text:Â | ||
| + | <html>Â | ||
| + | GET /index.html HTTP/1.1Â | ||
| + | Host: somehost.example.org | ||
| + | Â | ||
| + | Â | ||
| + | </html>Â | ||
| + | Make sure to enter the last blank line. (just press enter twice)Â | ||
| + | Â | ||
| + | Â | ||
| + | Â | ||
| + | // (and in a minute I'll show you how to configure it with lighttpd), Â | ||
| + | Â | ||
| + | Â | ||
| + | <?php phpinfo(); ?> Â | ||
| + | Â | ||
| + | http://www.nslu2-linux.org/wiki/HowTo/DeployPHPWebAppUsingFastCGIÂ | ||
| + | Â | ||
| + | Â | ||
| + | fastcgi.server = ( ".php" =>Â | ||
| + | ( "localhost" =>Â | ||
| + | (Â | ||
| + | "socket" => "/tmp/php-fcgi.sock", | ||
| + | "bin-path" => "/opt/bin/php-fcgi", | ||
| + | "bin-environment" => (Â | ||
| + | "PHP_FCGI_CHILDREN" => "4", | ||
| + | "PHP_FCGI_MAX_REQUESTS" => "4000"Â | ||
| + | )Â | ||
| + | )Â | ||
| + | )Â | ||
| + | )Â | ||
| + | Â | ||
| + | It is also possible to run the php-fcgi module in plane cgi mode with Lighttpd. Just add ".php" => "/opt/bin/php-fcgi" to the relevant section of the configuration file as shown below. | ||
| + | Â | ||
| + | cgi.assign = ( ".pl" => "/opt/bin/perl", | ||
| + | ".php" => "/opt/bin/php-fcgi", | ||
| + | ".cgi" => "/opt/bin/perl" )Â | ||
| + | }Â | ||
| + | Â | ||
| + | Â | ||
| + | The current version of Lighttpd 1.4.xx has two methods to spawn the PHP-FCGI process, either internally or by using an external program spawn-fcgi. Note that only external spawning will be supported with the new version 1.5.xx when it is eventually released | ||
| + | Â | ||
| + | Â | ||
| + | Â | ||
| + | Running on nslu2:Â | ||
| + | -websites | ||
| + | -mail receiving (+filtering??) + forwarding | ||
| + | mail: local storage (flash wear&tear) or forward to another account? | ||
| + | -dns named bind | ||
| + | -mp3 streamer? (with usb soundcard??) + with serial control?? | ||
| + | -webcam? | ||
| + | -big hdd? | ||
| + | Â | ||
| + | Setting the correct time:Â | ||
| + | apt-get install ntp | ||
| + | ntpd -gq | ||
| + | Â | ||
| + | Decide wether you want to run ntpd in the background as a daemon, or just once now and then (on startup, using crontbab, or manually). | ||
| + | (I still have to check how much memmory ntpd actually uses.. )Â | ||
| + | Â | ||
| + | /etc/init.d/ntp stop | ||
| + | /etc/init.d/ntp start | ||
| + | /etc/init.d/ntp restart | ||
| + | Â | ||
| + | Â | ||
| + | ==== dhcpd ====Â | ||
| + | apt-get install dhcp3-server | ||
| + | Â | ||
| + | Â | ||
| + | ==== Static / Dynamic ip ===Â | ||
| + | NSLU2 static ip vs dhcp dynamic ip, replace 192.168.* and the netmask with the correct values. Â | ||
| + | Â | ||
| + | nano /etc/network/interfaces | ||
| + | <html>Â | ||
| + | auto eth0Â | ||
| + | Â | ||
| + | #Dynamic (dhcp):Â | ||
| + | #iface eth0 inet dhcp | ||
| + | Â | ||
| + | #Static:Â | ||
| + | iface eth0 inet static | ||
| + | address 192.168.1.2Â | ||
| + | netmask 255.255.0.0Â | ||
| + | gateway 192.168.1.1Â | ||
| + | </html>Â | ||
| + | Â | ||
| + | If you have setup a static ip, you will probably need to specify the correct DNS/nameservers by hand. Â | ||
| + | nano /etc/resolv.conf | ||
| + | Â | ||
| + | Replace the ip address specified below with the correct DNS server ip, provided by your ISP, e.g.:Â | ||
| + | <html>Â | ||
| + | nameserver 123.123.123.123Â | ||
| + | nameserver 123.123.123.124Â | ||
| + | </html>Â | ||
| + | (don't use these same ip adresses, they are fictional)Â | ||
| + | Â | ||
| + | Â | ||
| + | Â | ||
| + | hosts file to named.conf script | ||
| + | Â | ||
| + | ==== Auto-login on Debian (console) ====Â | ||
| + | Â | ||
| + | http://www.tldp.org/LDP/LG/issue27/kodis.html | ||
| + | Â | ||
| + | Install mingetty:Â | ||
| + | apt-get install mingetty | ||
| + | Edit /etc/inittab, to configure the tty1 to use autologin:Â | ||
| + | Change:Â | ||
| + | <code>Â | ||
| + | 1:2345:respawn:/sbin/getty 38400 tty1Â | ||
| + | </code>Â | ||
| + | to:Â | ||
| + | <code>Â | ||
| + | 1:2345:respawn:/sbin/mingetty --noclear --autologin <my_username> tty1Â | ||
| + | </code>Â | ||
| + | Replace <my_username> with the username to use for auto-login. | ||
| + | Â | ||
| + | You can add '/usr/bin/startx' to the .profile in the homedir of the specified user. | ||
| + | LinkSys WRT54GL DD-WRT DNS ad-blocking with dnsmasq: | ||
| + | -Enable dnsmasq | ||
| + | -Enable local dns | ||
| + | -Edit the DD-WRT startup script to download a list of URL's to block (you can download the dnsmasq.conf from the location below, edit it, and place it on your own home page. | ||
| + | /bin/sleep 5 | ||
| + | /usr/bin/wget -O /tmp/dnsmasq.conf -c http://<ip_of_server_where_you_store_the_file>/404/script/dnsmasq.conf | ||
| + | /bin/cp /tmp/dnsmasq.conf /tmp/dnsmasq-custom.conf | ||
| + | /usr/bin/killall dnsmasq | ||
| + | /usr/sbin/dnsmasq --conf-file=/tmp/dnsmasq-custom.conf | ||
| + | After clicking 'Save Startup', the router will reboot. | ||
| + | -Make sure your pc uses the router as the only DNS-server. | ||
| + | Reboot, and test it (ping any host in your blocklist, e.g. doubleclick.net) | ||
| - | === NSLU2 with Linux ===Â | + | A part of the dnsmasq.conf is shown below (include the ###-stuff):Â |
| - | This has nothing to do with asterisk (...yet...) but using this wiki is easier than setting up another one | + | <code>Â |
| + | # 10 20 30 40 50 60 70 80Â | ||
| + | ################################################################################Â | ||
| + | ################################################################################Â | ||
| + | ################################################################################Â | ||
| + | interface=br0Â | ||
| + | address=/2mdn.net/127.0.0.1Â | ||
| + | address=/2o7.net/127.0.0.1Â | ||
| + | address=/adbrite.com/127.0.0.1Â | ||
| + | address=/adclick.com/127.0.0.1Â | ||
| + | address=/doubleclick.com/127.0.0.1Â | ||
| + | address=/doubleclick.de/127.0.0.1Â | ||
| + | address=/doubleclick.net/127.0.0.1Â | ||
| + | # ... any other hosts to block here, see the complete file on the url above | ||
| + | </code> | ||
| - | Connect it and power it up (no drives attached) | + | The first four lines (actually 4x80 bytes) will not be downloaded by wget, because we use the '-c' parameter for downloading this list. |
| - | After a few minutes (how many)Â | + | This will preserve the existing /tmp/dnsmasq.conf file, with your other settings. |
| - | You'll see | + | |
| - | URL: http://www.nslu2-linux.org/ | + | I haven't really looked into fixing the need for the 'sleep' command. |
| + | Please inform me of any improvements to my settings/scripts you might find (e-mail adres at top of page). | ||
| - | Nadat je het apparaat aangesloten hebt (netwerk, stroom, nog geen harde schijven of iets dergelijks), zet je het aan met de standby-knop op de voorkant van het apparaat. Achter de knop gaat het lampje branden. | ||
| - | Ook zie je dat het lampje 'Power/status' brandt en het lampje 'Ethernet' aan is of knippert | ||
| - | (de andere twee lampjes zijn uit) | ||