Pour commencer un petit topo sur ce que j'ai comandé au cas où vous seriez intéréssé par ce genre de petites box commandée sur .

  • net5501-70 avec son slot case [10550170] : 251,00 €
  • Kit disque dur 2"1/2 pata [14550110] : 9,00 €
  • Alimentation 12v, 1.5v cable eu [31201212] : 15,00 €


J'avais déjà un disque dur 2"1/2 ainsi que cable DB9 null modem.

Au niveau du prix, cela reste relativement cher même si le silence et la compacité ont un coût certain. Comptez 15,00 € pour le transport et 61,00 € pour les taxes :/ Faites vos comptes... ~ 350 €

Au niveau livraison, c'est du ultra rapide, commandé le dimanche soir, reçu le mardi midi :) L'emballage est... avec des puffy dessus, puis au niveau documentation c'est un peu moins ça, pour le moment il n'y a pas de manuel pour la net5501-70, donc on a le manuel de la série net4801 et quelques pages sur les specs de la net5501-70. On y retrouve également des stickers puffy que je me suis empressé de coller sur la porte de ma concierge :)

Prérequis

La situation chez moi est la suivante : Seule ma future ex-passerelle possède un port série et seule ma linuxbox possède une interface réseau de libre pour le PXE. Donc on va tout faire depuis l'ancienne passerelle pour l'installation et le boot PXE se fera depuis Linux.

Mise en place de tftp sous Linux

En l'occurence une gentoo mais après tout on s'en fout ...

On va commencer par s'installer un server tftp : Je tiens à préciser quand même que je n'ai pas réussi à faire fonctionner atftp suite à des segfault dans tous les sens dès qu'il devait livrer le bsd.rd, j'ai tenté une réinstallation et quelques modifications de conf mais sans succès! Je laisse quand même la procédure mais le reste de l'opération se fera avec tftp-hpa

# emerge -av atftp
[ebuild  N    ] net-ftp/atftp-0.7-r1  USE="pcre readline tcpd (-selinux)" 223 kB 
Total: 1 package (1 new), Size of downloads: 223 kB
Would you like to merge these packages? [Yes/No]

On créé notre répertoire où on va stocker les fichiers à délivrer via tftp :

# mkdir /tftproot; chmod 777 /tftproot

On le configure, la configuration par défaut va nous suffir :

# vi /etc/conf.d/atftp
# Config file for tftp server
TFTPD_ROOT="/tftproot"
TFTPD_OPTS="--daemon --user nobody --group nobody"

On le démarre :

# /etc/init.d/atftp start

On vérifie si ca tourne :

# netstat -nptlu|grep tftp
udp        0      0 0.0.0.0:69              0.0.0.0:*                           27485/in.tftpd

Bon et maintenant avec tftp-hpa avec lequel je n'ai eu aucun problème :

# emerge tftp-hpa

Pour la configuration :

# vi /etc/conf.d/in.tftpd
INTFTPD_PATH="/tftproot/"
INTFTPD_OPTS="-R 4096:32767 -s ${INTFTPD_PATH}"
# /etc/init.d/in.tftpd start

Mise en place d'un serveur dhcp

On installe :

# emerge dhcp

On le configure :

# vi /etc/dhcp/dhcpd.conf
log-facility local7;
allow booting;
allow bootp;
ddns-update-style none;
subnet 172.12.12.0 netmask 255.255.255.0 {
        range 172.12.12.10 172.12.12.12;
        filename "pxeboot";
        default-lease-time 600;
        max-lease-time 7200;
        next-server 172.12.12.2;
}

Attention à ne pas oublier la dernière ligne ( next-server 172.12.12.2; ) qui est l'IP de votre serveur dhcp, sans ce paramètre vous obtiendrez une erreur 60 des plus obscure.

Bon là on relance dhcpd et on peut déjà voir si la soekris en bootant trouve le serveur :

# tail -f /var/log/messages
Mar 26 01:10:30 tuxic dhcpd: DHCPDISCOVER from 00:00:24:c9:59:2c via eth1
Mar 26 01:10:31 tuxic dhcpd: DHCPOFFER on 172.12.12.10 to 00:00:24:c9:59:2c via eth1
Mar 26 01:10:31 tuxic dhcpd: DHCPREQUEST for 172.12.12.10 (172.12.12.2) from 00:00:24:c9:59:2c via eth1
Mar 26 01:10:31 tuxic dhcpd: DHCPACK on 172.12.12.10 to 00:00:24:c9:59:2c via eth1

