Multiple network cards and bridges in Xen

February 20th, 2008

Using multiple network cards associated to different bridges in Xen is quite easy. By default Xen uses ony one bridge.

Create custom network-script which works as a wrapper and calls network-bridge from it.

/etc/xen/scripts/multi-network-bridge:
(for Xen 3.1 and earlier)

#!/bin/sh
dir=$(dirname “$0″)
“$dir/network-bridge” “$@” vifnum=0 netdev=eth0 bridge=xenbr0
“$dir/network-bridge” “$@” vifnum=1 netdev=eth1 bridge=xenbr1

/etc/xen/scripts/multi-network-bridge:
(for Xen 3.2)

#!/bin/sh
dir=$(dirname “$0″)
“$dir/network-bridge” “$@” vifnum=0 netdev=eth0 bridge=eth0
“$dir/network-bridge” “$@” vifnum=1 netdev=eth1 bridge=eth1

In Xen 3.2 the default bridge is changed from xenbr<n> to eth<n> and the eth<n> is renamed peth<n>

Add execute-permissions:

# chmod u+x /etc/xen/scripts/multi-network-bridge

Edit Xen’s config:
/etc/xen/xend-config.sxp:


#(network-script network-bridge)
(network-script multi-network-bridge)

DomU’s config:
/etc/xen/conf/foo.conf:
(for Xen3.1 and earlier)


vif = [ 'bridge=xenbr1'];

/etc/xen/conf/foo.conf:
(for Xen 3.2)


vif = [ 'bridge=eth1'];

Reboot Dom0 and you should see multiple bridges.

How to connect to bridged modem via wan-port

February 20th, 2008

My current configuration is:

{internal network 192.168.0.0/24} - [Linksys WRT54gl] - [A-Link RR44C] - {8/1 ADSL}

where A-Link is running in bridged mode (transparent) and thus doesn’t have a public IP. It can be managed via management IP (or LAN IP as it is identified in a config) which is by default 10.0.0.2.

The Linksys WRT54gl is acting as a firewall and a WLAN access point. It’s WAN-port is connected to A-Link’s LAN and it receives it’s public IP address directly from my ISP. Linksys’s LAN uses 192.168.0.0/24 subnet.

Linksys is running OpenWrt and X-Wrt.

To connect to the A-Link, previously I had to hook up a laptop to A-Link’s LAN-port and manually set the laptop’s IP-address to 10.0.0.10 (or anything else from 10.0.0.0/8 subnet) and then browse to 10.0.0.2, which is A-Link’s default management address.

To be able to connect to the A-Link from my internal network without hassling with a laptop and IP configurations, I had to add a IP alias to Linksys’s WAN-port (which is labeled by default as vlan1):
# ifconfig vlan1:0 10.0.0.10

Now Linksys WAN-port had two IP address’s. One that it received from isp (public) and 10.0.0.10. This command add a default route which works by default, so additional route configuration is not needed. However, if you wish to add a specific route, you can do it.

First remove the old route which routes all 10.0.0.0/8 traffic to wan-interface:
# route del -net 10.0.0.0 netmask 255.0.0.0

and then add a specific route, which routes only traffic to 10.0.0.2 via wan-interface:
# route add -host 10.0.0.2 dev vlan1:0

IBM ThinkPad T20 black screen with ubuntu

January 23rd, 2008

A friend of mine was having black screen and lockup problems with a IBM ThinkPad T20 laptop. The problem persisted with ubuntu, xubuntu and kubuntu. Even the graphic installation screen didn’t show.

After googling a bit, i found this site, which explains all. All you have to do, is to use non-graphic installation (use the Ubuntu alternate install CD, because it doesn’t use X).

After the installation, enter to the Grub menu by pressing Esc, when the Grub boots up and select the recovery kernel. When you are in as a root, edit /etc/X11/xorg.conf

In a Section Device, add a line “Option “BusType” “PCI”. As shown below. It is case sensitive.

Section "Device"
       Identifier      "S3 Inc. 86C270-294 Savage/IX-MV"
       Driver          "savage"
       BusID           "PCI:1:0:0"
       Option          "BusType" "PCI"
EndSection

That worked for us.

iBook G4 + kismac + garmin gpsmap 60cx

November 25th, 2007

How to get iBook G4 with Kismac and Garmin GPSMap 60cx to work together.

