Blog

  • Debian router online

    So… I got my Debian router online. I expect to add ipv6 support to my network real soon now.

    The permanent storage is a 2G CF card with a CF to IDE adapter. The system has 1G of memory. The quagga bgpd has a full IPv4 table loaded. It looks like it’s eating around 180M to do that. I bet this could be reduced by storing some of those data to an RDBMS. I’ll talk with Paul about it one of these days.

    I plan to start the RIP daemon up here shortly, since the new OpenSolaris VM will make use of it. If I can get a static IP on the secondary link, I’ll set up another Quagga server on it and see about doing some load balancing.

    The system currently supports VPNs using OpenVPN. I’ve got one set up between the Everett and Seattle locations. The Seattle location is using a WRT54G running OpenWRT. It is a pretty capable box but is not able to handle a full BGP table due to memory constraints (16M).

    The router supports the following routing protocols using Quagga:

    • RIP
    • RIPng
    • OSPFv2
    • OSPFv3
    • BGP

    The router supports the OLSR protocol (for wireless mesh routing) using olsrd

    The router supports 802.1q VLAN trunking and tagging using vlan.

    The router supports 802.1d bridges using bridge-utils

    The router supports the following tunnel types using iproute:

    • IPv4 in IPv4
    • gre
    • sit
    • isatap
    • IPv6 in IPv6
    • IPv4 in IPv6

    The router supports traffic shaping and traffic control using iproute

    The router supports firewalling and network address translation (NAT) using iptables

    The router supports monitoring using snmpd, and munin

    The router supports intrusion detection and/or prevention using snort

  • PCRE support has hit quagga

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1
    
    http://bugzilla.quagga.net/show_bug.cgi?id=483
    
    
    Paul Jakma  changed:
    
               What    |Removed                     |Added
    - ----------------------------------------------------------------------------
                 Status|UNCONFIRMED                 |RESOLVED
                     CC|                            |paul dishone st
             Resolution|                            |FIXED
    
    
    
    
    - --- Comment #2 from Paul Jakma   2009-06-19 15:09:42 ---
    I've pulled in the patch from Jeremy Jackson which, I understand, was based on
    this. This adds, at least for now, a --enable-pcreposix argument to
    configure.ac.
    
    Thanks!
    
    - -- 
    Configure bugmail: http://bugzilla.quagga.net/userprefs.cgi?tab=email
    - ------- You are receiving this mail because: -------
    You are on the CC list for the bug.
    You are the assignee for the bug.
    You reported the bug.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)
    
    iEUEARECAAYFAko7vtkACgkQXKBS0hdr6Ua3+gCYoJkTzUb0zidPxo0opTPBXgKL
    cACbBU8av2K63mKAMLeUF8ZLmJSGTj4=
    =qdU2
    -----END PGP SIGNATURE-----
    
  • Installing Open Solaris as a Xen domU

    This particular dom0 is running Ubuntu 8.10 on an amd64 kernel using an lvm volume group called ‘vg0’. Adjust accordingly. Note that the credentials for this particular live cd are:

    unprivileged username: jack
    unprivileged password: jack

    privileged username: root
    privileged password: opensolaris

    I have been meaning to add a Solaris machine to my network for a while. I stopped by #opensolaris on freenode, and was helped a great deal by a guy that goes by the nick “pino42.” The gist is this:

    1. Download the ISO:
      
      cjac@dom0:~$ sudo mkdir /var/xen/osol && cd /var/xen/osol
      cjac@dom0:/var/xen/osol$ sudo wget -O osol-0906-ai-x86.iso http://dlc.sun.com/osol/opensolaris/2009/06/osol-0906-ai-x86.iso
      
    2. Mount it on /mnt/osol/:
      
      cjac@dom0:/var/xen/osol$ sudo losetup /dev/loop0 osol-0906-x86.iso
      cjac@dom0:/var/xen/osol$ sudo mkdir /mnt/osol
      cjac@dom0:/var/xen/osol$ sudo mount /dev/loop0 /mnt/osol
      
      
    3. Copy the live kernel and ram disk from the iso so that Xen can boot from them:
      cjac@dom0:/var/xen/osol$ sudo mkdir /boot/osol
      cjac@dom0:/var/xen/osol$ sudo cp /mnt/osol/platform/i86xpv/kernel/amd64/unix /boot/osol/
      cjac@dom0:/var/xen/osol$ sudo cp /mnt/osol/boot/amd64/x86.microroot /boot/osol/
      
    4. Create the target lv to which we’ll install the OS:
      cjac@dom0:/var/xen/osol$ sudo lvcreate /dev/vg0 -n solaris0-disk -L 4G
      
    5. Create the xen domU .cfg file for the live CD/installer:
      
      cjac@dom0:/var/xen/osol$ sudo -s
      root@dom0:/var/xen/osol# cat > /etc/xen/solaris-live.cfg
      name        = "solaris-live"
      vcpus       = 1
      memory      = "768" # 512 will work, but it's slow                                                                                           
      kernel      = "/boot/osol/unix"
      ramdisk     = "/boot/osol/x86.microroot"
      extra       = "/mnt/osol/platform/i86xpv/kernel/amd64/unix -kd - nowin -B install_media=cdrom"
      disk        = ['phy:/dev/loop0,6:cdrom,r','phy:vg0/solaris0-disk,0,w']
      vif         = ['bridge=net,mac=00:16:3e:aa:b9:bc']
      on_shutdown = "destroy"
      on_reboot   = "destroy"
      on_crash    = "preserve"
      ^D
      root@dom0:/var/xen/osol# exit
      
      
    6. Make sure you’ve got a DHCP server on the bridge you decide to use for ‘vif’. Setting this up is left as an exercise for the reader.
    7. All should be set to launch the live installer. Do so:
      cjac@dom0:/var/xen/osol$ sudo xm create -c solaris-live.cfg
    8. At the kernel debugger prompt, continue:
      
      Started domain solaris-live
                                 Loading kmdb...
      
      Welcome to kmdb
      Loaded modules: [ unix krtld genunix ]
      [0]> :c
      
    9. After selecting your keyboard layout and desktop language, log in:
      
      opensolaris console login: jack
      Password: jack
      
    10. You will know that the DHCP server has assigned you an address when you see a message similar to the following on the console:
      
      Jun 12 10:21:07 opensolaris in.routed[688]: route 0.0.0.0/8 --> 0.0.0.0 nexthop is not directly connected
      

      The message will probably be different if you happen to have a RIP server functioning on the same link as the DHCP server. But I do not.

      To discover the IP address which has been assigned by the DHCP server, do the following:

      
      jack@opensolaris:~$ ifconfig -a
      lo0: flags=2001000849 mtu 8232 index 1
              inet 127.0.0.1 netmask ff000000 
      xnf0: flags=1004843 mtu 1500 index 2
              inet 192.168.10.66 netmask ffffff00 broadcast 192.168.10.255
      lo0: flags=2002000849 mtu 8252 index 1
              inet6 ::1/128 
      xnf0: flags=2004841 mtu 1500 index 2
              inet6 fe80::216:3eff:feaa:b9bc/10
      
    11. Since the installer is graphical, we’ll need to attach to the X server using vnc. On the solaris machine, you need to start the vnc server. You will be prompted for a password, which must be at least 6 characters in length:
      
      jack@opensolaris:~$ mkdir ~/.vnc
      jack@opensolaris:~$ cp ~/.Xclients ~/.vnc/xstartup
      jack@opensolaris:~$ vncserver
      
      You will require a password to access your desktops.
      
      Password: password
      Verify: password
      
    12. On a machine with an X display, connect to a machine which can communicate with the host and establish a VNC session:
      
      cjac@laptop:~$ echo $DISPLAY && ssh -AY dhcp-server
      :0.0
      cjac@dhcp-server:~$ sudo apt-get install xvnc4viewer
      cjac@dhcp-server:~$ echo $DISPLAY && vncviewer 192.168.10.66:1
      localhost:11.0
      Password: password
      
    13. You should now have an X window with a view of the remote Solaris installer:
      OpenSolaris live installer
      OpenSolaris live installer

    14. Double-click on the "Install OpenSolaris" icon and proceed through the configuration. DO NOT reboot the system on completion, as we've got some Xen-specific mucking to do after the installer has completed.
    15. Return to your xm console shell and elevate your priviliges to root:
      
      jack@opensolaris:~$ su -
      Password: opensolaris
      Jun 12 10:50:24 opensolaris su: 'su root' succeeded for jack on /dev/console
      Sun Microsystems Inc.   SunOS 5.11      snv_111b        November 2008
      root@opensolaris:~# 
      
    16. I slightly modified the script I found here to get a copy of the running kernel and boot archive:
      
      root@opensolaris:~# cat > get_images.sh
      #/bin/bash
      
      dom0=$1
      dompath=$2
      unixfile=/platform/i86xpv/kernel/amd64/unix
      zdb rpool > /tmp/zdb.out # this takes 5+ minutes
      bootpath=`grep phys_path /tmp/zdb.out | awk -F\' '{print $2}'`
      dataset_id=`grep 'Dataset rpool/ROOT/opensolaris ' /tmp/zdb.out | awk -F, '{print $2}' | cut -d' ' -f 3`
      root=`pfexec beadm list -H |  grep ';N*R;' | cut -d \; -f 1`
      mkdir /tmp/root
      pfexec beadm mount $root /tmp/root 2>/dev/null
      mount=`pfexec beadm list -H $root | cut -d \; -f 4`
      pfexec bootadm update-archive -R $mount
      
      echo "Kernel and ramdisk for $root should now be copied to $dom0:$dompath"
      
      echo "${mount}${unixfile} -> $dom0:$dompath/kernel.$root"
      echo "$mount/platform/i86pc/amd64/boot_archive -> $dom0:$dompath/ramdisk.$root"
      # pfexec beadm umount $root 2>/dev/null"
      echo "Kernel cmdline should be:"
      echo "$unixfile -B zfs-bootfs=rpool/$dataset_id,bootpath=$bootpath"
      ^D
      root@opensolaris:~# chmod u+x get_images.sh
      
    17. Run the script:
      
      root@opensolaris:~# ./get_images.sh dom0 /boot/osol amd64
      
    18. Go get a cup of coffee or something. When you return, you should see something like this:
      
      Kernel and ramdisk for opensolaris should now be copied to dom0:/boot/osol
      /tmp/root/platform/i86xpv/kernel/amd64/unix -> dom0:/boot/osol/kernel.opensolaris
      /tmp/root/platform/i86pc/amd64/boot_archive -> dom0:/boot/osol/ramdisk.opensolaris
      Kernel cmdline should be:
      /platform/i86xpv/kernel/amd64/unix -B zfs-bootfs=rpool/42,bootpath=/xpvd/xdf@0:a
      
    19. Copy the kernel and ramdisk to the dom0. Your dom0 is probably not on the same network segment as your dhcp server, but I'll assume that you can ssh from the dom0 to the dhcp server:
      
      jack@opensolaris:~$ scp /tmp/root/platform/i86xpv/kernel/amd64/unix cjac@dhcp-server:/tmp/kernel.opensolaris
      jack@opensolaris:~$ scp /tmp/root/platform/i86pc/amd64/boot_archive cjac@dhcp-server:/tmp/ramdisk.opensolaris
      cjac@dom0:~$ sudo scp cjac@dhcp-server:/tmp/ramdisk.opensolaris /boot/osol/
      cjac@dom0:~$ sudo scp cjac@dhcp-server:/tmp/kernel.opensolaris /boot/osol/
      
    20. shut the live domU down:
      
      jack@opensolaris:~$ jack@opensolaris:~$ pfexec halt
      Jun 12 22:00:46 opensolaris halt: initiated by jack on /dev/console
      
    21. Create your final Xen domU config file

      cjac@dom0:~$ sudo -s
      root@dom0:~# cat > /etc/xen/solaris0.cfg
      name    = 'solaris0'
      vcpus   = 1
      memory  = "512"
      vif     = ['bridge=loc,mac=00:16:3e:aa:b9:bc']
      disk    = [ 'phy:/dev/vg0/solaris0-disk,0,w' ]
      kernel  = '/boot/osol/kernel.opensolaris'
      ramdisk = '/boot/osol/ramdisk.opensolaris'
      extra   = '/platform/i86xpv/kernel/amd64/unix -B zfs-bootfs=rpool/42,bootpath=/xpvd/xdf@0:a'
         
      on_shutdown = 'destroy'
      on_reboot = 'destroy'
      on_crash = 'destroy'
      ^D
      root@dom0:~# exit
      

    22. Instantiate the domU

      cjac@dom0:~$ sudo xm create -c solaris0.cfg
      Using config file "/etc/xen/solaris0.cfg".
      Started domain solaris0
                             v3.2-1 chgset 'unavailable'
      SunOS Release 5.11 Version snv_111b 64-bit
      Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
      Use is subject to license terms.
      Hostname: solaris0
      Reading ZFS config: done.
      Mounting ZFS filesystems: (6/6)
      
      solaris0 console login: 
      

  • Using en_US.UTF-8 locale on Debian/Ubuntu

    NB: this write-up has been superseded. You should be reading this article instead.

    It took me a while to figure out how to make Larry’s postings to #perl6 not break my screen session. Now that I’ve figured it out, I’ll see if I can share it with y’all. In addition to screen and irssi displaying garbage, I also got a lot of these errors (I hope this helps those of you who use google to search for error strings):

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    	LANGUAGE = (unset),
    	LC_ALL = "en_US.UTF-8",
    	LANG = "en_US.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    
    First of all, install the locales package:

    $ sudo apt-get install locales

    Then re-configure it and mark the tick by ‘en_US.UTF-8’:

    $ sudo dpkg-reconfigure locales

    configuring_locales


    At this point, you should be good. If you’re using screen, remember to pass the -U argument when re-attaching. I usually do something like this:

    $ screen -rxU irc
  • the trip to capitol hill on the 60

    attending swn "hack night"
    bus left at 6:57 from South Park
    boeing has a lot of masts & antennas on their roof
    Directional antenna to test link with node1 from nodemikba
    old laptop from everett basement with pcmcia card from closet and cantenna
    invited a bgp guy to attend tonight
    arrived at 7:02 at a stop light
    passed another at 15th and shelton at 7:03
    looks like we're going up Beacon Hill
    15th & columbia @ 7:04
    new va medical center parking lot at 7:05
    "radiation therapy" on the campus markers
    Citywide Horticulture signs
    call from wifey at 7:10
    sound transit station spotted at 7:11
    Bayview and Beacon at 7:12
    14th & Mass @ 7:13
    12th & Atlantic @ 7:14
    amazon @ 7:15
    12th & jackson @ 7:17
    I used to live walking distance from here
    I had dinner with Miguel and the SMUG folks a few blocks east of here
    harborview at 7:22
    boren and madison @ 7:25
    Madison and Broadway @ 7:29
    Garage @ 7:30
    I hear matt from here
    sccc @ 7:31
    linda's @ 7:46
    

    warbus-60-log-20090506

  • Everett Wireless Data Center

    I’m putting together a WISP, I guess.

    Here’s the mast in the basement prior to mounting it:

    The antenna, not mounted
    The antenna, not mounted

    Here’s the fancy antenna strapped to the chimney:


    The antenna, mounted
    Antenna

    Here’s the rack of computers that will be participating on the network:


    The rack
    The rack


  • Running a console cable to the radio


    So, I’m attaching a radio to the chimney. I don’t want to have to bring it down every time I need to flash the firmware, so I’m also running an rs-232 cable up to it along with the PoE data/power cable. Since they don’t have anything pre-built, I wired one myself. I also made a png of the schematic I used. It is probably wrong. The rj-45 should probably have been flipped over, ‘cuz as it stands, I need to attach a null-modem converter and a rj-45 to db-9 converter I got from Sun from the last Try & Buy thing I did. It would probably be easier to wire up the rj-45 end as a second db-9 end. I’ll probably do that tonight. But this is the current state, and I’ve confirmed that it works just fine. The cat-5 is about 100’ in length, and I saw no loss of signal. YMMV.

    Anyway, that’s the dealio.

    [edit: you can also attach generators to your UPS this way]

  • Parrot 1.0 released

    Congratulations to the Parrot development team. They have just released v1.0, titled “Haru Tatsu” (春達), or “The Spring.”

    I attended my first SPUG meeting in a couple of years last night. It was good to see ydna, jjore and Michael R. Wolf. It’s been so long that I don’t think I recognized anyone else. The topic for the night was the release of the Parrot virtual machine, the release schedule, some of the features, and a few examples of using the system.

  • testing a trackback

    I have never done this before.

    now with auto-pingback-fu.

    http://linuxnus.org/2009/03/04/open-up-to-lxde/