BBS水木清华站∶精华区
发信人: life (o)寻求师傅中(o), 信区: Linux
标 题: [技术]Linux as Router (1)
发信站: BBS 水木清华站 (Sun Nov 16 13:07:41 1997)
Documentation
This is certainly not complete, just enough to get you going with the first
release. This will eventually evolve into a FAQ and some actual docs...
How it works:
LRP is based upon media insestive scheme. As long as it can boot and be
mounted by Linux, and if it can hold enough, use can use it. 1.44MB Floppies,
ZIPs, LS-120's, flash ram cards, hardives, etc will all work.
Under normal circumstances the boot media is not used after boot. The initrd
functions of the Linux kernel are used to create a ramdrive (/dev/ram0) at boot
time, and a raw root filesystem is copied into this drive by the boot loader.
(IE LILO or syslinux) By a raw image, we mean on the creation system a ramdrive
was initialize with Minix (or something else) a small root was copied to it, and
then the ramdrive was read with dd (or cat) into a binary image file, that in
turn is compressed with gzip.
Having router run it's root out of ram is ideal. It's is fast. It is solid
state. It is only a reboot away from restoring the entire root should a
cracker cause havok. But as you can see making permanent modifications
to the router usally required making a new root image with a Linux system, as it
is very difficult to remake the image on the fly right within the router.
This problem has been solved the best it can be without adding new features to
the Linux kernel. We still use a small raw image file, but this file contains
nothing more then enough commands to mount the boot device and then extract
tar-gz files to the ramdisk. Now changes can be made easily and increntally
directly by the router, giving us a completely self contained unit, requiring a
Linux box for nothing but the preperation of the initial boot media.
(And nothing but MS-DOS if you use syslinux and have pre-made files handy)
What is what:
initrd-image - contains a minature root and loader scripts that are made into
a raw compressed image file. (initrd.rgz)
root-tgz - contains the actual root fs. It is broken up into one or more .tgz files.
This allows incremental updates and additions without having to back-up the entire
root. Currently the default are two files root.tgz and etc.tgz.
root.map - this file is placed on the root of the boot medium. It contains
the files that inird-image should extract. It can be changed to allow more or
different root components without having to change the initrd-image.
mkrouter-disk et al - various scripts and files used to make the image,
.tgz's, and final disk from scratch.
So how do I make a router disk?
Most people will be using a 1.44mb disk. The best boot loader for this is
Syslinux by Peter Anvin. (See the floppy page) Once you have a disc loaded
up with syslinux, and you have all the router files extracted:
./mkrouter-disk -f -m -c
That should do it. You now have a disk ready to go. Boot it, login, edit the
config files, and you are running.
What can I do with this?
The base router root contains various essential system and network commands,
full init, etc, etc. What it does not have are things like ppp, or isdn utils.
These however can simpily be dropped in, and very soon we will make additional
.tgz modules that can be loaded right with the root. As an example I currently
use this version on on LS-120 in a terminal server that contains ppp and
portslave (radius client). They fall right in place.
What needs to be done?
This is just the minimal root; our starting point. Now that we have something
that can remain self contained, work will begin on slick web and snmp based
configuration utilites. Pretty soon you won't even need to have a console to
set it up. ( Don't buy stock in cisco : ) )
How much crack did you smoke before you made this init system?
Ahh.. a slackware user. The LRP's work is based on Debian (sysvinit) and in
fact the init has changed VERY little from a stock Debian install. If you
use Debian you will be right at home. The current work is based on Debian
1.3.1.? The only considerable things that did not come out of standard Debian
are a minimal compile of bash 1.14 (for size reasons) and busybox (from the
Debian rescue disk. It provide commands like mount and ls, in a single small
executable.) One other note, libncurces as been stripped for size. Take this
into consideration if you add any additional ncurses apps. libc5 is still
complete AT THIS POINT. (hint: don't plan on it in the future)
Here is some more information about booting 'Higher' Density formatted disks
with Linux.
If you're interested in helping out, join the mailing list and post what you
would like to do. We certainly could use more people!
LRP Mailing list:
You can view the archive of all previous messages that have been posted.
To join or leave the Linux-router Mailing List, send an email message to:
To: linux-router-request@psychosis.com
Put subscribe or unsubscribe for the subject.
To post a message for others to read simply send an email message to:
To: linux-router@psychosis.com
--
面对未知的世界因恐惧而发抖
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 166.111.26.146]
BBS水木清华站∶精华区