Bon c'est déjà ca de fait, reste maintenant à offrir un bootloader :

# cd /tftproot
# wget ftp://ftp3.usa.openbsd.org/pub/OpenBSD/4.2/i386/pxeboot
# wget  ftp://ftp3.usa.openbsd.org/pub/OpenBSD/4.2/i386/bsd.rd

On créé le fichier boot.conf pour passer des paramètres au boot :

# mkdir etc; vi etc/boot.conf
set tty com0
stty com0 19200
boot bsd.rd

Côté Soekris

Bon, on va s'occuper maitenant de la soekris à proprement parler. Donc depuis la box OpenBSD, branchement série effectué entre la soekris et l'OpenBSD box (après plusieurs essais infructueux suite à la non activation du port série dans le bios de la tour et des conflits d'IRQ réglés à l'arrache suite à l'activation du port série), j'arrive enfin à me connecter à la soekris :)

# cu -l tty00 -s 19200

On doit arriver à quelque chose comme ca :

comBIOS ver. 1.32i 20071005  Copyright (C) 2000-2007 Soekris Engi
net5501
0512 Mbyte Memory                        CPU Geode LX 500 Mhz 
Pri Mas  ST940815A                       LBA Xlt 1024-255-63  390
Slot   Vend Dev  ClassRev Cmd  Stat CL LT HT  Base1    Base2   In
-----------------------------------------------------------------
0:01:2 1022 2082 10100000 0006 0220 08 00 00 A0000000 00000000 10
0:06:0 1106 3053 02000096 0117 0210 08 40 00 0000E101 A0004000 11
0:07:0 1106 3053 02000096 0117 0210 08 40 00 0000E201 A0004100 05
0:08:0 1106 3053 02000096 0117 0210 08 40 00 0000E301 A0004200 09
0:09:0 1106 3053 02000096 0117 0210 08 40 00 0000E401 A0004300 12
0:20:0 1022 2090 06010003 0009 02A0 08 40 80 00006001 00006101 
0:20:2 1022 209A 01018001 0005 02A0 08 00 00 00000000 00000000 
0:21:0 1022 2094 0C031002 0006 0230 08 00 80 A0005000 00000000 15
0:21:1 1022 2095 0C032002 0006 0230 08 00 00 A0006000 00000000 15

 1 Seconds to automatic boot.   Press Ctrl-P for entering Monitor
Using drive 0, partition 3.
Loading...
probing: pc0 com0 com1 pci mem[639K 511M a20=on] 
disk: hd0+
... 

A ce niveau là, la soekris accroche une ip et commence à télécharger les fichiers et l'installation peut commencer :)

Installation d'OpenBSD

J'avais déjà fait un post sur le sujet, je vais le refaire en version plus complète.

erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? I

Choisir le keymap :

Welcome to the OpenBSD/i386 4.2 install program.

This program will help you install OpenBSD. At any prompt except password
prompts you can escape to a shell by typing '!'. Default answers are shown
in []'s and are selected by pressing RETURN.  At any time you can exit this
program by pressing Control-C, but exiting during an install can leave your
system in an inconsistent state.

Terminal type? [vt220]
kbd(8) mapping? ('L' for list) [none] L
Major tables: be br cf de dk es fr hu it jp la lt lv nl no pl pt ru sf sg si sv tr ua uk us
kbd(8) mapping? ('L' for list) [none] fr
kbd: keyboard mapping set to fr

On confirme notre installation !!

IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this
program can cause SIGNIFICANT data loss.

It is often helpful to have the installation notes handy. For complex disk
configurations, relevant disk hardware manuals and a calculator are useful.

Proceed with install? [no] yes
Cool! Let's get to it.

On commence par le partitionnement du disque :

You will now initialize the disk(s) that OpenBSD will use. To enable all
available security features you should configure the disk(s) to allow the
creation of separate filesystems for /, /tmp, /var, /usr, and /home.

Available disks are: wd0.
Which one is the root disk? (or 'done') [wd0]

Do you want to use *all* of wd0 for OpenBSD? [no] yes
Putting all of wd0 into an active OpenBSD MBR partition (type 'A6')...done.

You will now create an OpenBSD disklabel inside the OpenBSD MBR
partition. The disklabel defines how OpenBSD splits up the MBR partition
into OpenBSD partitions in which filesystems and swap space are created.

