2.2. Getting and Installing the Software

To download the generic-pc image or CD ISO, point your web browser to http://www.m0n0.ch/wall/downloads.php and select the generic-pc download link from that page. Download the file to the computer you plan to use for writing to the CompactFlash card or hard disk.

2.2.1. Installing the Standard PC by Hard Disk

Installation on a standard PC requires the following steps:

  1. download the raw CF/IDE image (generic-pc)

  2. write the image to a CF card (> 5 MB) or an IDE hard disk, either with dd under FreeBSD or under Windows with physdiskwrite. A more detailed description of writing the image to these media is in the following section

  3. put the CF card/HD into the target PC

  4. plug the PC into the network (LAN/WAN/...).

    Caution

    If you have an existing DHCP server, and/or wish to use a different IP subnet on your LAN, you will need to first connect via the PC's keyboard/ monitor or serial console interface as described in the Initial Configuration chapter.

  5. power up the PC

Now that your system has booted using the m0n0wall software continue to the section Section 2.3, “Final Preparation”.

2.2.2. Writing the Image File

If you are installing to a standard PC using an IDE or CF disk, you need to write the image to a sufficiently large CF card or hard disk (at least 10 MB for the generic-PC image in version 1.3). Extra space on the CF card or drive is ignored; there is no benefit to using one larger than 8 MB other than possibly compatibility on future releases.

