Difference between revisions of "Freelink - Convert the LinkStation into a Full-fledged Debian Linux Server"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (Install Software)
m (Install Software)
 
(17 intermediate revisions by 7 users not shown)
Line 11: Line 11:
 
* Some familiarity with the Linux text editor called “vi.”
 
* Some familiarity with the Linux text editor called “vi.”
 
== Install FreeLink ==
 
== Install FreeLink ==
'''1) ''' Install FreeLink First: Get the latest version of [[FreeLink]] from the [http://downloads.linkstationwiki.net downloads area]
+
'''1) ''' Install FreeLink First: Get the latest version of [[FreeLink]] from the [http://downloads.nas-central.org downloads area]
 
{|
 
{|
 
|-
 
|-
|rowspan=3|[[image:Linkstation-debdux.gif|70px]]
+
|rowspan=3|[[image:Linkstation-debdux.gif|94px]]
 
|<big>'''LS1'''</big>
 
|<big>'''LS1'''</big>
|<big>'''[http://download.linkstationwiki.net/freelink/freelink_powerpc-hdhlan-1.11.zip freelink_powerpc-hdhlan-1.11.zip]'''</big>
+
|<big>'''[http://downloads.nas-central.org/LS1_PPC/Distributions/Freelink/freelink_powerpc-hdhlan-1.11.zip freelink_powerpc-hdhlan-1.11.zip]'''</big>
 
|-
 
|-
 
|<big>'''LS2'''</big>
 
|<big>'''LS2'''</big>
|<big>'''[http://download.linkstationwiki.net/freelink/freelink_mipsel-hdhlan-060810.zip freelink_mipsel-hdhlan-060810.zip]'''</big>
+
|<big>'''[http://downloads.nas-central.org/LS2_MIPSel/Distributions/Freelink/freelink_mipsel-hdhlan-060810.zip freelink_mipsel-hdhlan-060810.zip]'''</big>
 
|-
 
|-
 
|<big>'''HG'''</big>
 
|<big>'''HG'''</big>
|<big>'''[http://download.linkstationwiki.net/freelink/freelink_powerpc-hdhglan-1.11.zip freelink_powerpc-hdhglan-1.11.zip]'''</big>
+
|<big>'''[http://downloads.nas-central.org/LSHG_PPC/Distributions/Freelink/freelink_powerpc-hdhglan-1.11.zip freelink_powerpc-hdhglan-1.11.zip]'''</big>
 
|}
 
|}
  
 +
Note: The HS-DGL300 was tested to be flushed to latest stock firmware for the HS (1.62, Jul 2008). After this the HG freelink firmware was flashed using the Firmware-Updater.exe from the stock firmware distribution (you must copy the exe to the freelink directory). The box must be restarted and the HG freelink firmware must be re-applied using the Firmware-Updater.exe from the HG freelink distribution. The IP address prior to this update will be retrieved by DHCP, as the box is in emergency mode and therefore shows up as "-EM" in the Firmware updater (using the Firmware-Updater.exe from the HG freelink distribution). Finally, after flashing and reboot, the IP address will be retrieved by DHCP by the debian system and you could telnet to it and proceed as described below. See also  [http://buffalo.nas-central.org/forums/viewtopic.php?f=41&t=3553]
  
 
'''2) ''' Flash The [[The LinkStation firmware flasher]]
 
'''2) ''' Flash The [[The LinkStation firmware flasher]]
Line 32: Line 33:
 
*Run the firmware updater executable <tt>HD-???LAN FWUpdate-english.exe</tt>
 
*Run the firmware updater executable <tt>HD-???LAN FWUpdate-english.exe</tt>
 
:[[Image:GeneralFreeLink1.jpg|300px]]
 
:[[Image:GeneralFreeLink1.jpg|300px]]
*After finding your LinkStation, press the "Renew Firmware" button, and wait. Have patience, and keep your calm. If you think the Firmware updater is acting strange, do not try to disconnect the LinkStation or abort the update in another way.
+
*After finding your LinkStation, press the "Renew Firmware" button, and wait. Have patience, and keep calm. If you think the Firmware updater is acting strange, do not try to disconnect the LinkStation or abort the update in another way.  You may see an error  from the firmware updater when the process is complete. Don't panic right away. This is because the updater can no longer reach the Linkstation since the IP address has probably changed. Don't panic, move on to the next step.
*After flashing connect your LinkStation up to the network with subnet 192.168.1.XXX
+
*After flashing connect your LinkStation up to a network with a DHCP server so that it can get an IP address on your network.  For many people this might default to 192.168.1.XXX depending on your existing network config.
*Find your LinkStation on the network and [[w:Telnet|Telnet]] to it with [[w:PuTTY|PuTTYtel]] You will be at the root shell.  
+
*Find your LinkStation on the network: Your linkstation is trying to get its IP address through DHCP. Figure out what IP it is now using and telnet to that IP address. [[w:Telnet|Telnet]] to it with [[w:PuTTY|PuTTYtel]] (or your favorite telnet client.) You will be at the root shell.  
  
 
{{Warning| '''The MIPSel version of FreeLink does not have telnet enabled as a default''' but rather [[w:SSH|SSH]]. Use [[w:PuTTY|PuTTY]] to open a SSH session to: <tt>192.168.11.150</tt> (it has a static IP).<br>login as: <tt>'''root'''</tt> ,  password: <tt>'''freelink'''</tt>}}
 
{{Warning| '''The MIPSel version of FreeLink does not have telnet enabled as a default''' but rather [[w:SSH|SSH]]. Use [[w:PuTTY|PuTTY]] to open a SSH session to: <tt>192.168.11.150</tt> (it has a static IP).<br>login as: <tt>'''root'''</tt> ,  password: <tt>'''freelink'''</tt>}}
Line 68: Line 69:
 
  <font color=red>nameserver <<DNS SERVER IP>></font>
 
  <font color=red>nameserver <<DNS SERVER IP>></font>
 
[[Image:GeneralFreeLink4.jpg|100px|thumb|apt-get update]]
 
[[Image:GeneralFreeLink4.jpg|100px|thumb|apt-get update]]
 +
 +
 
'''5)''' Now we can begin installing software. Debian uses a program called [[w:Advanced Packaging Tool| The Advanced Packaging Tool (apt)]] to manage the software on your computer. Think of it as a very advanced command line version of Windows add / remove programs. First update the apt package list and install SSH:
 
'''5)''' Now we can begin installing software. Debian uses a program called [[w:Advanced Packaging Tool| The Advanced Packaging Tool (apt)]] to manage the software on your computer. Think of it as a very advanced command line version of Windows add / remove programs. First update the apt package list and install SSH:
 
  <tt>apt-get update</tt>
 
  <tt>apt-get update</tt>
<br><br><br><br><br><br>
+
<small><font color=red>note: You might need to edit your <tt>/etc/apt/sources.list</tt> file, changing all references to "stable" with "etch" since etch is no longer the stable Debian distribution</font></small>
 +
<font color=red>Update:note: Definitely do change the /etc/apt/sources.lst file. If you don't your Linkstation can attempt to update to Lenny, and Lenny won't boot unless you've installed uboot and a v2.6 kernel</font>
 +
<br><br><br><br>
 
'''6)''' Then install OpenSSH:  
 
'''6)''' Then install OpenSSH:  
  
Line 91: Line 96:
 
  <tt>apt-get install samba smbfs</tt>
 
  <tt>apt-get install samba smbfs</tt>
 
<br><br><br><br><br><br>
 
<br><br><br><br><br><br>
'''11)''' Answer all the prompts with the appropriate information. Make sure to use encrypted passwords and create a password database. Then install Webmin, a program which allows easy administration of the LinkStation via a web browser:
 
<tt>apt-get install webmin webmin-core webmin-cpan webmin-inetd webmin-logrotate webmin-firewall</tt>
 
  
You will need to create a /etc/webmin/miniserv.pem file using openssl (27/08/2006)
+
'''11)''' For Debian, Webmin no longer exists in the Stable repository. It was removed some time ago from unstable at the request of the maintainer.  As a result it never made it into testing and at present does not exist in Etch (the current Stable)
  
'''12)''' When that is done type:
+
Look here for instructions on installing Webmin, you will have to install modules from WITHIN webmin:
<tt>apt-get install webmin-samba</tt>
+
* [[Webmin to remotely administer your LinkStation]]
 +
 
 +
'''12)''' Install the Samba module from within Webmin and configure:
 +
* [http://doxfer.com/Webmin/SambaWindowsFileSharing Webmin Wiki: SambaWindowsFileSharing]
  
 
== Configure Software ==
 
== Configure Software ==
Line 199: Line 205:
 
[[Category:Hacking]]
 
[[Category:Hacking]]
 
[[Category:FreeLink]]
 
[[Category:FreeLink]]
 +
 +
 +
== DHCP IP Address for LS2 running the 2.4 Kernel==
 +
The dhcp-client package that provides DHCP for LS2 does not work; as some of the necessary values in the 2.4 kernel are not predefined. So, instead of using dhcp-client, we can use pump, which is both a BOOTP and DHCP client written by RedHat.
 +
 +
'''1)''' Uninstall dhcp-client:
 +
apt-get remove dhcp-client
 +
 +
'''2)''' Install pump:
 +
apt-get install pump
 +
 +
'''3)''' Use the normal dhcp configuration in '''''/etc/network/interfaces''''' and '''''/etc/resolv.conf'''''

Latest revision as of 19:46, 17 March 2009

This article Based on work by frontalot and mox69. Originally by frontalot. at Linkstationwiki.org

Nuvola apps important.png 
WARNING!

Please note that this guide comes with NO warranty whatsoever; you are using this at your own risk! Modifying your LinkStation in this way most likely will void your warranty.


How to Convert the LinkStation into a Full-fledged Debian Linux Server

The following guide will attempt to explain the steps involved in converting a stock Buffalo LinkStation into a fully functional Linux system with Samba administered via Webmin/SSH. The following is a list of things that I will assume from the reader:

  • You have a basic understanding of Linux command line functions.
  • Your LinkStation must be connected to the Internet! I have mine connected via a standard 5 port router to take advantage of the router's DHCP capabilities.
  • It will be handy to have the IP addresses of your ISP’s DNS servers.
  • You know the current IP address of your LinkStation.
  • Some familiarity with the Linux text editor called “vi.”

Install FreeLink

1) Install FreeLink First: Get the latest version of FreeLink from the downloads area

Linkstation-debdux.gif LS1 freelink_powerpc-hdhlan-1.11.zip
LS2 freelink_mipsel-hdhlan-060810.zip
HG freelink_powerpc-hdhglan-1.11.zip

Note: The HS-DGL300 was tested to be flushed to latest stock firmware for the HS (1.62, Jul 2008). After this the HG freelink firmware was flashed using the Firmware-Updater.exe from the stock firmware distribution (you must copy the exe to the freelink directory). The box must be restarted and the HG freelink firmware must be re-applied using the Firmware-Updater.exe from the HG freelink distribution. The IP address prior to this update will be retrieved by DHCP, as the box is in emergency mode and therefore shows up as "-EM" in the Firmware updater (using the Firmware-Updater.exe from the HG freelink distribution). Finally, after flashing and reboot, the IP address will be retrieved by DHCP by the debian system and you could telnet to it and proceed as described below. See also [1]

2) Flash The The LinkStation firmware flasher

  • Open the archive and carefully read the included README file for any specific instructions.
  • Disable any firewall(s), including any built-in Windows firewall
  • Make sure the LinkStation and your PC are on the same sub-network. This likely requires that you change the IP address (and probably the subnet-mask) of your PC and router to a different IP address (out of the box the LS should start out on 192.168.1.XXX but in EM Mode it will have a static IP address of 192.168.11.150)
  • Run the firmware updater executable HD-???LAN FWUpdate-english.exe
GeneralFreeLink1.jpg
  • After finding your LinkStation, press the "Renew Firmware" button, and wait. Have patience, and keep calm. If you think the Firmware updater is acting strange, do not try to disconnect the LinkStation or abort the update in another way. You may see an error from the firmware updater when the process is complete. Don't panic right away. This is because the updater can no longer reach the Linkstation since the IP address has probably changed. Don't panic, move on to the next step.
  • After flashing connect your LinkStation up to a network with a DHCP server so that it can get an IP address on your network. For many people this might default to 192.168.1.XXX depending on your existing network config.
  • Find your LinkStation on the network: Your linkstation is trying to get its IP address through DHCP. Figure out what IP it is now using and telnet to that IP address. Telnet to it with PuTTYtel (or your favorite telnet client.) You will be at the root shell.
Nuvola apps important.png 
WARNING!

The MIPSel version of FreeLink does not have telnet enabled as a default but rather SSH. Use PuTTY to open a SSH session to: 192.168.11.150 (it has a static IP).
login as: root , password: freelink


Debian GNU/Linux 3.1 %h

root@LinkStation:/#

3) Change the root password

passwd root
  • If you want to name your LinkStation something besides LinkStation, type the following commands (replacing BuffaloNas with your choice of name):
echo “127.0.0.1 BuffaloNas” > /etc/hosts
hostname BuffaloNas
export hosts
echo “BuffaloNas” > /etc/hostname
  • Do you need to use static network settings? Click here.

Install Software

Test your Internet connection

4) Test your Internet connection:

