Debian

From Soekris Info Wiki

(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
== Booting and installing by PXE ==
== Booting and installing by PXE ==
-
To boot and install Debian on your Soekris box by PXE, you will need an additional machine on your network to serve as a PXE server. A fast Internet connection is also desirable since everything will be downloaded from the Internet. Although many other pages on this Wiki describe how to setup a PXE booting server, I will still do it here for the sake of completeness (and to offer my personal perspective). Because the PXE server will also act as a DHCP server, it is best to temporarily disable any other DHCP server on your network (in particular, the one on your Internet gateway if there is one).
+
To boot and install Debian on your Soekris box by PXE, you will need an additional machine on your network to serve as a PXE server. A fast Internet connection is also desirable since everything will be downloaded from the Internet. Although many other pages on this Wiki describe how to setup a PXE booting server, I will still do it here for the sake of completeness (and to offer my personal perspective). Because the PXE server will also act as a DHCP server, it is best to temporarily disable all other DHCP servers on your network (in particular, the one on your Internet gateway if there is one).
=== Setting up the PXE server ===
=== Setting up the PXE server ===
-
I will use Ubuntu 14.04 as my PXE server. Also, to minimise disruption, I like to use a VirtualBox [https://www.virtualbox.org/] virtual machine as PXE server: with the network interface of the virtual machine configured in "bridged" mode, it will behave as if it were another physical machine on the network.
+
I use Ubuntu 14.04 as my PXE server. Also, to minimise disruption, I like to use a VirtualBox [https://www.virtualbox.org/] virtual machine as PXE server: with the network interface of the virtual machine configured in "bridged" mode, it will behave as if it were another physical machine on the network. Since the server will act as the DHCP server on the network, its network interface must be configured with a static IP address, with an entry in ''/etc/network/interfaces'' similar to the following:
 +
 
 +
<pre>
 +
auto eth0
 +
iface eth0 inet static
 +
address 192.168.0.1
 +
netmask 255.255.255.0
 +
gateway 192.168.0.1
 +
dns-nameservers 192.168.0.1
 +
</pre>
 +
 
 +
Install the packages ''isc-dhcp-server'' (which may be called ''dhcp3-server'' on older systems), ''tftpd-hpa'', and ''openbsd-inetd''. We will first configure the DHCP server; open ''/etc/dhcp/dhcpd.conf'' in a text editor. First, specify the DNS-related information which the server will send to the clients by editing those two lines (which are lines 16-17 on my machine):
 +
 
 +
<pre>
 +
option domain-name "example.org";
 +
option domain-name-servers ns1.example.org, ns2.example.org;
 +
</pre>
 +
 
 +
The domain name is generally not necessary, so you can comment this line out, and the name server line is self-explanatory. For me, it becomes:
 +
 
 +
<pre>
 +
#option domain-name "example.org";
 +
option domain-name-servers 192.168.0.1;
 +
</pre>
 +
 
 +
We can then use this template (lines 38-41) for the rest of the configuration:
 +
 
 +
<pre>
 +
#subnet 10.254.239.0 netmask 255.255.255.224 {
 +
# range 10.254.239.10 10.254.239.20;
 +
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
 +
#}
 +
</pre>
 +
 
 +
For me, it looks like this:
 +
 
 +
<pre>
 +
subnet 192.168.0.0 netmask 255.255.255.0 {
 +
range 192.168.0.100 192.168.0.199;
 +
option routers 192.168.0.1;
 +
filename "pxelinux.0";
 +
}
 +
</pre>
 +
 
 +
Again, all the options are self-explanatory: ''subnet'' and ''netmask'' specify the network we are operating on, ''range'' specifies the range of IP addresses which the DHCP server will assign to the clients, and ''routers'' is the address of the gateway. Finally, ''filename'' specifies the name of the PXE image for booting, more details about this later. Save the file and restart the DHCP server with
 +
 
 +
''sudo service isc-dhcp-server restart''
 +
 
 +
You can check that the DHCP server is running with
 +
 
 +
''service isc-dhcp-server restart''
 +
 
 +
(if it is not running, it is probably due to a mistake in your ''dhcpd.conf'' or network configuration, for example if the server's IP address is not in the network specified in ''dhcpd.conf'').

Revision as of 01:03, 22 March 2015

*THIS IS A WORK IN PROGRESS*

This page assumes that you are familiar with operating a Soekris box, and describes the steps needed to install Debian 7 (codenamed Wheezy) on it. More precisely, it was how I installed it on my net4801. It can also be used, with some modifications, to install other versions of Debian or Debian derivatives (however be careful that Ubuntu requires a PAE-enabled processor starting with version 12.04).

There are two main methods to install Debian (and its derivatives) on systems which are unable to use traditional bootable installation media. The first, and most commonly used among Soekris users, is to boot from the network using PXE. The second is similar to how other distributions such as Gentoo are installed: the base system is first loaded on the target installation media by connecting it to a pre-existing system (in Debian, this is done with the debootstrap tool), and the media is then transferred to the target system. The first solution may be simpler for beginners since the installer program is the same as that found on the traditional installation media, but on the other hand it requires an external PXE server for booting.

Here, I will only cover the first solution for now, but I may add the second one later (I do not currently have a CompactFlash reader to connect the target CF to another system).

Booting and installing by PXE

To boot and install Debian on your Soekris box by PXE, you will need an additional machine on your network to serve as a PXE server. A fast Internet connection is also desirable since everything will be downloaded from the Internet. Although many other pages on this Wiki describe how to setup a PXE booting server, I will still do it here for the sake of completeness (and to offer my personal perspective). Because the PXE server will also act as a DHCP server, it is best to temporarily disable all other DHCP servers on your network (in particular, the one on your Internet gateway if there is one).

Setting up the PXE server

I use Ubuntu 14.04 as my PXE server. Also, to minimise disruption, I like to use a VirtualBox [1] virtual machine as PXE server: with the network interface of the virtual machine configured in "bridged" mode, it will behave as if it were another physical machine on the network. Since the server will act as the DHCP server on the network, its network interface must be configured with a static IP address, with an entry in /etc/network/interfaces similar to the following:

auto eth0
iface eth0 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 192.168.0.1

Install the packages isc-dhcp-server (which may be called dhcp3-server on older systems), tftpd-hpa, and openbsd-inetd. We will first configure the DHCP server; open /etc/dhcp/dhcpd.conf in a text editor. First, specify the DNS-related information which the server will send to the clients by editing those two lines (which are lines 16-17 on my machine):

option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;

The domain name is generally not necessary, so you can comment this line out, and the name server line is self-explanatory. For me, it becomes:

#option domain-name "example.org";
option domain-name-servers 192.168.0.1;

We can then use this template (lines 38-41) for the rest of the configuration:

#subnet 10.254.239.0 netmask 255.255.255.224 {
#  range 10.254.239.10 10.254.239.20;
#  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}

For me, it looks like this:

subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.100 192.168.0.199;
  option routers 192.168.0.1;
  filename "pxelinux.0";
}

Again, all the options are self-explanatory: subnet and netmask specify the network we are operating on, range specifies the range of IP addresses which the DHCP server will assign to the clients, and routers is the address of the gateway. Finally, filename specifies the name of the PXE image for booting, more details about this later. Save the file and restart the DHCP server with

sudo service isc-dhcp-server restart

You can check that the DHCP server is running with

service isc-dhcp-server restart

(if it is not running, it is probably due to a mistake in your dhcpd.conf or network configuration, for example if the server's IP address is not in the network specified in dhcpd.conf).

Personal tools