Cobbler and gPXE

I’ve been playing with cobbler (through Spacewalk) for some time now.

One thing I had been meaning to do for some time was to “integrate” cobbler into the current PXE boot setup I have using gPXE.

Today I finally got around to doing it. It’s actually very easy, but I thought that there may be others interested in doing this so I figured I’d create this post. :)

I prefer to use HTTP rather than TFTP for PXE booting for various reasons, so I use so the way I got this working was by adding the following to my Spacewalk server’s Apache configuration:

Alias /pxe/ "/var/lib/tftpboot/"

<Directory "/var/lib/tftpboot/">
  Order allow,deny
  Allow from all
</Directory>

This is quite self explanatory, it just creates an alias from /pxe/ to the directory cobbler creates the configuration files for pxelinux.
Next, I created a new entry in my current PXE boot menu:

label spacewalk
  menu label Spacewalk
  kernel http://boot.internal.hamzahkhan.com/gpxe/spacewalk.gpxe

This will make gPXE grab http://boot.internal.hamzahkhan.com/gpxe/spacewalk.gpxe, and “do” what ever is inside that script when it is selected in the menu.
Next we create spacewalk.gpxe:

#!gpxe
set 210:string http://spacewalk.internal.hamzahkhan.com/pxe/
chain http://spacewalk.internal.hamzahkhan.com/pxe/pxelinux.0

DHCP option 210 is used to define the prefix path for pxelinux to search for its configuration files.
And thats all there is to it really!
Now when when the Spacewalk option is selected from the menu, pxelinux will start up, grab it’s configuration files over HTTP (rather than TFTP) and in my case, display the cobbler boot menu! :)

6to4 on Cisco IOS

I’ve recently moved my IPv6 tunnel with HE from my Linux router to a Cisco 1841. I done this mainly so my 1841 is actually routing something, otherwise it was sitting pretty much unused for quite some time.

While doing this move, I decided I’d also set-up a 6to4 tunnel since I had a static IPv4 address anyway.
I found that there aren’t any clear instructions on how to do this so here is my post which I hope would help someone! :)

First thing you need to do is to figure out your 6to4 subnet. I won’t explain how to do this since it is quite easy to find how to do this through Google.

interface Tunnel1
description 6to4 Tunnel
no ip address
no ip redirects
ipv6 address ${6TO4_SUBNET}::1/16
ipv6 enable
ipv6 mtu 1480
! This is your outgoing interface address. I am using a private address as my 1841 is being NAT'ed by my Linux router.
tunnel source 10.254.30.10
tunnel mode ipv6ip 6to4
ipv6 route ::/0 Tunne1
end

That’s it! you should be able to ping your 6to4 IP address!

You can use this page to test if you don’t have access to another IPv6 box: http://www.subnetonline.com/pages/ipv6-network-tools/online-ipv6-ping.php

Portforwarding guides for Games

For the last two days I have been playing games on my PS3 on-line, something I haven’t done for the last 3 years that I have had it.

To get better performance I decided to look at the commonly used ports, and the ports which PSN uses so I could forward them to the PS3. Before digging in myself, I decided to do some Googling and the answers I found frustrated me quite a bit.

There are multiple websites stating that port 80 and port 443 need to be forwarded to the PS3!

That is completely incorrect!

The PS3 only needs to be allowed to send outgoing packets to servers listening on 80 and 443, it does NOT its self listen on port 80 or 443.

There isn’t any real harm in forwarding those ports to your PS3, but there isn’t any benefit either!
I think this common misconception came into existence because often in manuals it lists port 80 and 443 as a port that the game or device uses…. but does not state that it only needs to be able to connect to external servers running on port 80/443 (In this case, the PSN servers!).

I also notice that a lot of sites recommend forwarding TCP port 5223, but running a packet sniffer will show you that this is not needed either!

If you run a packet sniffer yourself, you will notice that it is not the PS3 that is listening on this port, but rather Sony’s servers (which all seem to have the reverse DNS entry of service.playstation.net!). The PS3 (naturally) uses a random, high numbered source port, and sends the packet to Sony’s servers listening on 5223.