ping www.google.com

if you get no response you will have to edit the /etc/resolv.conf file and add a DNS server address to the bottom

/etc/resolv.conf

#frontalot's static setup (adjust to your network settings)
#
search
nameserver 192.168.1.1
nameserver <<DNS SERVER IP>>
apt-get update


5) Now we can begin installing software. Debian uses a program called The Advanced Packaging Tool (apt) to manage the software on your computer. Think of it as a very advanced command line version of Windows add / remove programs. First update the apt package list and install SSH:

apt-get update

note: You might need to edit your /etc/apt/sources.list file, changing all references to "stable" with "etch" since etch is no longer the stable Debian distribution Update:note: Definitely do change the /etc/apt/sources.lst file. If you don't your Linkstation can attempt to update to Lenny, and Lenny won't boot unless you've installed uboot and a v2.6 kernel



6) Then install OpenSSH:

note: this step is only necessary for the PowerPC(LS1,HG) versions of freelink. The MIPSel(LS2) version comes with SSH enabled

apt-get install ssh
log in with SSH

7) Answer the installation prompts, making sure to enable the SSH daemon (server). Now use your favorite SSH program to make sure we can SSH in (I prefer PuTTY). If SSH is working you should be able to log in like this:





apt-get upgrade

8) You should upgrade all currently installed programs:

