Senin, 28 September 2009

HOWTO: Install and configure FreeBSD

Installing FreeBSD 5.3, applying security patches and setting it up as a firewall/gateway with optional QoS/shaping capabilities

Disclaimer: Screw ups are your own fault, not mine, your pet or your neighbour. Also, if you plan to not read the documentation and links that I refer to don't even bother trying this.

I did a quick review and killed tons of typos and sentences that didn't make any sense, hopefully it's readable now.

Requirements:

* CD-R or CD-RW disc (floppies will also do but requires either a connection or a CD-R/RW disc).
* Internet connection, no PPPoE and PPPoA (I wont cover those)
Note: USB modems will not be covered!
* Switch or DSL/Cable Gateway/Router (use only the LAN ports)
* 2 network cables, one goes to the modem/outlet.
* Basic UNIX knowledge and TCP/IP knowledge

Computer requirements:

* Two supported NICs, link
Note: Realtek NICs are strongly recommended to be replaced due to performance issues (sucky hardware design). Netgear FA311 is for instance a great choice that's cheap and widely spread.
For now ALTQ is only supported by the following drivers: bfe, em, fxp, fwe, ixgb, lnc, de, re, rl, sis, ste, vge, vr and xl so if your NIC uses another driver you can't use ALTQ.
* A HDD that's 2Gb or larger (dual boot will not be covered)
* 32Mb RAM, (64Mb or more recommended)
* Perferably a CPU equal to a Pentium or better
* A monitor is needed for installation but you'll do fine without it after installation.
* A keyboard, a mouse wont be used at all

Installation:

1. Locate a mirror using this link that's close to you and grab the miniinst iso-file (and floppies if your computer can't boot off a cd).
The needed files can be found using the following paths on a mirror:

/pub/FreeBSD/releases/i386/5.3-RELEASE/floppies/boot.flp - Boot floppy #1
/pub/FreeBSD/releases/i386/5.3-RELEASE/floppies/kern1.flp - Boot floppy #2
/pub/FreeBSD/releases/i386/5.3-RELEASE/floppies/kern2.flp - Boot floppy #3
/pub/FreeBSD/releases/i386/5.3-RELEASE/tools/fdimage.exe - Writing utility for floppy images
/pub/FreeBSD/ISO-IMAGES-i386/5.3/5.3-RELEASE-i386-miniinst.iso - Installation CD

2. Start the installation by booting up using either the floppies or installation disc. For more information regarding installation refer to chapter 2 in the handbook.

2.1 You will now be prompted if you want to use ACPI or not (along with other boot options which arent of any use right now) and since it's poorly implented into BIOSes and old computers doesn't supported at all it's better to go with option 2 which disables it.
Note: If you have a fairly recent mainboard (Slot 1, Slot A or newer) you can give it a go, if you experience strange errors such as watchdog timeout and lockups restart the installation and disable ACPI.

2.2 Once the installer has booted up it'll ask what type of installation you want to run and in this case standard installation is suitable.

2.3 When fdisk appears delete all existing partitions (if any) and create one that uses the whole drive for FreeBSD. Don't forget to set it bootable before quiting fdisk.

2.4 Select standard MBR (Master Boot Record) when prompted.

2.5 Time to create slices, if you have a small drive (2-3Gb) make a swap slice that's 128Mb and assign the rest of the remaining space to / (filesystem). This isn't exactly ideal but since it's a bit cramped you really can't do anything about it. If you have a larger drive it's recommended to make a few more slices. Swap should be about two times as large as amout of installed RAM.
/ 128M
/var 256-512M
/usr remaining space
Refer to the handbook for more information, chapter 2.5.5

2.6 We wont run X (graphical GUI) and neither do we need the source since we'll grab newer version later on so go with a plain user installation with binares and docs only (option 8).

2.7 Same goes with ports collection, we'll also grab it later to get the newest collection available.

2.8 Installation media, if you used the floppies and didn't make a cd go with FTP and select a mirror near you otherwise select the CD since it's faster and all you need is already on it.

2.8.1 If you selected FTP you'll be promted to setup a network interface and it's pretty straight forward. Most have no IPv6 and unless you have a static IP address your connection is using DHCP. Once your ISP's DHCP server is detected the installer will ask you to verify the settings or input settings manually if you have a static IP address.

2.9 Confirm that you know what you're doing otherwise the installer wont continue.

2.10 Once binaries and docs are installed you are now asked to setup a Network Interface unless you selected FTP as installation source and now it's a good time to do that if you haven't. Don't worry about the second NIC, well set it up afterwards.

2.11 Since the installer doesn't have the ability to read minds it'll ask what you want to run and here's a recommendation (based on my preferences) what you should answer. You can change it afterwards if you don't agree anyways.

Do you want this machine to function as a network gateway? - Yes
It'll ask if you want to enable SSH (I forgot to write down the question) and I highly recommend you to do so.
Do you want to configure inetd and the network services that it provides? - Yes
Do you want to have anonymous FTP access to this machine? - No
Do you want to configure this machine as an NFS server? - No
Do you want to configure this machine as an NFS client? - No

2.12 Setup keymap and keyboard layout.
The majority of users will be fine using IBM 850 (option 3) and using a local keyboard layout.

2.13 Set what time zone you're in and how it's set.

2.14 Some more questions regarding software and hardware.
Would you like to enable Linux binary compatibility? - No (You wont need it and if it's needed FreeBSD is going to install it for you)
Is there are PS/2, serial or bus mouse connected? (forgot to write down the exact question again) - No
ACPI was disabled during boot, would you like to disable permanently? (See previous comment) - Yes
The FreeBSD package collection is a collection of hundreds of ready-to-run applications, from text editors to games to WEB servers and more. Would you like to browse the collection now? - No

2.15 Would you like to add any initial user accounts to the system? Adding at least one account for yourself at this stage is suggested since working as the "root" user is dangerous (it is easy to do things which will make the entire system unusable). - Yes
Fill in Login ID, Password, Full Name and set member groups to wheel.

2.16 Set root (admin) password, as with everything else I'd suggest that you set a hard password and not something obvious like the name of your pet.

2.17 Visit the general configuration menu for a chance to set any last options? - No

2.18 - Exit the installation
Congrats, you've now installed a fully fledged version of FreeBSD. =)

Download source code and ports

0 komentar:

Posting Komentar