Posts categorized “FreeBSD”.

FreeBSD: PPPoE client setup

Append the provider configuration to /etc/ppp/ppp.conf:

set device PPPoE:<interface>
set authname <PPPoE username>
set authkey <PPPoE password>
set dial
set login
add default HISADDR
enable lqr echo
enable dns
nat enable yes
set redial 2

Replace <interface> with your network interface towards the PPPoE server. Start the PPPoE client, as root: /etc/rc.d/ppp start

Enable PPPoE client at startup, append to /etc/rc.conf:


Start the PPPoE client with /etc/rc.d/ppp start as root. The PPPoE interface is usually tun0.

(Open)Solaris, Linux and FreeBSD IPv6 setup

After you create a Regular Tunnel at Hurricane Electric‘s you will receive the following informations:

Server IPv4 Address
Server IPv6 Address
Client IPv4 Address
Client IPv6 Address
Routed /64

Solaris and OpenSolaris IPv6 tunnel setup

Create /etc/hostname6.ip.tun0 file:
tsrc Client_IPv4_Address tdst Server_IPv4_Address up
addif Client_IPv6_Address Server_IPv6_Address up

Add the permanent IPv6 default gateway:
route -p add -inet6 default Server_IPv6_Address

(Tested on Solaris 10 5/09 and 10/09, OpenSolaris 2009.06 and 2010.02 preview snv_127)

Linux (RHEL / Fedora / CentOS) IPv6 tunnel setup

Create /etc/sysconfig/network-scripts/ifcfg-sit1 file:


Add the following to /etc/sysconfig/network file:


(Tested with Fedora 11 and 12, CentOS 5.3 and 5.4)

FreeBSD IPv6 tunnel setup

Add the following lines to /etc/rc.conf file:

gifconfig_gif0="Client_IPv4_Address Server_IPv4_Address"
ipv6_network_interfaces="lo0 gif0"
ipv6_ifconfig_gif0="Client_IPv6_Address prefixlen 128"

(Tested with FreeBSD 6.4)

New off-site backup solution –

I signed up with for an off-site filesystem. Opted for geo-redundant version (automated nightly replication to other site) located in Zurich, Switzerland. Very fast speed from Europe and Qatar, good speed with US hosts. Very easy to use from Mac OS X, FreeBSD, Linux and Windows (rsync, ftp, scp, sftp, ssh, WebDAV). Direct integration in Finder, just use “Connect to Server” and enter the hostname address with https. On Linux and FreeBSD 6.x sshfs works like a charm. Easy to install on FreeBSD using ports, just cd /usr/ports/sysutils/fusefs-sshfs and run make install clean.

Quick howto – RAID-1 (mirror) in FreeBSD

sysctl kern.geom.debugflags=16

gmirror label -v -b round-robin gm0 /dev/ad0

echo geom_mirror_load="YES" >> /boot/loader.conf

sed -i .orig 's/ad0/mirror/gm0/' /etc/fstab


gmirror insert gm0 /dev/ad2

Replace ad0 with your FreeBSD bootdisk, ad2 with the second (same or larger capacity) disc.

Ethernet bridging in FreeBSD 6.1

Add to rc.conf:


ifconfig_bridge0=”addm rl0 addm rl1″

Make sure you have if_bridge loaded as module or set up as ‘device if_bridge’ in your kernel configuration file.

VLAN Trunking in FreeBSD 6

Configure your switch to trunk (802.1q) desired VLANs on port connected to rl0 on FreeBSD box.

cloned_interfaces=”vlan5 vlan6″
ifconfig_vlan5=”inet netmask vlan 5 vlandev rl0″
ifconfig_vlan6=”inet netmask vlan 6 vlandev rl0″

vlan5 and vlan6 interfaces will show up:

vlan5: flags=8843 mtu 1500
inet netmask 0xffffff00 broadcast
ether 00:11:XX:XX:XX:XX
media: Ethernet autoselect (100baseTX )
status: active
vlan: 5 parent interface: rl0