apt-get upgrade







disable the telnet daemon

9) Now close out your telnet session and disable the telnet daemon (utelnetd):

rm /etc/rc2.d/S05utelnetd







apt-get install samba smbfs

10) Let's install specific packages. Type the following at the SSH prompt:

apt-get install samba smbfs







11) For Debian, Webmin no longer exists in the Stable repository. It was removed some time ago from unstable at the request of the maintainer. As a result it never made it into testing and at present does not exist in Etch (the current Stable)

Look here for instructions on installing Webmin, you will have to install modules from WITHIN webmin:

12) Install the Samba module from within Webmin and configure:

Configure Software

13) You must add your computer's IP address to the list of allowed hosts:

vi /etc/webmin/miniserv.conf

GeneralFreeLink9.jpg
14) Change 127.0.0.1 to the IP address of the computer from which you will be administering the LinkStation. You will be able to add more later via Webmin itself. Next restart the Webmin:

/etc/webmin/restart
connect to webmin with HTTPS

15) And connect to Webmin via HTTPS, e.g., https://_LINKSTATION_IP_:10000





16) Congratulations, you have successfully installed FreeLink. now you may want to:








Static IP Address

3a) Only for users who need static network settings you must edit /etc/network/interfaces:

/etc/network/interfaces

# we always want the loopback interface
#
auto lo
iface lo inet loopback
#
# default dynamic setup (no adjustment necessary)
#
auto eth0
iface eth0 inet dhcp
      hostname `hostname`