If you don’t believe me, fire up a game, and use a port scanner to scan ports 80, 443, and 5223 on your PS3s IP address. I assure you they will all be closed. Now, scan one of Sony’s servers (Sorry Sony! Please don’t sue me… its just a port scan! :( ):

# nmap -p 5223,443,80 198.107.130.128

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2011-01-26 00:28 GMT
Interesting ports on 198.107.130.128:
PORT STATE SERVICE
80/tcp closed http
443/tcp open https
5223/tcp open unknown

Nmap finished: 1 IP address (1 host up) scanned in 1.108 seconds

As you can see, this in-particular server is listening on 443 and 5223!

I have also seen a bunch of other ports which people claim need to be forwarded, but probably do not, but I won’t comment on those yet as I have yet to confirm them.

Hopefully Sony will wake up, and start deploying IPv6 and also release a firmware update with IPv6 support so we no longer have to use NAT, but for now I’m considering making a little page which will contain port numbers and protocols, which have been confirmed by me, that need to be forwarded to the PS3 for optimal performance.

My frustration with Windows and HP

I’ve just spent the last 12 hours setting up a new machine for my father with Windows 7, and so far it has been hell.

I do not use Windows very often, and this is the first time I’ve needed to install my two network printers, HP LaserJet 1022n and HP Color LaserJet 2600n, inside Windows 7. Whilst trying to install the two printers I discovered that HP have very kindly not released any Windows 7 compatible drivers for these two printers, and the Windows XP drivers aren’t working very well either.

I find this very frustrating as these printers aren’t THAT old and laser printers usually last years. Finding out that they have become obsolete just because HP can’t be bothered to provide drivers is extremely infuriating!

I just want to make one thing clear, I don’t think that it makes sense for EVERY application or piece of code to be released as open source, nor do I think everyone should stop using closed source operating systems.

Realistically Linux or any other open source operating system is definitely still not ready for an average user, but I can’t help but think what hardware manufactures, particularly of printers, would loose if they were to release the drivers for their printers as open source software, if anything they would benefit.

They would no longer have to worry about keeping the drivers working for new operating systems, or even porting them to totally different operating systems.

For example, I have found that in Linux the foo2zjs driver for CUPS doesn’t REALLY work that well for me. If HP, and all other printer manufacturers were to have open source drivers, it would be possible to write a CUPS driver that actually works just as well as it does in Windows and Mac OS X. Who is loosing out if such a thing were to happen? Not the manufacturer for sure, if anything this would draw me, and many others, to that manufacturers products as I can be confident that there will be high quality print drivers for my operating system of choice, and I won’t have to worry about the manufacturer deciding to stop maintaining the drivers for newer operating systems.

Even if they released the code once they have decided to stop maintaining it themselves, that would be fine but being realistic, I don’t think HP or any other hardware manufacturer would be nice enough to ever release their driver code to the public, but I can always hope.

While on the topic of printer manufactures, I’m also a little annoyed that my printers do not support IPv6. Hurrican Electric’s IPv4 exhaustion counter currently shows that there are only 11 more days till IANA no longer has any more IPv4 addresses left, so hopefully this should drive ISPs to start adopting IPv6. If this happens, I would like to make my home network into a pure, IPv6 only network and make IPv4 a distant memory ASAP, but now I cannot do that thanks to my printers not supporting IPv6!

During this upgrade processes, I also started to wonder why software manufacturers set their prices so high.

This machine came with Windows 7 pre-installed on it, but a couple of the other machines in my house are running a not so happy version of Windows. :)

If Microsoft had a reasonably priced “house” licence for Windows, which would allow me to install Windows on as many machines as I like, or at least a reasonable amount of machines, I would willingly pay. But paying £75 for a Windows 7 Home Premium licence or £95 for Windows 7 Professional for each machine that needs it would be very expensive!

In the last few years, I’d say that an average family often has a laptop or desktop computer for each of their children, and often one for each of the “adults” in the family” (i.e. the parents of the kids), so if we assume that an average family is one consisting of both parents, and 2 children. That is four machines. Buying Windows 7 Home Premium for all four will be £300! I don’t think anyone would be too happy paying that much for Windows.

Another point about Windows is that I hate entering serial keys.

Serial keys are a pain, they can get lost easily, and are a lot of effort to type in! In my opinion there should be a way to centralise ALL key management through a standardized tool, i.e. so even non-Microsoft software keys can also be thrown into this key management system and automatically get handed to clients. For software you would install on multiple machines, this would really be a nice tool, for home users and enterprise users alike.

For Windows, I know you can use KMS on an enterprise network to activate Windows clients without having to enter a key manually, but there should also be such a tool for home users.

I guess such a tool would be open to being exploited though so it may not be practical, but its just something I came up with while fighting with Windows.

Anyway, I am writing this post after fighting with Windows for the last 12 hours during my night shift, I can barely keep my eyes open now, so please excuse my nonsensical rambling and I’ll stop typing now!

Also, although I have managed to get my printers working in Windows 7, it would be nice if anyone else could let me know their experience with either of these two printers in Windows 7. :)

GnuCash

For quite some time I’ve been using GnuCash to keep track of my bank account income and expenses and I find it very very useful, but lately I have felt the need for a few features that are currently not in GnuCash.

One of these features is the ability to “link” books. For example, It would be nice if I could have a separate “book” and set of accounts from my family which only I can see, yet still be able to transfer directly into their GnuCash accounts, and maybe also the ability to have a “household” where everyone can can create transactions into but not let everyone else see their personal books.

