Thursday, January 15, 2009

Crossbow in a zone

I've now got a zone up and running with a virtual nic hanging off a virtual switch but with the zone being able to talk out to the internet.

I've chosen 10.10.11.0/24 as my virtual network, as opposed to my physical network of 10.10.10.0/24.

So, in a nutshell;

Create the virtual switch;
dladm create-etherstub etherstub0

Create the virtual nics;
dladm create-vnic -l etherstub0 vnic0
dladm create-vnic -l etherstub0 vnic1

Plumb up vnic0 on the global zone, and assign it an address;
vnic0: flags=201100843 mtu 9000 index 7
inet 10.10.11.254 netmask ffffff00 broadcast 10.10.11.255
ether 2:8:20:8c:67:2e

Create the sparse zone, with vnic1 as the nic.
Set the ip-type to be exclusive and just add the vnic to the config. This means the zone will take its settings from /etc/hostname.vnic1 and /etc/defaultrouter like a standard host;
[root] deckard:/root # zonecfg -z zone1 info
zonename: zone1
zonepath: /tank/zones/zone1
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
fs:
dir: /export/home
special: /export/home
raw not specified
type: lofs
options: []
net:
address not specified
physical: vnic1
defrouter not specified

ifconfig from the zone;
vnic1: flags=201000843 mtu 9000 index 2
inet 10.10.11.1 netmask ffffff00 broadcast 10.10.11.255

Both vnics are connected to the same virtual switch, so they can ping each other no bother.
We are nearly there, but to communicate with my 'real' network I need to add a default route on the zone;
[root] zone1:/root # netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 10.10.11.254 UG 1 25
10.10.11.0 10.10.11.1 U 1 2 vnic1

To get internet access, just add the following to /etc/ipf/ipnat.conf;
map nge0 10.10.11.0/24 -> 0/32

and the following to /etc/ipf/ipf.conf;
pass in quick on nge0 from 10.10.11.0/24 to any keep state


And erm, that's it. I'm writing this in a firefox session launched from zone1. Nice :-)


Thanks to Ben Rockwood's Blog for providing the inspiration for this expedition.

Tuesday, January 13, 2009

putty: "Couldn't agree a client-to-server cipher"

OK, so I've just upgraded to nv_105 and now putty won't connect, with an SSH error - "Couldn't agree a client-to-server cipher" .
I was trying with version 0.58 so I checked to see if there was a more recent version, and there was; 0.60
Trying to connect with this version worked fine. So I just needed to fix slimserver (see earlier post) and we have another successful live upgrade.

Friday, January 9, 2009

AlienBBC on slimserver

Since my last reinstall I've been using the BBC iPlayer plugin instead of AlienBBC. Recently though I've wanted to listen to a couple of local BBC stations which do not appear in the iPlayer list, presumably because they are a real audio stream. So to listen to these I need to get AlienBBC up and running again.

So, following the instruction on the AlienBBC installation page;
  1. Server Settings -> Advanced Tab -> Extension Downloader
  2. Check AlienBBC and let it download
  3. cd /usr/local/slimserver/Cache/InstalledPlugins/Plugins/Alien/Bin
  4. vi mplayer.sh
  5. -> change first line to "#!/bin/ksh"
  6. -> put in full path to mplayer app "app=/opt/csw/bin/mplayer"
  7. ln -s `which mplayer`
  8. su - root -c "svcadm restart slimserver"

Sorted!

squeezecenter upgrade to Version: 7.4 - 24549

I downloaded the latest squeezecenter and installed it without too much issue.

Using the instructions I posted up on the slimserver support forums, it was a breeze.

1. svcadm disable slimserver, then tar and uncompress the tgz file into /usr/local

2. Comment out 2 modules in the build modules script;
vi Bin/build-perl-modules.pl
-> comment out the following;
29 #'Class::XSAccessor::Array' => 'Class-XSAccessor-Array-0.05.tar.gz',
35 #'Encode::Detect' => 'Encode-Detect-1.00.tar.gz',

3. build_perl_modules.pl;
Bin/build-perl-modules.pl

4. Copy errmsg.sys from mysql installation to MySQL directory
cp /usr/local/slimserver/MySQL/errmsg.* MySQL/

5. Copy over prefs and Plugins dir from previous slimserver install;
cp /usr/local/slimserver/prefs/server.prefs prefs/
cp -r /usr/local/slimserver/Plugins/* Plugins/
cp /usr/local/slimserver/Cache/favorites.opml Cache/

7. vi Slim/Utils/Unicode.pm and comment out line 40;
#use Encode::Detect::Detector;

8. The GD module was already installed using cpan, so move the squeezecenter files out of the way;
cd CPAN
mkdir movedoutoftheway
mv GD* movedoutoftheway

9. repoint /usr/local/slimserver to new install and test ./slimserver.pl as user slim

10. All working so svcadm enable slimserver