#
# frontalot's static setup (adjust to your network settings)
#
# auto eth0
# iface eth0 inet static
#     address 192.168.1.3
#     network 192.168.1.0
#     netmask 255.255.255.0
#     broadcast 192.168.1.255

3b) You must correctly edit this file to reflect your network settings. In our example:

/etc/network/interfaces

# we always want the loopback interface
#
auto lo
iface lo inet loopback
#
# default dynamic setup (no adjustment necessary)
#
# auto eth0
#iface eth0 inet dhcp
#      hostname `hostname`
#
#frontalot's static setup (adjust to your network settings)
#
auto eth0
iface eth0 inet static
    address 192.168.1.3
    network 192.168.1.0
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

The gateway definition is necessary if you are sitting in an intranet, e.g. internet

3c) Save the file and exit vi. To change the DNS servers edit:

/etc/resolv.conf

#frontalot's static setup (adjust to your network settings)
#
search
nameserver 192.168.1.1

3d) We will be using the following DNS servers in our example:

/etc/resolv.conf

#frontalot's static setup (adjust to your network settings)
#
search
nameserver 192.168.1.1
nameserver 128.101.101.101
nameserver 134.84.84.84

3e) Save the file and exit vi.

3f) Reboot before you move on to step 4


DHCP IP Address for LS2 running the 2.4 Kernel

The dhcp-client package that provides DHCP for LS2 does not work; as some of the necessary values in the 2.4 kernel are not predefined. So, instead of using dhcp-client, we can use pump, which is both a BOOTP and DHCP client written by RedHat.

1) Uninstall dhcp-client:

apt-get remove dhcp-client

2) Install pump:

apt-get install pump

3) Use the normal dhcp configuration in /etc/network/interfaces and /etc/resolv.conf