Friday, 7 February 2014

Nebeneinander von DNSMASQ DHCPv6 und Fritzbox DHCPv6 Server

Um ein paar Dinge lokal realisieren zu können, musste ich letztlich einen Nameserver im LAN bereitstellen. Um nicht jeden Client einzeln konfigurieren zu müssen, sollte der Nameserver per DHCP verteilt werden.

 Zwar lassen sich in der Fritzbox auch andere Nameserver einstellen, allerdings werden diese nicht über DHCP verteilt. Stattdessen wird nach wie vor die Fritzbox als Nameserver verteilt und die Fritzbox stellt DNS-Queries dann an die in der Fritzbox hinterlegten Server.

 In meinem neuen Setup verteilt dnsmasq sowohl über DHCPv4 als auch DHCPv6:


  •  Lokale Nameserver und Backups, und zwar IPv4 und IPv6 Nameserver - 
  • Via DHCPv4 IPv4-Adressen 
  • Via DHCPv6 lediglich die nicht IP-bezogenen Einstellungen, bei mir die IPv6 Nameserver und ein IPv6-NTP-Server. Die Fritzbox ist weiterhin für die DHCPv6-Verteilung aller IP-bezogegenen Einstellungen (=O-Flag) zuständig.
In meiner Konfiguration bekommt meine Fritzbox über einen SIXXS Tunnel ein IPv6-Subnet und verteilt die öffentlichen IPs an die Clients im LAN, eben über den DHCPv6 Server.

 Bevor wir den DHCPv4 Server abschalten und den DHCP v6 Server auf die IP-Verteilung beschränken, soll zunächst dnsmasq eingestellt werden. Die dnsmasq.conf sollte ungefähr so aussehen:

 # Wir wollen nur DHCP, Nameserver macht in meiner Konfiguration unbound, daher DNS in dnsmasq aus mit 0
port=0

# Die IPv4-Range, die dnsmasq verteilen darf, 2h ist die leasetime.
dhcp-range=10.0.12.100,10.0.12.200,2h

# Der interessante Teil:
# Um DHCPv6 in dnsmasq einzuschalten, *muss* eine IPv6 Range eingestellt sein. Hier eingestellt auf alle Scopes im link-
# local-Bereich und meinen von SIXXS zugeteilten IPv6 Präfix (hier sinnlos verändert).
#
# ra-only befiehlt dnsmasq, nur in dem zuvor bezeichneten Subnets Ansagen zu machen, aber kein DHCP.
# ra-param setzt die Wichtigkeit der Ansagen auf hoch, den Ansage-Intervall auf 60 Sekunden und die lifetime der Route (=1200)

dhcp-range=::0, ra-only, ra-param=high,60,1200
dhcp-range=2001:xxxx:xxxx:xxxx::, ra-only, ra-param=high,60,1200

# "Enable dnsmasq's IPv6 Router Advertisement feature." - Kein weiterer Kommentar:

enable-ra

# DNS-Server, die via DHCPv6 verteilt werden: 
dhcp-option=option6:dns-server,[hier eine IPv6 Adresse eintragen, in Klammern!],[noch:eine::],[noch:eine:],[2001:4860:4860::8888]
dhcp-option=option6:domain-search,fritz.box
dhcp-option=option6:42,[ein::zeit:server:]

# dhcpv4 Subnetzmaske:
dhcp-option=1,255.255.255.0
# Gateway (= IP der Fritzbox)
dhcp-option=3,10.0.30.1
# Nameserver
dhcp-option=6,10.0.30.5,10.0.30.1,8.8.8.8
# Broadcast
dhcp-option=28,10.0.30.255
# Zeitserver (hier die Fritz)
dhcp-option=42,10.0.30.1

# Set the "all subnets are local" flag
dhcp-option=27,1
dhcp-option=option:domain-search,fritz.box
dhcp-authoritative

# The DHCP server needs somewhere on disk to keep its lease database.
# This defaults to a sane location, but if you want to change it, use
# the line below.
dhcp-leasefile=/var/lib/misc/dnsmasq.leases

# Ein paar statische Adressen

dhcp-host=00:24:6d:90:ff:8d,irgendein-name,10.0.12.50,infinite
dhcp-host=00:19:D9:4F:82:4F,noch-ein-name,10.0.12.51,infinite


Friday, 3 July 2009

Compile and upgrade or install libtorrent-0.12.4 and rtorrent-0.8.4

Chose a directory where can download the sources to. For instance

/usr/src