vlan6: flags=8843 mtu 1500
inet netmask 0xffffff00 broadcast
ether 00:11:XX:XX:XX:XX
media: Ethernet autoselect (100baseTX )
status: active
vlan: 6 parent interface: rl0

PowerDNS recursor problems

It seems that PowerDNS‘s pdns_recursor crashes on FreeBSD under load.

I’ve replaced it by a bind recursor. Excerpt from named.conf:

options {
directory "/etc/namedb";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";

listen-on port XXXX {; };

zone "." {
type hint;
file "named.root";

FreeBSD 6.0 on old hardware

I have installed FreeBSD 6.0 on some old computer, seems to work very fast! I have rebuild world and kernel.


Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.0-RELEASE #0: Sun Nov 6 00:13:58 EET 2005
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Pentium II/Pentium II Xeon/Celeron (350.80-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x652 Stepping = 2
real memory = 201261056 (191 MB)
avail memory = 191619072 (182 MB)
ACPI disabled by blacklist. Contact your BIOS vendor.
npx0: [FAST]

on motherboard
npx0: INT 16 interface
cpu0 on motherboard
pcib0: pcibus 0 on motherboard
pir0: on motherboard
on pcib0
agp0: mem 0xe0000000-0xe3ffffff at device 0.0 on pci0
pcib1: at device 1.0 on pci0
on pcib1
pci1: at device 0.0 (no driver attached)
isab0: at device 7.0 on pci0
isa0: on isab0
atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x9080-0x908f at device 7.1 on pci0
ata0: on atapci0
on atapci0
uhci0: port 0x9040-0x905f irq 11 at device 7.2 on pci0
on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
pci0: at device 7.3 (no driver attached)
fxp0: port 0x9000-0x901f mem 0x82300000-0x82300fff,0x82100000-0x821fffff irq 3 at device 16.0 on pci0
miibus0: on fxp0
inphy0: on miibus0
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:00:e2:13:39:e0
rl0: port 0x7000-0x70ff mem 0x80100000-0x801000ff irq 10 at device 18.0 on pci0
miibus1: on rl0
rlphy0: on miibus1
rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
rl0: Ethernet address: 00:0e:2e:56:b7:83
pmtimer0 on isa0
orm0: at iomem 0xc0000-0xc7fff on isa0
atkbdc0: at port 0x60,0x64 on isa0
atkbd0: irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: irq 12 on atkbdc0
psm0: model Generic PS/2 mouse, device ID 0
fdc0: at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: [FAST]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
ppc0: at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
on ppc0
sc0: at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
unknown: can't assign resources (memory)
unknown: can't assign resources (port)
unknown: can't assign resources (port)
unknown: can't assign resources (irq)
unknown: can't assign resources (port)
unknown: can't assign resources (port)
unknown: can't assign resources (port)
Timecounter "TSC" frequency 350797222 Hz quality 800
Timecounters tick every 1.000 msec
ipfw2 (+ipv6) initialized, divert loadable, rule-based forwarding enabled, default to accept, logging limited to 1 packets/entry by default
ad0: 6179MB at ata0-master UDMA33
acd0: CDROM at ata1-master PIO4
Trying to mount root from ufs:/dev/ad0s1a

PowerDNS recursor problems

It seems that pdns_recursor from 2.9.19 dies under light load on FreeBSD.

New DNS server up

New production DNS server is up since Saturday night.

It runs PowerDNS with a MySQL 4.1 backend on FreeBSD 5.4. Complete with web (SSL) administration and statistics.

So far:

Uptime: 18 hours Queries/second, 1, 5, 10 minute averages: 6.4, 5.12, 5.15. Max queries/second: 40.1
Cache hitrate, 1, 5, 10 minute averages: 24%, 22%, 20%
Backend query cache hitrate, 1, 5, 10 minute averages: 63%, 62%, 62%
Backend query load, 1, 5, 10 minute averages: 10, 8.2, 8.59. Max queries/second: 26.7
Total queries: 313999. Question/answer latency: 0.678ms