Maybe it is a silly idea, but I think it would be quite useful (at least for me anyway), and it would really help visualize the flow of money inside the household. :)

Another feature I’d like in GnuCash isn’t really a “feature”, but it would be nice to see a mobile client for it. I don’t really want a web interface based client, although that shouldn’t be hard considering GnuCash supports using a SQL database to store your accounts, but rather a “real” client for Android or iOS.

Now that I have bought a HTC Desire Z (which I love so far!), I have been looking into Android development, so maybe creating an Android client could be my first, small “proper” programming project. :)

30 Days of Geek – Day 14 – Favourite computer conference?

I haven’t actually been to any, but there are quite a few I’d like to go to.

I wanted to go to Cisco Live, and a few Linux expos but I haven’t yet had the chance. Maybe I’ll go to one in 2011. :)

30 Days of Geek – Day 13 – How did you become such a geek? Career? Personal interest?

Like most geeks like me, my interest in technology is a personal one.

From a very young age, I was very interested in how computers and other devices worked to the point where I often tried to find out, and in the process breaking a lot of things.

My first “personal” (it was actually shared with my siblings!) computer was an Apple Macintosh Performa 5200 (Oh the horror!). It was running Mac OS 7.something (I still have the original installation CD somewhere! :D ). While using this machine, I messed around a lot with Virtual PC and Open Transport, although I didn’t really know what I was doing at the time!

My first real exposure to networks was when I got a broadband connection, and needed to “share” it between my fathers machine, and the machine I shared with my siblings. I originally done this through Windows 98 on my fathers machine using a free application (I seem to have forgotten the name!) which provided firewalling and NAT functionality.

Just before the time I got my broadband connection, and was using a dial-up connection on the Mac I was also quite interested in web development. I created a lot of very badly made websites and hosted them on the many free web hosts that were available. Most of these free hosts put A LOT of adverts on the pages, and only gave a few megabytes for data!

This was a huge problem since I wanted to put a lot of images, and other files (Gameboy/SNES ROMs! :D ) onto the site. So through a series of events after getting a broadband connection, I discovered I was able to host a web and FTP server on my own computer!

Eventually after getting sick of using Windows for sharing my network connection and having to wipe my machine after every few weeks due to IIS worms, I discovered that Linux would do a much better job for both purposes. Since then from then on I’ve been pretty much hooked to the wonderful world of Linux, networks and other geekery! :)

30 Days of Geek – Day 12 – What area do you want to expand your skills into?

There are quite a few areas I’d like to expand my skills in.

I have a huge interest in computer networks and Linux. For the last few months, I have been concentrating on expanding my knowledge of networks and, if all goes to plan, hope to be a CCNP by March 2011. :)

I love programming, but it is one of the areas which I haven’t been able to concentrate on very much in the last year but it is something I plan on working on in the near future.

My interest in programming is more on the low-level side of things, so I plan on expanding my currently very limited C/C++ and x86/x86_64 assembly knowledge. I hope that one day I will be proficient enough to be able to help out on the Coreboot project, and maybe also submit patches to the Linux kernel one day…. but I’m guessing there will be a lot of time before I can do that. :)

30 Days of Geek – Day 11 – Favourite hacking environment – music, light, seating, etc

Well, my desk current has the following on it:

  • Two Samsung 2043BW monitors
  • A Cisco 7912 IP Phone
  • A HORRIBLE 8 Port Cisco 1548 Microswitch
  • A 500GB Seagate FreeAgent USB drive
  • My Sony Viao laptop
  • My Desktop Keyboard (A crappy Microsoft one).
  • My Logitech MX Revolution wireless mouse
  • A VERY large Razer Goliathus mouse pad
  • A desk lamp I got from IKEA
  • A pencil pot which has a bunch of pens, pencils screws, a CompactFlash card, and other various small USB attachments (Flash drive, Bluetooth dongle etc)
  • And some books and bits of paper

I find it very difficult to concentrate when there is a lot of clutter on my desk, so before doing any real “hacking”, I clear any clutter.

My favorite time to hack would be during a warm night in summer with my desk lamp switched on. :)

But when it is cold, I prefer to hack during the day with as much light coming into the room as possible and with the room temperature at least 25 deg C.

30 Days of Geek – Day 10 – Picture, screenshot and specifications of your primary computer.

Since I switch between my Desktop and Laptop very often, I couldn’t decide which would be considered my “primary” computer.

My desktop is a Fujitsu Siemens Esprimo P7935:

  • Intel Core 2 Quad CPU Q9550
  • 6GB RAM
  • nVidia GeForce 8600 GT

My laptop is a Sony Vaio VGN-SR39XN:

  • Intel Core 2 Duo CPU T6570
  • 4GB RAM
  • Using the onboard Intel graphics card

Will post screenshots later. :)