I had earlier bought the Garmin GPSMap 60cx which has an USB-connection, but for my dissapointment it weren’t talking the default NMEA-language. It used the Garmin’s own proprietary-language instead which was useless for me. It would talk NMEA only from the serial-bus. It would have been nice, if it had a builtin ’serial to usb’-converter.

What I needed to do, was to get the Garmin’s serial-bus connected to my iBook which has only usb-ports. I would need to get Garmin’s own serial cable and ’serial to usb’-adapter for my mac. The Garmin’s cable was easy to get, but the adapter were more tricky, because most of the adapters were only for windows. Finally I found Prodige’s adapter which were told to be compatible with Macs and it had drivers with it. It used prolific’s chips.

Needed cables:
Prodige USB-serial-adapter RS232 DB9 male
Garmin PC interface cable (RS232 serial port connector)

For the usb-serial-adapter I tried the bundled drivers, but those were useless. I googled around and tried lot’s of things but none seemed to work. Finally I found a working solution.

1. Download and install a working driver from here (ver. 2.1.10 for PPC is mirrored here)
2. Reboot for good measure
3. Plugin the adapter and test

The quoted post:

I was frustrated, bitter and thinking of taking someone’s life; but now I’m smug and happy and the birds are singing outside my window. What finally worked for me: PB G4, OSX 10.3.9, IOGear-232A (model GUC232A), various Garmin GPSs’, and http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_1_0.dmg.

I’ve tried every other revision of every other driver, newer and older, including v1.1.0b1, and although PL2303_1.0.8 showed a tty.usbserial0 in the /dev list, nothing was talking (that I could determine).
Not http://www.prolific.com.tw/eng/Download-2.asp?ID=17
Not http://www.ramelectronics.net/download/BF-810/OSX/

I edited my /System/Library/Extensions/ProlificUsbSerial.kext/Contents/Info.plist to reflect my System Profiler:USB-Serial Controller:Product ID of 8200, however it does not indicate a Vendor ID at all (so I tried 1367 and any others on this list). I deleted the two /System/Library/Extensions.* files, reloaded (sudo kextload -v /System/Library/Extensions/ProlificUsbSerial.kext) and rebooted. Still nothing!!! I even tried cursing and praying (but may have done those out of order).

Then I:
1. Downloaded and installed FTDIUSBSerialDriver_v2_1_0,
2. Deleted the ../Extensions.* files for good measure,
3. sudo kextload -v /System/Library/Extensions/FTDIUSBSerialDriver.kext (no editing),
4. Rebooted for good measure,
5. and now I’m singing in the sunshine. A glimpse into the new /System/Library/Extensions/FTDIUSBSerialDriver/Contents/Info.plist shows a plethora of supported devices. Apparently if a rifle doesn’t work, try a shotgun.

I had earlier gotten my Garmin to talk with VPC7 WinXP Pro. Now I want to try to get it to work with System 9 so I can use http://www.gpsy.com/. Whoops! It’s gone native too! Guess I was too late. Life is sweet.

Thanks to everyone who has posted on this string and encouragement to everyone who follows.Those with determination shall persevere!

Nokia 6120 Classic and Apple iSync

November 25th, 2007

Fixed quote from this post:
http://discussions.europe.nokia.com/discussions/board/message?board.id=pcsuite&message.id=18480&view=by_date_ascending&page=3

To get the iSync to work with the Nokia 6120 Classic:

Download the plugin from
http://the.taoofmac.com/media/Nokia/6120/Nokia-6120c.phoneplugin.zip
(mirrored here) and unzip it.

Now find iSync (it should be at your Applications-folder), right-click (ctrl-click if you have an one button mouse) on it and select ‘Show Package Contents’.

Navigate to Contents > Plugins > ApplePhoneConduit.syncdevice > Contents > PlugIns and drop the ‘Nokia-6120c.phoneplugin’-folder into this PlugIns folder.

Now unpair the mac from the phone (if you have already paired them) and re-setup the phone using Apple’s bluetooth utility.

Start iSync and the phone should come up automatically. (Actually the iSync will start automatically, when you finish the pairing-process)

Old server broke down

September 15th, 2007

My old server had a major harddrive breakdown but luckily I had a new server awaiting for installation. Too bad that it seems that I lost all of my data and I can’t find backups anywhere. I’m going to see if the data can still be rescued.

Still alive

March 7th, 2007

I haven’t abandoned my blog. I just took a “little” vacation =)