we do not need to create this one, as it should already exist.

# mkdir /usr/src


next, get the sources for libtorrent and rtorrent:

# cd /usr/src
# wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.4.tar.gz
# wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.4.tar.gz

Unpack both archives with

# tar xvzf libtorrent-0.12.4.tar.gz
# tar xzvf rtorrent-0.8.4.tar.gz

If you have already compiled and installed rtorrent before and created the symlinks according to my earlier tutorial, we will need to remove the symlinks and create new ones pointing to the new sources:

# rm rtorrent
# rm libtorrent

# ln -s libtorrent-0.12.4 libtorrent
# ln -s rtorrent-0.8.4 rtorrent

After that, enter the respective directories and run ./autogen.sh, then configure, the make. Before you run make install, make sure you have quit any running instances of rtorrent.

cd to libtorrent, later to rtorrent and run:
# ./autogen.sh
# make
# make install

After the long compiling process we want to make sure, rtorrent is actually working. run rtorrent

# rtorrent

Should you get an error message like this:

error while loading shared libraries: libtorrent.so.11: cannot open shared object file: No such file or directory


Run ldconfig to create and cache the links.

# ldconfig

This should solve the problem.

Saturday, 13 June 2009

compile and install current rtorrent for debian lenny on NSLU2

A solution without using subversion. For subversion we would only need the client, but you only get the full package from the repositories, together with all dependencies we would quickly reach > 50 MB. It's just too much for my little slug (1 GB USB-Flash Stick).

Well,

first of all, we create a directory in /usr/src named rtorrent. This is where we will download the sources to and where we are going to decompress the archives.:

# mkdir /usr/src/rtorrent
# cd /usr/src/rtorrent

We get the sources (note that the numbers in the filenames will change with new versions. It's best you verify at http://libtorrent.rakshasa.no/wiki.

# wget libtorrent-0.12.2.tar.gz
# wget rtorrent-0.8.2.tar.gz

assuming a fresh basic install of debian lenny, we need:

# apt-get install build-essential
# apt-get install libtool
# apt-get install automake autoconf
# apt-get install libsigc++-2.0-dev
# apt-get install pkg-config
# apt-get install libssl-dev
# apt-get install libcurl3-dev [libcurl4-openssl-dev]
# apt-get install libncurses5 libncurses5-dev


now we unzip the sources:

# tar xvzf libtorrent-0.12.2.tar.gz
# tar xzvf rtorrent-0.8.2.tar.gz

create a symbolic link to the cryptic extracted directories:

# ln -s libtorrent-0.12.2 libtorrent
# ln -s rtorrent-0.8.2 rtorrent


then move up to the libtorrent directory:

# cd libtorrent


I got an error like "make[4]: *** [file_list_iterator.lo] Error 1" when compiling with make. Fortunately, this is known and can be easily fixed by applying the libtorrent-gcc43-v2.patch before compiling.

So, when in the libtorrent source directory, wget the patch

# wget http://libtorrent.rakshasa.no/raw-attachment/ticket/1266/libtorrent-gcc43-v2.patch

and apply it with

# patch -p1 < libtorrent-gcc43-v2.patch

next, we start the usual procedure (cf. here). Before we begin we open a screen session, so that we don't need to stay connected to the NSLU2 the whole time. If you've not already done so, install screen (you will probably use it with rtorrent anyways).

# apt-get install screen

Then, start a new screen session. We name it rtorrcompiling (chose whatever you want).

# screen -S rtorrcompiling.

Now do:

# ./autogen.sh
# ./configure
# make

note that make is going to take several hours (in my case more than 6). Sigh. You can detach the screen with CTRL-A d. Logout, power off your PC (not the NSLU ;)), get a coffee or go to sleep. Or you can take a look how hard your slug is working by

# top

Exit top by pressing q.

If you want to check how far make got, login to your slug and resume the screen session with

# screen -r

When make is done, go on with

# make install

and we're done with libtorrent. Next is rtorrent:

# cd ..
# cd rtorrent
# wget http://libtorrent.rakshasa.no/raw-attachment/ticket/1554/rtorrent-0.8.2-g%2B%2B4.3.patch
# patch -p1 < rtorrent-0.8.2-g++4.3.patch
# ./autogen.sh
# ./configure
# make
# make install

That's it.
Please leave a comment if this worked or not worked for you. Thanks.

Tuesday, 29 July 2008

iPhone und 802.1X (eduroam) an der FU Berlin (Tutorial)