The offsets used in the disklabel are ABSOLUTE, i.e. relative to the
start of the disk, NOT the start of the OpenBSD MBR partition.

# Inside MBR partition 3: type A6 start 63 size 78140097
Treating sectors 63-78140160 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.

Initial label editor (enter '?' for help at any prompt)
> a
partition: [a]
offset: [63]
size: [78140097] 1024M
Rounding to cylinder: 2104452
FS type: [4.2BSD]
mount point: [none] /
> a
partition: [b]
offset: [2104515]
size: [76035645] 512m^H
Invalid entry
size: [76035645] 512M
Rounding to cylinder: 1060290
FS type: [swap]
> a
partition: [d]
offset: [3164805]
size: [74975355] 512M
Rounding to cylinder: 1060290
FS type: [4.2BSD]
mount point: [none] /tmp
> a
partition: [e]
offset: [4225095]
size: [73915065] 4096M
Rounding to cylinder: 8401995
FS type: [4.2BSD]
mount point: [none] /var
> a
partition: [f]
offset: [12627090]
size: [65513070] 8192M
Rounding to cylinder: 16787925
FS type: [4.2BSD]
mount point: [none] /usr
> a
partition: [g]
offset: [29415015]
size: [48725145]
FS type: [4.2BSD]
mount point: [none] /home
> q
Write new label?: [y]
Mount point for wd0d (size=530145k)? (or 'none' or 'done') [/tmp] done
No more disks to initialize.

OpenBSD filesystems:
wd0a /
wd0d /tmp
wd0e /var
wd0f /usr
wd0g /home

On fixe notre configuration :

The next step *DESTROYS* all existing data on these partitions!
Are you really sure that you're ready to proceed? [no] yes
/dev/rwd0a: 1027.6MB in 2104452 sectors of 512 bytes
6 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
newfs: reduced number of fragments per cylinder group from 66264 to 66000 to enlarge last cylinder group
/dev/rwd0d: 517.7MB in 1060288 sectors of 512 bytes
5 cylinder groups of 128.91MB, 8250 blocks, 16512 inodes each
/dev/rwd0e: 4102.5MB in 8401992 sectors of 512 bytes
21 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/rwd0f: 8197.2MB in 16787924 sectors of 512 bytes
41 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/rwd0g: 23791.6MB in 48725144 sectors of 512 bytes
118 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=Tue Aug 28 17:07:36 2007)
/dev/wd0g on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Tue Aug 28 17:07:37 2007)
/dev/wd0d on /mnt/tmp type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Tue Aug 28 17:07:37 2007)
/dev/wd0f on /mnt/usr type ffs (rw, asynchronous, local, nodev, ctime=Tue Aug 28 17:07:37 2007)
/dev/wd0e on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Tue Aug 28 17:07:37 2007)

On donne un nom :

System hostname? (short form, e.g. 'foo') tuxic

On configure maintenant le réseau Dans mon cas, je suis derrière une freebox en mode bridge, c'est donc la soekris qui recevra l'ip publique. Je créé 3 sous réseaux (LAN, DMZ1, DMZ2).

Configure the network? [yes]
Available interfaces are: vr0 vr1 vr2 vr3.

interface vr0

Which one do you wish to initialize? (or 'done') [vr0]
Symbolic (host) name for vr0? [tuxic]
The media options for vr0 are currently
        media: Ethernet autoselect (100baseTX full-duplex)
Do you want to change the media options? [no]
IPv4 address for vr0? (or 'none' or 'dhcp') dhcp
Issuing hostname-associated DHCP request for vr0.
DHCPDISCOVER on vr0 to 255.255.255.255 port 67 interval 1
DHCPOFFER from 172.12.12.2
DHCPREQUEST on vr0 to 255.255.255.255 port 67
DHCPACK from 172.12.12.2
bound to 172.12.12.10 -- renewal in 300 seconds.
IPv6 address for vr0? (or 'rtsol' or 'none') [none] rtsol
Available interfaces are: vr1 vr2 vr3.

interface vr1

Which one do you wish to initialize? (or 'done') [vr1]
Symbolic (host) name for vr1? [tuxic] LAN
The media options for vr1 are currently
        media: Ethernet autoselect (none)
