FreeBSD 4.3-RELEASE based PC Router Installation and Configuration

Please note that the T1 driver is not yet available. This page is for those who want to setup a pc router, and who do not need a T1 connection. We hope to have the T1 drivers available soon.

Updated 10/09/01

These notes are for personal use only.

Please note that some of the links are no longer good.

Note: IRQ's for ISA bus devices (i.e. Niwot T1) must be reserved in the ROM-BIOS. Potentially, a conflict can exist between ISA bus devices that are not reserved and PCI bus devices during plug-and-play configuration. The ROM-BIOS can be configured by pressing DELETE, when prompted, during boot-up and following the instructions.






Please follow these instructions to build a PC for use as a router. Make sure the PC you use  is a FreeBSD compatible workstation. Refer to http://www.freebsd.org/handbook/install-hw.html for information about recommended/ compatible hardware.

Please back up your system.

Note: If you are upgrading a current router, please backup the contents of /usr/home, /etc directory, (If the router you are upgrading is a FreeBSD 3.4-STABLE with the KAME-v6 stack also backup the /usr/local/v6/etc and /usr/local/etc/rc.d/rc.local.sh) and the currently running kernel configuration file for later reference. You may also want to backup user home directories. When you have installed the new operating system. Please create a /usr/local/src directory, and FTP all of the backed up files into it. This will then be used as a reference when rebuilding the system.
Please do not install the /usr/home from the old router, untill you have installed the password file.

FTP the tar files and the kernel configuration file to another machine while you rebuild the current router.

If you are upgrading a current router (based on FreeBSD 2.x releases), please note that you may have to recompile most of your local applications. FreeBSD 3.x and 4.x releases use ELF rather than a.out format for executable binary files.
 

1. Selecting the installation method.

Install FreeBSD 4.3-RELEASE from the FreeBSD web site. The procedure we follow to install from FreeBSD.org are:
for your reference. You may also refer to the FreeBSD handbook for more information.

1. Once the OS has been installed, then create a local account. Also tar up the /usr/src and /usr/include. If you have a problem with setup later on, you can always untar these files.
cd /usr
tar -zcvf src.orig.tgz src
tar -zcvf include.orig.tgz include

2. Installing the ATM and T1 drivers with multcast.


ftp from oingo ~donkeynoc/router/atm/atm.43w.tgz to /usr/local/src
ftp from oingo ~donkeynoc/router/t1/i386.t1.fbsd43.tgz to /usr/local/src

tar up /sys in /usr/src

cd /usr/src
tar -zcvf sys.orig.tgz sys