UPDATE 02.08.2008: VPN geht auch, einfach ne Mail an die ZEDAT und ihr bekommt das entsprechende Profil an eure FU-Mail-Adresse gesandt.

UPDATE 09.09.2008:
Eine Mail ist nicht mehr erforderlich. Die Profile für eduroam und VPN sind jetzt auf den entsprechenden Webseiten abrufbar: http://www.zedat.fu-berlin.de/Eduroam-iPhone und http://www.zedat.fu-berlin.de/VPNclient-iPhone


Zutaten:Hinweis: Diese Anleitung wurde mithilfe der von der FU ZEDAT bereitgestellten Parameter für 802.1X eduroam erstellt.

Für FUler auf dem ganzen FU-Campus und dank eduroam auch an der FHTW Berlin und an der TU sowie sämtlichen sonst teilnehmenden Universitäten (Liste scheint nicht besonders aktuell zu sein) gibts schnellen WLAN Zugang fürs iPhone und iPod Touch mit 2.0 Firmware.

Leider funktioniert die Einrichtung nicht direkt über das Gerät. Stattdessen ist der Umweg über das iPhone Configuration Utility (im folgenden ICU) zu nehmen (Download von Apple), welches eine Konfigurationsdatei erstellt, die man sich anschließend zumailen kann oder auf einen webserver stellen kann. Dann wird die Datei mit dem iPhone aufgerufen und der Rest erklärt sich von selbst.

Das iCU installiert auf Windows PCs einen lokalen Webserver, der unter http://localhost:3000 (oder eben http://127.0.0.1:3000) erreichbar ist.
Benutzername und Passwort lauten jeweils admin.

Ist man im iCU eingeloggt, ist das erforderliche Profil schnell erstellt. Wir beschränken uns zunächst auf 802.1X (eduroam).


1. General

Unter General füllt man zunächst die Felder aus, was man genau einträgt ist egal, wichtig ist jedoch, dass alle required-Felder ausgefüllt werden. Anschließend zwischenspeichern mit save.

2. Credentials
Unter credentials ladet ihr die Stammzertifikatsdatei der Deutschen Telekom hoch, die ihr bei der Zedat bekommt (Link auf Deutsche-Telekom.cer).
Ob es tatsächlich erforderlich ist, auch das FU-CA Zertifikat hochzuladen, weiß ich nicht, es schadet aber nicht. Dieses heißt FU-CA.cer und ist ebenfalls auf den Servern der ZEDAT erhältlich.

3. Wi-Fi

Anschließend wechselt Ihr zur Registerkarte "Wi-Fi".


Dort tragt ihr als SSID eduroam ein, stellt den Security Type auf WPA/WPA2 Enterprise

Bei Enterprise settings stellt ihr Protocols auf TTLS.

Dann wechselt ihr auf "Authentication".













Bei Authentication tragt Ihr bei Username euren Zedat-Namen gefolgt von @zedat.fu-berlin.de ein. Also zedatname@zedat.fu-berlin.de (siehe auch Bild). Inner Authentication sollte auf "PAP" eingestellt sein. Das war's schon für hier, als nächstes geht's zu Trust.

















Bei Trust setzt Ihr ein Häkchen vor das im Schritt 2 importierte Telekom Zertifikat:
"Deutsche Telekom Root CA 2".
Anschließend wird mit Save gespeichert.



4. Profil speichern

Zuletzt wechselt ihr wieder zurück zu "General" und speichert das ganze als Datei ab, indem ihr auf "Export Profile" klickt. Am einfachsten funktionierte bei mir der Profil-Import, indem ich es mir selbst als Anhang einer Mail zugeschickt und die Mail im iPhone abgerufen habe.

Das iPhone fragt dann noch euer Zedat Passwort ab. Ab sofort sollte es möglich sein, sich im WLAN "eduroam" einzuwählen.

Beachtet hierbei, dass ihr nicht zugleich mit dem VPN Client oder mit einem anderen PC per 802.1X eingewählt sein dürft. Zwar bucht sich das iPhone bei eduroam ein, ihr kommt aber nicht ins Netz.

Das wars!

Monday, 28 July 2008

iPhone, Voicemail und T-Mobile

Als T-Mobile Neukunde war ich zunächst gehörig verwirrt: Ohne mein Zutun verschwanden Voicemail-Nachrichten nach einiger Zeit. Hatte ich dies zunächst noch den nicht unüblichen Abstürzen des iPhone 3G zugeschrieben, bin ich heute klüger geworden.