The following sections will cover how to write the CF card in Windows, FreeBSD, and Linux. A summary is below with details following for each operating system.

  • Windows:

    (use the -u flag if the target disk is > 800 MB - make very sure you've selected the right disk!!)

    physdiskwrite [-u] generic-pc-xxx.img

    (you must use v0.3 or later!)

  • FreeBSD:

    gzcat generic-pc-xxx.img | dd of=/dev/rad[n] bs=16k

    where n = the ad device number of your CF card (check dmesg) (ignore the warning about trailing garbage - it's because of the digital signature)

  • Linux:

    gunzip -c generic-pc-xxx.img | dd of=/dev/hdX bs=16k

    where X = the IDE device name of your HD/CF card (check with hdparm -i /dev/hdX) - some CF adapters, particularly USB, may show up under SCSI emulation as /dev/sdX (ignore the warning about trailing garbage - it's because of the digital signature)

2.2.2.1. Windows

For Windows you will be downloading physdiskwrite from the m0n0wall web site. This is a small Windows NT/2000/XP command line tool that makes it possible to write disk images onto raw disks, like CF cards. It currently has a few rough edges, most notably in the selection of the device to be written – you have to decide which device is the right one by looking at the C/H/S values (though if the CF card was the last device to be connected to the system, it usually shows up as the last one in the list).

Note that the C/H/S values may be incorrect for CF cards – looks like this is a bug in Windows. There is some protection against accidentally overwriting your hard disk, but then again, I CAN'T TAKE ANY RESPONSIBILITY FOR LOST DATA – YOU USE THIS PROGRAM ON YOUR OWN RISK.

Manuel Kasper's (author of m0n0wall) physdiskwrite should be used on Windows to write the CF card. Download it from the m0n0wall web site's physdiskwrite page.

Note

Note to Windows Vista users: physdiskwrite works with Vista, but you must make sure to run it as administrator (simply having admin rights isn't enough), or it won't find any disks. One way to do this is to create a shortcut to cmd.exe, then right-click it and select "run as administrator". Then you can launch physdiskwrite from the command prompt window that appears, and it should work fine.

Save physdiskwrite.exe and the downloaded m0n0wall image in the same directory on your hard drive, then open a Windows Command Prompt (click Start, Run, type in cmd and click OK).

Plug in your CF card reader/writer and insert your CF card. If you are connecting your hard drive you can either connect it directly to your computer or through a fire wire or USB adaptor for external drives.

'cd' into the directory containing physdiskwrite and the m0n0wall image and run the following:

physdiskwrite generic-pc-xxx.img

Replacing generic-pc-xxx.img with the name of the generic-pc image you downloaded.

Tip

Windows users can just simply drag-and-drop the image file onto the physdiskwrite.exe icon.

You will see output similar to the following:

physdiskwrite v0.5 by Manuel Kasper <mk@neon1.net>

Searching for physical drives...

Information for \\.\PhysicalDrive0:
   Windows:       cyl: 14593
                  tpc: 255
                  spt: 63
   C/H/S:         16383/16/63
   Model:         ST3120026A
   Serial number: 3JT1V2FS
   Firmware rev.: 3.06

Information for \\.\PhysicalDrive1:
   Windows:       cyl: 1
                  tpc: 255
                  spt: 63

You will see all the hard drives in your system listed, as well as the compact flash card. Since we did not run physdiskwrite -u, physdiskwrite will refuse to write to any drive over 2 GB. This is a protection so you don't accidentally overwrite your hard drive.

Warning

If you are using physdiskwrite.exe to write to a second hard disk be very careful that you identify the correct disk before writing to it (i.e. do not write the image to your own computer's boot disk).

2.2.2.2. FreeBSD

The procedures to image a CompactFlash card depend upon the type of adapter you are using. The CF card will either appear as a SCSI or IDE hard drive.

Run the command atacontrol list. You will get output similar to the following:

su-3.00# atacontrol list
ATA channel 0:
Master: ad0 <WDC WD200EB-75CSF0/04.01B04> ATA/ATAPI revision 5
Slave: ad1 <WDC WD800AB-22CBA0/03.06A03> ATA/ATAPI revision 5
ATA channel 1:
Master: acd0 <_NEC CD-RW NR-7800A/10DA> ATA/ATAPI revision 0
Slave: no device present
            

Then run the command camcontrol devlist. You will see output similar to the following:

su-2.05b# camcontrol devlist
<ADAPTEC RAID-5 320R> at scbus2 target 0 lun 0 (pass0,da0)
<SEAGATE ST39204LC 0005> at scbus2 target 3 lun 0 (pass1,da1)
<ESG-SHV SCA HSBP M10 0.05> at scbus2 target 6 lun 0 (pass2)                
            

You will find your CF card somewhere in the above output. Make note of its device name (adX or daX).

Run the following command, replacing adX with your CF device as determined above, and generic-pc-xxx.img with the name of the m0n0wall image you downloaded.

gzcat generic-pc-xxx.img | dd of=/dev/adX bs=16k

Ignore the warning about trailing garbage - it's because of the digital signature.

2.2.2.3. Linux

gunzip -c generic-pc-xx-xxx.img | dd of=/dev/hdX bs=16k

where X = the IDE device name of your CF card (check with hdparm -i /dev/hdX) - some adapters, particularly USB, may show up under SCSI emulation as /dev/sdX.

Ignore the warning about trailing garbage - it's because of the digital signature.

2.2.3. Installing the standard PC by CDROM

If you are installing to a standard PC using a CDROM and floppy disk, you will need to write the bootable CDROM and format the floppy disk.

Installation on a standard PC with the CD-ROM (+ floppy disk) version requires the following steps:

  1. Download the ISO image

  2. Burn the ISO image onto a CD-R (or -RW)

    FreeBSD (ATAPI recorder): burncd -s max -e data cdrom-xxx.iso fixate

    Windows: use your favorite burning program (e.g. Nero) to record the ISO image (2048 bytes/sector, Mode-1)

  3. Take a standard 1.44 MB diskette or a USB flash drive (m0n0wall 1.3b only) and format it (with an MS-DOS/FAT file system!)

    • 1.44 MB floppy disk

      FreeBSD: fdformat -f 1440 /dev/fd0 && newfs_msdos -L "m0n0wallcfg" -f 1440 /dev/fd0 Note: you can omit the fdformat step if the floppy disk is already (low-level) formatted

      Windows: format A:

    • USB flash drive

      Windows: use Windows Explorer to format the drive (FAT32)

  4. Plug the PC into the network (LAN/WAN/...).

    Caution

    If you have an existing DHCP server, and/or wish to use a different IP subnet on your LAN, you will need to first connect via the PC's keyboard/ monitor or serial console interface as described in the Initial Configuration chapter.

  5. Power up your PC, enter the BIOS and make sure that booting from CD-ROM is enabled and booting from floppy disk is disabled

  6. Insert CD-ROM and floppy disk (do not write-protect the floppy disk!)

  7. Continue the boot process

Now that your system has booted using the m0n0wall software continue to the section Section 2.3, “Final Preparation”.