next cd to the sys directrory.
cd sys
cp /usr/local/src/atm.43w/*.tgz .

Now untar the following tar files.

tar -zxvf netinet.atmfix.43.tgz
tar -zxvf pci.atmfix.43.tgz
tar -zxvf net.atmfix.43.tgz
tar -zxvf netnatm.atmfix.43.tgz

Next cd to conf and backup the following files
cd conf
cp /usr/src/sys/conf/files /usr/src/sys/conf/files.original
cp /usr/src/sys/conf/options /usr/src/sys/conf/options.original
cp /usr/src/sys/conf/files.i386 /usr/src/sys/conf/files.i386.original

Now copy all of the files that end in .pached from /usr/local/src/atm.43w
cp /usr/local/src/atm.43w/*.pached /usr/src/sys/conf
Now be sure that you have backed up the: files, files.i386, options.

Next:
mv files.pached files
mv options.pached options
Do not change the files.i386.pached. This is only changed if you are also putting in a T1.

Now you need to modify the kernel so:

cd /sys/i386/conf
run uname -a to see which kernel you are useing:
cp [kernel name] to [new kernel name]
cp GENERIC FBSD-4.3-ATM

vi FBSD-4.3-ATM
add to the bottom of the file:

# ATM
device en0 # FreeBSD PCI
device enp5 # To support 1 pvc on each ATM card
# (enp5 to support 6 PVCs each -
# the max allowed number for adaptec)
pseudo-device atm # FreeBSD only
options NATM # native atm add

options MROUTING #Multicast

Be sure that you have the bpf is set to 4:
pseudo-device bpf 4 #Berkeley packet filter

Now save and exit.

Next run config:

config FBSD-4.3-ATM
cd ../../compile/FBSD-4.3-ATM
make depend
make
make install

sync;sync;reboot

-------------------------


Installing the T1


cd /usr/src/sys/
tar -zcvf i386.orig.tgz i386
then

cp /usr/local/src/i386.t1.fbsd43.tgz .

next:

tar -zxvf i386.t1.fbsd43.tgz

now cd to conf
cd conf
mv files.i386.pached files.i386

next add to the kernel config file:
# Add T1 support: Use this instead for FreeBSD 4.x This is a test.
#the below line uses the irq and drq from donkeyepc2 nn0 should match the udel T1
device nn0 at isa? port 0x280 irq 11 drq 7
device nn2 at isa? port 0x290 irq 10 drq 6

you may need to change the irq settings in the bios - reserve them for the boards.

Now save and exit.

Next run config:

config [name of config file.]
cd ../../compile/[name of config file.]
make depend
make
make install

sync;sync;reboot
------------------------

3. Adding Multicast to the kernel.

This is if you did not add the Multicast with the ATM drivers earlyer.

cd /sys/i386/conf
# cp GENERIC  FBSD43

Use your favorite editor to add the following option to the kernel config file "FBSD43".


options MROUTING #Multicast

When you have done this; save the file and exit the editor. Now type:

# config FBSD43
# cd ../../compile/FBSD43
# make depend
# make
# make install



If you would like to rebooted the machine to be sure the new kernel is installed.
# sync; sync; reboot

4. Down loading binaries and configuring the system.

  Once the Operating System has been download; FTP the following software into the /usr/local/src directory (you may have to create this directory first):

  • MRTd v2.2.2a distribution Merit.edu
  • SNMP daemon for FreeBSD "ucd-snmp-4.2.1.tar.gz"

  • NTPd is now part of the distribution.
    MRTd can be found in /usr/ports/net/mrt.


  • 1. rc.conf

    Edit the /etc/rc.conf to add the IPv6 configuration. The default configuration for IPv6 is in /etc/defaults/rc.conf. If you wish to change any of the default configurations, please copy the strings, and add them to the /etc/rc.conf. Then make the changes to the /etc/rc.conf and not to the /etc/defaults/rc.conf. The /etc/rc.conf overrides the /etc/defaults/rc.conf.

    Customize /etc/rc.conf. Check against the old rc.conf file. Please note that starting from FreeBSD 3.0, /etc/rc.conf only specifies the changes to the default options which are in /etc/defaults/rc.conf file. Make sure it has the following options enabled:

    gateway_enable="YES"
    forward_sourceroute="NO"
    tcp_extensions="YES"
    In addition, the following option is needed for IPv6 support:
    ipv6_enable="YES"
    Also, configure the network interfaces and set the default router.

    2. rc.local.sh

    If you are upgrading an existing router, copy /etc/rc.local or the /etc/rc.local.sh that was backed up earlier to /usr/local/etc/rc.d/ directory. If the /usr/local/etc/rc.d dose not exist, please create it.
    If the rc.local is from an earler version of FreeBSD you will need to add .sh to the end of the file. Since FreeBSD-3.x the rc.local has been rc.local.sh, and has been located at /usr/local/etc/rc.d/rc.local.sh with a soft link back to the /etc/rc.local.sh.


    cp rc.local /usr/local/etc/rc.d/rc.local.sh


    (assuming you first ftp'ed and extracted the original rc.local [or rc.local.sh if your box/router was FreeBSD-3.x].)
    The /usr/local/etc/rc.d/rc.local.sh needs to be exicutable, so you will need to run the command:

    chmod 755 /usr/local/etc/rc.d/rc.local.sh


    or if you prefer:

    chmod +x /usr/local/etc/rc.d/rc.local.sh


    If you make changes to your rc.local or rc.local.sh, please keep a copy of the original file in /usr/local/src as a reference.

    3. resolv.conf

    Restore the resolv.conf from your backed up copy in the /etc. If this is a new setup add these lines to your /etc/resolv.conf:

    domain code-donkey.org
    nameserver xxx.xxx.xxx.xxx
    or
    domain "your domain"
    nameserver "your ip"

    4. Old configuration files.

    If are upgrading from an earler version of the operating system. The please restore the /etc/mrouted.conf, /etc/mrtd.conf, and /etc/XF86Config (if it exists) files from /usr/local/src.

    5.  Support for remote login.

    This is for the support of rdist:

    # echo 'helpmann.code-donkey.org root' >> /root/.rhosts
    # echo 'xxx.xxx.xxx.xxx helpmann.code-donkey.org' >> /etc/hosts

    6. User passwords accounts.

    If you want to restore user accounts, rather than request donkeytoc to rdist them, restore /etc/group and   /etc/master.passwd file to /etc directory, and

    # cat /usr/local/src/etc/master.passwd >> /etc/master.passwd
    # /usr/sbin/pwd_mkdb -p /etc/master.passwd


    Once you have done this, type vipw and edit out any duplicates that you find. Remember to keep the entries which came from this instalation. Remove the lines which are duplicates from the old master.passwd file. After useing "cat" to murge the master.passwd files, there will be copys of root, donkeynoc, bin, etc., so be sure to remove them. Once you have only one entrie for each account, re-run:
    # /usr/sbin/pwd_mkdb -p /etc/master.passwd

    After this, useing another window, login remotly, and su to root, just to be sure that everything worked well.

    7. Restore any user directories that were backed up earlier.

    # cd /usr
    # tar zxf home.tar.gz
    # ln -s /home /usr/home

    8. Installing the NTP.
    Note that the NTPd should come as a part of the basic install. Do a "which ntpd" if you are not sure. If it is not you will need to follow the following proceedure. If the original configuration files are available, copy them to the new /etc.
    download the NTPd source code from NTP

    # Put the sorce code into /usr/local/src
    cd /usr/local/src
    tar zxf ntp-xxx.tar.gz
    # cd ntp-xxx
    # ./configure
    # make check
    # make; make install
    Then copy files ntp.conf, ntp.keys and ntp.drift to /etc. If the files do not exist in the original /etc, then you can check either donkeypc, donkeyepc or udelpc's /etc files. Also you can reference NTP.

    9. Installing the SNMP.

    # cd /usr/local/src
    # ftp from oingo.code-donkey.org /usr/home/donkeynoc/router/fbsd4.3/ucd-snmp-4.2.1.tar.gz
    # tar zxf ucd-snmp-4.2.1.tar.gz
    # cd ucd-snmp-4.2.1
    # ./configure
    # make
    # make install
    or you may find it on the web Google. Look for "ucd-snmp-4.2.1.tar.gz

    10. Installing the MRTd.
    This is in /usr/ports/net/mrt
    If you need to compile it yourself the directions are below.

    # cd /usr/local/src
    # ftp from oingo.code-donkey.org /usr/home/donkeynoc/router/fbsd4.3/mrt-2.2.2a-src.tar.gz
    # tar zxf mrt-2.2.2a-src.tar.gz
    # cd mrt
    # ./make-sym-links
    # cd src.freebsd4.3
    # ./configure
    # make
    # make install
    or you may down load it from here Merit

    11. Installing the Java JDK.

    # cd /usr/ports/java/jdk
    # make
    # make install
    If you want to install from the source code:
    ftp from oingo.code-donkey.org /usr/home/donkeynoc/router/fbsd4.3/jdk1.1.8_ELF.V1999-11-9.tar.gz
    tar -zxvf jdk1.1.8_ELF.V1999-11-9.tar.gz
    cd jdk1.1.8
    ./configure
    make
    make install
    or you may down load it from here Google

    12. Installing the BIND9.


    BIND9 can be found in /usr/ports/net/BIND9
    cd /usr/ports/net/BIND9
    make
    make install

    If you want to install from the source code:
    cd /usr/local/src
    ftp from oingo.code-donkey.org /usr/home/donkeynoc/router/fbsd4.3/bind-9.1.1.tar.gz
    tar -zxvf bind-9.1.1.tar.gz
    cd to the bind-9.1.1
    ./configure
    make
    make install

    or you may down load it from here Google


    13. Installing the LSOF.



    LSOF can be found in /usr/ports/sysutils/lsof
    cd /usr/ports/sysutils/lsof
    make
    make install
    or you may down load it from here



    14. Installing the Linux_base.



    cd /usr/ports/emulators/linux_base
    make
    make install

    15. Installing the XFree86.



    cd /usr/ports/x11/XFree86
    make
    make install

    16. Please remember to:


    Disable telnet and tftp in services and inetd.conf and services file.

    17. Installing Mbone tools.


    You can also install the mbone tools from UCL if you will be using this machine for MBone conferencing.

    18. Reboot your system.


    If you have not rebooted the machine yet, then now is the time:
    # sync; sync; reboot




    Please send a note to aakesson@code-donkey.org


    Alec Aakesson 10/09/01