Entgegen geschätzten Gepflogenheiten anderer Mobilfunkanbieter in Deutschland werden bei T-Mobile Nachrichten ungefragt gelöscht. Abgehörte Nachrichten bereits nach sieben Tagen, nicht abgehörte Nachrichten nach 21 Tagen. Wichtige Nummern, die auf die Voicebox gesprochen werden, sollten also schleunigst notiert werden.

Sunday, 27 July 2008

iTunes erkennt nicht iPhone / iPod Touch remote

Seitdem es im Apple-Appstore das tolle Programm remote gibt, verzweifle ich daran. iTunes wollte partout nicht mein iPhone remote erkennen, ich konnte nicht einmal das Passwort eingeben.

Neben den üblichen Fehlerquellen (googlen. Z.B.: Routereinstellungen (Kommunikation erlauben)), habe ich mich dann mal mit Wireshark rangesetzt und nachgeschaut, ob denn überhaupt Pakete vom iPhone ankommen.

Bei mir war der Schuldige jedenfalls AVM. Ich habe vor einiger Zeit Fritz Fernzugang installiert, um per VPN von außerhalb auf mein Netzwerk zugreifen können. AVMs VPN-Lösung verbockt aber offenbar die Erkennung des iPhones übers (W)-LAN.

Rettung für alle Verzweifelten; dem Problem ist ganz schnell beizukommen:

Systemsteuerung --> Netzwerkverbindungen. Dort die Netzwerkkarte anwählen, über die die Netzwerkverbindung zum Router (Fritzbox) besteht, also im Zweifel "Drahtlose Netzwerkverbindung", wenn der iTunes-Rechner per WLAN im LAN hängt. Rechtsklick, dann auf Eigenschaften und dort in der Liste das Häkchen vor "AVM VPN Driver" entfernen. Dann auf OK und voilá, das war's. Bei mir tauchte im iTunes direkt nach dem OK-Klick das iPhone auf.



Ich fand die AVM VPN-Lösung ohnehin nicht so dolle. :)

Wednesday, 7 May 2008

rtorrent finally running stably on Debian NSLU2





I am currently downloading the actual ubuntu-distro with 1400 KB/s along with to other small test torrents to make sure it really works. And it does.

After all it can be said the solution to the crash issue was almost too simple:

Responsible for rtorrents crash behaviour was the oom-killer (cf. earlier posts) that is shipped with debian etch.
However, uprading to lenny solves this issue.

That can be done by simply typing:

apt-get update
apt-get dist-upgrade


Before Upgrading, make sure you have a backup at hand:
sudo cat /dev/mtdblock* > backup.img
...and store it to a safe location. With this precaution you can always switch back to a working system by putting the NSLU2 into upgrade mode and flashing the backup.img to it with upslug2.

The upgrade may take a considerable time.

Note that I crashed my Debian NSLU2 by doing this because the "new initramfs-tools in testing (version 0.92) generates a ramdisk that does not boot correctly on the NSLU2 - it makes your system unbootable (see bug #478236)."
As mentioned, the upgrade is currently not safe.

As I crashed my NSLU2 and had no backups but also no important data on it, I snapped at the chance and reinstalled my system with the debian 5.0 beta 1 (unoffical), see here.

If you have any questions, leave a comment!

UPDATE July 28: Upgrading via apt-get dist-upgrade should be safe now.

Tuesday, 11 March 2008

Almost weekly DS-Line quality report


No resyncs so far but a considerable number of "Forward Error Corrections". Regarding the speed I got no faster downloads than 1,3 Mbit/s, but I hadn't it tested yet.

UPDATE: Sooo, with a cable connection to my router (rather than wireless) I hit 1,75 Mbit/s.

the rtorrent-on-debian-NSLU2-crash-issue

I'm still having problems with rtorrent on my NSLU2. It keeps crashing after two hours or so no matter what I do ([1], [2]) with .rtorrenct.rc.

However, yesterday it came across my mind, the actual problem (which is resources) could be connected to the user with whom I start rtorrent. rtorrent does not run as root but as a user with limited privileges on my NSLU2. My thinking was that Linux allocates more resources to root than to inferior users.

So I tried running rtorrent with screen and root. But still, not really a change.

I'm still wondering about the positive reports on rtorrent with the NSLU2 that e.g. google brings forward. When I asked once a forum user about how was running rtorrent, he basically replied:

"Well, it never crashed, but I've never downloaded anything with it".