Do you want to change the media options? [no]
IPv4 address for vr1? (or 'none' or 'dhcp') 10.0.0.1
Netmask? [255.255.255.0]
IPv6 address for vr1? (or 'rtsol' or 'none') [none]
Available interfaces are: vr2 vr3.

interface vr2

Which one do you wish to initialize? (or 'done') [vr2]
Symbolic (host) name for vr2? [tuxic] DMZ1
The media options for vr2 are currently
        media: Ethernet autoselect (none)
Do you want to change the media options? [no]
IPv4 address for vr2? (or 'none' or 'dhcp') 172.12.12.1
Netmask? [255.255.255.0]
IPv6 address for vr2? (or 'rtsol' or 'none') [none]
Available interfaces are: vr3.

interface vr3

Which one do you wish to initialize? (or 'done') [vr3]
Symbolic (host) name for vr3? [tuxic] DMZ2
The media options for vr3 are currently
        media: Ethernet autoselect (none)
Do you want to change the media options? [no]
IPv4 address for vr3? (or 'none' or 'dhcp') none
IPv6 address for vr3? (or 'rtsol' or 'none') [none]
Available interfaces are: vr3.
Which one do you wish to initialize? (or 'done') [vr3] done

On va passer à l'installation du système à proprement parler. Dans ma configuration je suis connecté au net via eth0 et eth1 sert de PXE à la soekris. Pour offrir le réseau j'ai utilisé un proxy http (tinyproxy en l'occurence) pour que la soekris puisse accéder au net.

Location of sets? (disk ftp http or 'done') [disk] http
HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] http://172.12.12.2:8888
Display the list of known http servers? [no] no
Server? (IP address, hostname or 'done') [spargel.kd85.com/pub] spargel.kd85.com/ftp
Server directory? [pub/OpenBSD/4.2/i386]

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-' to the set name, file name pattern or 'all'. Selected
sets are labelled '[X]'.

      [X] bsd
      [X] bsd.rd
      [ ] bsd.mp
      [X] base42.tgz
      [X] etc42.tgz
      [X] misc42.tgz
      [X] comp42.tgz
      [X] man42.tgz
      [X] game42.tgz
      [ ] xbase42.tgz
      [ ] xetc42.tgz
      [ ] xshare42.tgz
      [ ] xfont42.tgz
      [ ] xserv42.tgz
Set name? (or 'done') [bsd] done
Location of sets? (disk ftp http or 'done') [disk] done

A vous de sélectionner les sets qui vous conviennent. Par exemple pour supprimer le set game42.tgz, taper : -game42.tgz

ssh/ntp/etc.

Start sshd(8) by default? [yes]
NTP server? (or 'none' or 'default') [none]
Do you expect to run the X Window System? [no]

Définir la console par défaut

Change the default console to com0? [no] yes
Saving configuration files...done.
Generating initial host.random file...done.

Définir le timezone

What timezone are you in? ('?' for list) [Canada/Mountain] Europe/Paris
Setting local timezone to 'Europe/Paris'...done.
Making all device nodes...done.
Installing boot block...
boot: /mnt/boot
proto: /usr/mdec/biosboot
device: /dev/rwd0c
/usr/mdec/biosboot: entry point 0
proto bootblock size 512
/mnt/boot is 3 blocks x 16384 bytes
fs block shift 2; part offset 63; inode block 104, offset 11816
using MBR partition 3: type 166 (0xa6) offset 63 (0x3f)
done.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter halt at the command prompt. Once the
system has halted, reset the machine and boot from the disk.

Voilà c'est terminé pour l'installation.

Quelques petits détails supplémentaires si vous rencontrez des problèmes au boot.

  • Si vous avez répondu no à la question Change the default console to com0? votre soekris ne pas booter, car la console par défaut ne sera pas bonne (je ne maitrise pas du tout ce point laors je ne peux vraiment expliquer clairement le pourquoi du comment), cela dit lors de mon installation j'avais répondu no et empéchait le système de booter. Dans ce cas lors du prompt de la soekris taper :
boot> set tty com0

Et là votre système va booter correctement et pour fixer de manière définitive ce paramètre :

# vi /etc/boot.conf
set tty com0
stty com0 57600

Voilà pour un tour d'horizon de cette installation. Tout reste à faire, pf/nat et autres configurations :)

Pour finir, l'extinction définitive de mon ancienne passerelle fut un grand moment, je ne soupsonnais même plus que le niveau sonore était a ce point élevé :D