Advanced DHCP Options: Pushing static routes to clients
The DHCP protocol contains several more or less options to configure the clients (e.g. PAC-Files, NTP-Servers, etc.). One of these cool options is the ability to push static routes to clients. This can be done in two different ways:
- Single route (DHCP Option 33)
- Classless Static Route (DHCP Option 121)
Single route
Pushing a single route is very easy. The configuration value consists of two ip address pairs in hex. The first address is the destination host, the second is the router.
Example:
Destination: 192.168.123.234 (Hex: C0:A8:7B:EA)
Router: 10.34.72.42 (Hex: 0A:22:48:2A)
The value is: C0:A8:7B:EA:0A:22:48:2A
If you configure a pfsense box, go to Services -> DHCP Server and add the value to the box "Additional BOOTP/DHCP Options". Its important to choose the type "String"!

Classless Static Routing
The DHCP option 121 follows a slightly different format. The format is <width of the subnetmask>:<netaddress>:<router address> (again, in hex).
Example:
Destination: 192.168.123.0 (Hex: C0:A8:7B:0)
Router: 10.34.72.42 (Hex: 0A:22:48:2A)
Subnet mask width: 24
Value: 24.192.168.123.10.34.72.42, in hex 18:C0:A8:7B:0A:22:48:2A

To provide multiple static routes, just concat all encoded values. According to RFC 3442, you should include the default route in the DHCP option 121, since clients are allowed to ignore the "default route" DHCP option if the server provides a value for the classless static routing option. The default route option is: 00:0A:0A:0A:02 (the routers ip is 10.10.10.2, the last 4 bytes), combined: 00:0A:0A:0A:02:18:C0:A8:7B:0A:22:48:2A.
Note: Windows systems up to Windows XP/Windows Server 2003 do not request the dhcp option 121 (they have to be tweaked manually to request this option). The linux dhcp client "dhcpcd" requests this option per default (if not, set option classless_static_routes in /etc/dhcpcd.conf).
Gentoo on Alix: Installing Gentoo
I decided to run a gentoo with uclibc, because it has a really small memory footprint (only 8 MB after boot). Due to the limit resources on the alix i set up a KVM Virtual Machine wich acts as the buildhost for the alix. The buildhost creates binary packages for the alix (shared via NFS).
Settings for make.conf:
CFLAGS="-march=geode -Os -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="i486-gentoo-linux-uclibc"If you wonder why i have a i486 CHOST not a i586 one, read this post. The installation of gentoo is basically the same as described in the Gentoo Handbook. I've used the PXE Boot option of the alix board.
Kernel Configuration
There a several important settings in the kernel configuration for the Alix boards. Here is the kernel configuration for sys-kernel/gentoo-sources-2.6.36-r5.
Configuring grub
To get input/output on the serial console, add these lines to your /boot/grub/grub.conf:
serial --unit=0 --speed=38400 --word=8 --parity=none --stop=1 terminal --timeout=3 console serial
To redirect the input/output of your kernel, add console=ttyS0,38400 to the kernel command line.
Gentoo on Alix: Serial console setup
Yesterday i finally got my PCEngines Alix 2d13 for my newest geek project. Its a small embedded board, perfect for running a linux distribution and acting as a firewall.
Connecting the serial console
Since the board has no vga/hid connector, you have to use a serial console connection to actually interact with your alix. Since none of my other boxes has a serial connector i ordered a USB to Serial Adapter. You have to enable the right kernel module for the cable. In my case it was a Prolific 2303:
Device Drivers USB support (USB_SUPPORT [=y]) USB Serial Converter support (USB_SERIAL [=y]) <*> USB Prolific 2303 Single Port Serial Driver
After connecting the cable to your USB Port dmesg tells you the device name:
pl2303 1-1.6:1.0: pl2303 converter detected usb 1-1.6: pl2303 converter now attached to ttyUSB0
Now, connect to the box with your favourite serial terminal program (e.g. net-dialup/minicom) using the following settings:
Device: /dev/ttyUSB0 (or /dev/ttyS0 for a real serial connection) Bps: 38400 Parity: None Data: 8 Stop: 1
Power on the alix. You should see the alix booting. If the console show weird characters, try varying the Bitrate. To boot from the CF card, i had to set the harddisk mode to LBA in the BIOS (To enter the BIOS, press S during the memtest).
Now, let us install Gentoo Linux on the alix.
Rip audio from DVD
You can use the media-video/mplayer package to rip the audio tracks from a dvd:
mplayer -vo null -vc null -af resample=44100:0:0 -ao pcm:file=track_1.wav -chapter 1-1 dvd://2
This command will save the audio track #0 of chapter 1 (-chapter 1-1) of the second title (dvd://2) to a wav file named track_1.wav. Use the lsdvd command to find the right audio track/chapter/title combination
Blogvorstellung
Heute stelle ich mal ein paar der Blogs aus dem Blogroll vor (in beliebiger Reihenfolge):
Im Bestatterweblog kann man interessante, traurige aber informative Geschichten (gerne auch in mehreren Teilen) über den Tod, Bestattungen und dem ganzen Drumherum lesen. Hin und wieder kommen erheiternde Geschichten über den Nachwuchs des Bestatters hinzu. Passend dazu das Buch "Gestatten, Bestatter: Bei uns liegen sie richtig".
Im Blog Code Inside dreht sich alles um Microsoft .NET Technologien und deren Anwendung. Immer informativ, allerdings sehr Microsoft-lastig.
Der Shopblogger schreibt aus und über einen Spar-Markt in Bremen. Neben Geschichten über Ladendiebe und Leergutautomaten gibt es hier Einblicke in das schon fast alltägliche Chaos eines (ehemals 24h)-Supermarkts.
Diego E. Pettenò schreibt über Gentoo Development, Build-Probleme und Continuous Integration (wenn er sich nicht gerade über DRM/propietäre Ebook-Reader aufregt). Nicht immer leichte Lektüre, hat aber immer Hand und Fuß.
Im Law Blog erfährt man so einiges über Stilblüten der deutschen Justiz und öfter differenzierte Kommentare und Einschätzungen zu aktuellen Themen.
Aus dem Taxi-Blog kommen herrliche Geschichten über den Alltag eines Taxifahrers in Paderborn.