So, do the positive reports only come from users who do not actually use their rtorrent?

Anyways, I'm running out of ideas on how to get rtorrent running stably. The ultima ratio seems to be to start with a fresh installation of debian...
argh.

Thursday, 6 March 2008

Tuesday, 4 March 2008

Fritzbox 7170 connected directly to the "TAE" / No Splitter!

Yes, it is somewhat complicated. You'll need a proper cable to do that. And it seems you have to build it yourself. I'm still gathering information on that.

Nah, it has changed a bit. Watch the spectrum.



The spectrum is more square-edged or steppy between 64 and 90 kHz while the signal/noise quality is rounder. Also, I gained one dB in Signal/Noise-ratio... Yay!

Sole downer: lost 4 Kbit/s of potential upstream.. :)

Sunday, 2 March 2008

Beta for Fritz!Box 7170: Firmware-Version 29.04.55-10393

DSL Version and figures almost the same, so I won't post any screenshot for now. Since I do not use the conventional (fixed) line any more (only VOIP), my next try is connecting the Fritz!Box directly to the TAE Box; I do not want to use the splitter any more. Effects on Signal Quality will be posted here soon.

Sunday, 24 February 2008

Fritz!Box 7170 > DSL-Informationen

Mainly for my own ends I post here screenshots from my Fritzbox 7170 with "Labor-Version 29.04.97-10173" (DSL-Version 1.36.06.01) in order to compare it to my connection upgrade scheduled for march.
Currently, my ADSL is provided by 1&1, while the carrier is telefonica. The current Speed is 6656 kBit/s (down) and 640 kBit/s (up) (ADSL). When upgraded (ADSL2+), the carrier will still be Telefonica.




Friday, 15 February 2008

rtorrent on Debian NSLU2 unstable - Part 2

In order to find out the number of peers the nslu2 can handle i adjusted max_peers in ~/.rtorrent.rc to 50. It was running stably with the value of 40 before.
Sadly I had to find out, that with "50" rtorrent got killed again. So, I'll stick with "40" for now.

Wednesday, 13 February 2008

rtorrent on debian NSLU2

A few days ago I installed rtorrent on my debian slug. Rtorrent presents itself to be installed on the NSLU2 because of its
"[...] focus on high performance and good code.".

Therefore I expected a low memory and cpu footprint.
Furthermore, rtorrent makes use of ncurses and is therefore predestined to be detached with 'screen'.

Unfortunenately it turned out that the rtorrent-process (both libtorrent-0.12.0.0 with rtorrent-0.8.0 (unstable) and ibtorrent-0.11.9 with rtorrent-0.7.9.tar.gz) got regularly (every 2 hours or so) killed.

Dmesg in both cases:
Out of memory: Killed process 9754 (rtorrent).

Obviously, rtorrent consumes too much of the little RAM the NSLU2 has to offer. Being somewhat contrary to the quotation cited above...

In addition, it took rtorrent ages to hash a new torrent or to rehash a torrent when rtorrent got killed.

The hash problem could quite easily be resolved. With a little help from here all that had to be done was adjusting the hash parameters in ~/.rtorrent.rc:


# Hash read-ahead controls how many MB to request the kernel to read
hash_read_ahead = 5

# Interval between attempts to check the hash, in milliseconds.
hash_interval = 10

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
hash_max_tries = 3


The one problem remaining was the crashes. To cut a long story short: today rtorrent runs stably on my NSLU2. The only downer is with my current configuration I can only download one torrent at a time. Elsewise it gets killed again.


Here is my current .rtorrent.rc. The trigger to avoid the kills was adjusting the peers settings. Default was a much higher number (I don't remember.. ;)). I will continue adjusting it step by step to higher values to establish what I can expect from my NSLU2.


min_peers = 1
max_peers = 40

min_peers_seed = 1
max_peers_seed = 10

max_uploads = 2

download_rate = 0
upload_rate = 50

directory = ./dl-torrents
session = ./session

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/home/torrent/torrents/*.torrent
schedule = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M
schedule = ratio,60,60,"stop_on_ratio=120,200M,150"

port_range = 30890-30998
port_random = yes

check_hash = no

use_udp_trackers = yes

# this setting remains from the actual (unstable)
# beta or alpha from rtorrent with dht tracker support.
# Thus commented out because I use a previous version
# dht_port = 30999

peer_exchange = yes

# here go the settings for faster hashing
hash_read_ahead = 5
hash_interval = 10
hash_max_tries = 3