home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / firewall < prev    next >
Encoding:
Text File  |  1996-07-11  |  29.3 KB  |  720 lines

  1.   Firewalling and Proxy Server HOWTO
  2.   David Rudder, drig@execpc.com
  3.   v0.2, 17 July 1995
  4.  
  5.   This document is designed to teach the basics of setting up a firewall
  6.   on a Linux based PC.  Also covered is the installation and use of
  7.   Proxy Servers to allow greater access to the Internet from behind a
  8.   firewall.
  9.  
  10.   1.  Introduction
  11.  
  12.   Firewalls have gained great fame recently as the ultimate in Internet
  13.   Security.  Like most things that gain fame, with that fame has come
  14.   misunderstanding.  This HOWTO will go over the basics of what a
  15.   firewall is, how to set one up, what proxy servers are, how to set up
  16.   proxy servers, and the applications of this technology outside of the
  17.   security realm.
  18.  
  19.   1.1.  Feedback
  20.  
  21.   Any feedback is very welcome.  I am particularly looking for feedback
  22.   from people who use Macintosh computers, as the information I have on
  23.   them is scanty.  PLEASE PLEASE PLEASE REPORT ANY INACCURACIES IN THIS
  24.   PAPER!!!  I am human, and prone to making mistakes.  If you find any,
  25.   fixing them is of my highest interest.  I will try to answer all e-
  26.   mail, but I am busy, so don't get insulted if I don't.
  27.  
  28.   My email address is drig@execpc.com.
  29.  
  30.   1.2.  Disclaimer
  31.  
  32.   This document is meant as an introduction to how Firewalls and Proxy
  33.   Servers work.  I am not, not do I pretend to be, a security expert.  I
  34.   am just some guy who has read to much and likes computers more than
  35.   people.  I AM NOT RESPONSIBLE FOR ANY DAMAGES INCURRED DUE TO ACTIONS
  36.   TAKEN BASED ON THIS DOCUMENT.   Please, I am writing this to help get
  37.   people acquainted with this subject, and I am not ready to stake my
  38.   life on the accuracy of what is in here.
  39.  
  40.   1.3.  Copyright
  41.  
  42.   Unless otherwise stated, Linux HOWTO documents are copyrighted by
  43.   their respective authors. Linux HOWTO documents may be reproduced and
  44.   distributed in whole or in part, in any medium physical or electronic,
  45.   as long as this copyright notice is retained on all copies. Commercial
  46.   redistribution is allowed and encouraged; however, the author would
  47.   like to be notified of any such distributions.
  48.  
  49.   All translations, derivative works, or aggregate works incorporating
  50.   any Linux HOWTO documents must be covered under this copyright notice.
  51.   That is, you may not produce a derivative work from a HOWTO and impose
  52.   additional restrictions on its distribution. Exceptions to these rules
  53.   may be granted under certain conditions; please contact the Linux
  54.   HOWTO coordinator at the address given below.
  55.  
  56.   In short, we wish to promote dissemination of this information through
  57.   as many channels as possible. However, we do wish to retain copyright
  58.   on the HOWTO documents, and would like to be notified of any plans to
  59.   redistribute the HOWTOs.
  60.  
  61.   If you have any questions, please contact David Rudder
  62.   <drig@execpc.com>.
  63.   1.4.  My Reasons for Writing This
  64.  
  65.   There were a lot of discussions on comp.os.linux.* over the past year
  66.   or so asking for Firewalling help.  It seemed as if no one was going
  67.   to answer these.  I assumed that the reason was that no one knew how.
  68.   So, I set aside some time to play with Firewalling and teach myself
  69.   it.  This document is in response to those requests.
  70.  
  71.   1.5.  TODO
  72.  
  73.   ╖  Learn how to do this on a Macintosh
  74.  
  75.   ╖  Learn different Windows TCP/IP packages
  76.  
  77.   ╖  Find a good UDP proxy server that works with Linux
  78.  
  79.   1.6.  Further Readings
  80.  
  81.   ╖  The Documentation for the TIS Firewall Toolkit
  82.  
  83.   ╖  The NET-2 HOWTO
  84.  
  85.   ╖  The PPP HOWTO
  86.  
  87.   ╖  The Ethernet HOWTO
  88.  
  89.   ╖  The Multiple Ethernet Mini HOWTO
  90.  
  91.   ╖  Networking with Linux
  92.  
  93.   ╖  TCP/IP Network Administrator's Guide by O'Reilly and Associates
  94.  
  95.   The Firewall Toolkit by TIS has a collection of the best documentation
  96.   I have found on firewalls and related constructs.  For more on the
  97.   Firewall Toolkit, look for the section Firewalling Software.
  98.  
  99.   2.  Understanding Firewalls
  100.  
  101.   A Firewall is a term used for a part of a car.  In cars, Firewalls are
  102.   physical objects that separate the engine block from the passenger
  103.   compartment.  They are meant to protect the passenger in case the car
  104.   explodes.
  105.  
  106.   A Firewall in computers is a logical device that protects a private
  107.   network from the public part.  How they work is:
  108.  
  109.   1. You take a computer that has routing capabilities (such as a linux
  110.      box)
  111.  
  112.   2. Put in 2 interfaces (ie Serial ports, Ethernet, Token Ring, etc)
  113.  
  114.   3. Turn off IP forwarding
  115.  
  116.   4. Connect the internet to one interface
  117.  
  118.   5. Connect the protected network to the other interface
  119.  
  120.   Now, you have two distinct networks, which share a computer.  The
  121.   firewall computer, from now on named "firewall", can reach both the
  122.   protected network and the internet.  The protected network can not
  123.   reach the internet, and the internet can not reach the protected
  124.   network.
  125.  
  126.   For someone to reach the internet from inside the protected network,
  127.   one must telnet to firewall, and use the internet from there.
  128.   Accordingly, in order to get into the protected network, one must go
  129.   through the firewall first.
  130.  
  131.   This provides excellent security against attacks from the internet.
  132.   If someone wants to make a concerted attack against the protected
  133.   network, they must go through the firewall first, making it a two-
  134.   step, and thus much harder, attack.  If someone wants to attack the
  135.   protected network via a more common method, such as mail bombing, or
  136.   the infamous "Internet Worm", they will not be able to reach the
  137.   protected network.  This makes for excellent protection.
  138.  
  139.   2.1.  Drawbacks with Firewalls
  140.  
  141.   The biggest problem with firewalls is that they greatly inhibit the
  142.   access to the internet from the inside.  Basically, they reduce the
  143.   usage of the internet to that which one would have via a dial-up shell
  144.   account.  Having to login to firewall and then do all internet access
  145.   is a severe restriction.  Programs like Netscape, which require a
  146.   direct internet connection, will not work from behind a firewall.  The
  147.   answer to these problems is having a Proxy Server.
  148.  
  149.   2.2.  Proxy Servers
  150.  
  151.   Proxy servers are constructs that allow direct internet access from
  152.   behind a firewall.  How they work is they open a socket on the server,
  153.   and allow communication via that socket to the internet.  For example,
  154.   if my computer, drig is inside the protected network, and I want to
  155.   browse the Web using Netscape, I would set up a proxy server on
  156.   firewall.  The proxy server would be configured to allow requests from
  157.   my computer, trying for port 80, to connect to its port 1080, and it
  158.   would then redirect all requests to the proper places.
  159.  
  160.   Anyone that has used TIA or TERM has seen this concept before.  Using
  161.   these two programs, you can redirect a port.  A friend had TIA setup
  162.   to allow anyone using 192.251.139.21 port 4024 to connect to his Web
  163.   Server.  The proxy server works like this, but backwards.  To connect
  164.   to anyone else's port 80, you must use port 1080 (or whichever port
  165.   you set it for).
  166.  
  167.   The great thing about proxy servers is that they are completely
  168.   secure, when configured correctly.  They will not allow someone in
  169.   through them.
  170.  
  171.   3.  Setting This All Up
  172.  
  173.   3.1.  Hardware requirements
  174.  
  175.   For our example, the computer is a 486-DX66, 8 megs of memory, 500
  176.   megs Linux partition, with a PPP connection to it internet provider
  177.   over a 14.4 modem.  This setup is your basic Linux box.  To make it a
  178.   firewall, we add one NE2000 Ethernet card.  It is then connected to 3
  179.   PC's running Windows 3.1 with Trumpet Winsock and 2 Suns running SunOS
  180.   4.1.  This setup was chosen because it is a fairly common and they are
  181.   both platforms that I am familiar with.  I imagine much of the same
  182.   stuff that I am talking about here is doable with Macs, but since I
  183.   don't use Macs frequently enough, I don't really know.
  184.  
  185.   3.2.  Setting up the Software
  186.  
  187.   So, you have one Linux box connected to the net via a 14.4 PPP line.
  188.   You then have a Ethernet network connected to the Linux box and all
  189.   the other computers.  First, you must recompile the Linux kernel with
  190.   the appropriate options.  At this point, I would look at the Kernel
  191.   HOWTO, the Ethernet HOWTO, and the NET-2 HOWTO.  Then, do a "make
  192.   config":
  193.  
  194.   1. Turn on Networking Support
  195.  
  196.   2. Turn on TCP/IP Networking
  197.  
  198.   3. Turn off IP Forwarding (CONFIG_IP_FORWARD).
  199.  
  200.   4. Turn on IP Firewalling
  201.  
  202.   5. Probably turn on IP accounting.  Seems prudent since we are setting
  203.      up a security measure
  204.  
  205.   6. Turn on Networking Device Support
  206.  
  207.   7. We turn on PPP and Ethernet support, but that depends on your
  208.      interfaces
  209.  
  210.   Then, we recompile, reinstall the kernel and reboot.  The interfaces
  211.   should show up in the boot-up sequence, and we should be fine.  If
  212.   not, go over the other HOWTOs again until it is working.
  213.  
  214.   3.3.  Configuring the Network Addresses
  215.  
  216.   This is the real interesting part.  Since we do not want the internet
  217.   to have access, we do not need to use real addresses.  One good C
  218.   Class to use is 192.168.2.xxx, which was set aside as a dummy test
  219.   domain.  Thus, no one uses it, and it will not conflict with any
  220.   requests for the outside.  So, in this configuration, only one real IP
  221.   address is needed. The others are free for the taking and will not
  222.   affect the network at all.
  223.  
  224.   Assign the real IP to the serial port used for the PPP.  Assign
  225.   192.168.2.1 to the Ethernet card on firewall.  Assign all the other
  226.   machines in the protected network some number in that domain.
  227.  
  228.   3.4.  Testing it out
  229.  
  230.   First, try to ping the internet from firewall.  I used to use
  231.   nic.ddn.mil as my test point.  It's still a good test, but has proven
  232.   to be less reliable than I had hoped.  If it doesn't work at first,
  233.   try pinging a couple other places that are not connected to your LAN.
  234.   If this doesn't work, then your PPP is incorrectly setup.  Reread the
  235.   Net-2 HOWTO, and try again.
  236.  
  237.   Now, try pinging between hosts within the protected network.  All the
  238.   computers should be able to ping each other.  If not, go over the
  239.   NET-2 HOWTO again and work on the network some more.
  240.  
  241.   Then, every machine in the protected network should be able to ping
  242.   firewall.  If not, go back again.  Remember, they should be able to
  243.   ping 192.168.2.1, not the PPP address.
  244.  
  245.   Then, try to ping the PPP address of firewall from inside the
  246.   protected network.  If you can, then you have not turned off IP
  247.   Forwarding and you will have to recompile the kernel.  Having assigned
  248.   the protected network the 192.168.2.1 domain means that no packets
  249.   will be routed to this network anyway, but it is safer to have IP
  250.   Forwarding turned off anyway.  This leaves the control in your hands,
  251.   not in the hands of your PPP provider.
  252.  
  253.   Finally, ping each machine within the protected network from firewall.
  254.   By this time, there should be no problems.
  255.  
  256.   Now, you have your basic firewall setup.
  257.  
  258.   3.5.  Securing the Firewall
  259.  
  260.   The firewall is no good if it is left wide open to attacks.  First,
  261.   look at /etc/inetd.conf.  This file is what is called a "super
  262.   server".  It runs a bunch of the server daemons as they are requested.
  263.   Examples are:
  264.  
  265.   ╖  Telnet
  266.  
  267.   ╖  Talk
  268.  
  269.   ╖  FTP
  270.  
  271.   ╖  Daytime
  272.  
  273.   Turn off everything that is not needed.  Definitely turn off netstat,
  274.   systat, tftp, bootp, and finger.  You might also want to turn off
  275.   telnet, and only allow rlogin, or vica-versa.  To turn a service off,
  276.   merely put a # in front of it.  Then, send a SIG-HUP to the process by
  277.   typing kill -HUP <pid>, where pid is the process number of inetd.
  278.   This will make inetd re-read its configuration file (inetd.conf) and
  279.   restart.  Test it out by telneting to port 15 on firewall, the netstat
  280.   port.  If you get an output of netstat, you have not restarted it
  281.   correctly.
  282.  
  283.   4.  Firewalling Software
  284.  
  285.   4.1.  Available packages
  286.  
  287.   Strict firewalling does not need any software except the Linux kernel
  288.   and the base networking packages (inetd, telnetd and telnet, ftpd and
  289.   ftp).  But, a firewall like this is extremely restrictive and not very
  290.   useful.
  291.  
  292.   So, software packages have been made to make a firewall more useful.
  293.   The one that I would like to examine in most detail is a package
  294.   called "socks" which is a proxy server.  But, there are two other
  295.   programs that you might want to keep in mind.  I would like to give
  296.   you a short review of them now.
  297.  
  298.   4.2.  The TIS Firewall Toolkit
  299.  
  300.   TIS has put out a collection of programs designed to facilitate
  301.   firewalling.  The programs do basically the same thing as the Socks
  302.   package, but with a different design strategy.  Where Socks has one
  303.   program that covers all Internet transactions, TIS has provided one
  304.   program for each utility that wishes to use the firewall.
  305.  
  306.   To better contrast the two, lets take the example of World Wide Web
  307.   and Telnet access.  With Socks, you set up one configuration file and
  308.   one daemon.  Through this file and daemon, both Telnet and WWW are
  309.   enabled, as well as any other service that you have not disabled.
  310.  
  311.   With the TIS toolkit, you set up one daemon for each WWW and Telnet,
  312.   as well as configuration files for each.  After you have done this,
  313.   other Internet access is still prohibited until explicitly set up.  If
  314.   a daemon for a specific utility has not been provided (like talk),
  315.   there is a "plug-in" daemon, but it is neither as flexible, nor as
  316.   easy to set up, as the other tools.
  317.  
  318.   This might seem a minor difference, but it makes a major difference.
  319.   Socks allows you to be sloppy.  With a poorly set up Socks server,
  320.   someone from the inside could gain more access to the Internet than
  321.   was originally intended.  With the TIS toolkit, the people on the
  322.   inside have only the access the system administrator wants them to
  323.   have.
  324.  
  325.   Socks is easier to set up, easier to compile and allows for greater
  326.   flexibility.  The TIS toolkit is more secure if you want to regulate
  327.   the users inside the protected network.  Both provide absolute
  328.   protection from the outside.
  329.  
  330.   4.3.  TCP Wrapper
  331.  
  332.   TCP wrapper is not a firewalling utility, but it allows for many of
  333.   the same effects.  Using TCP wrapper, you can control who has access
  334.   to your machine and to what services as well as keep logs of the
  335.   connections.  It does basic forgery detection also.
  336.  
  337.   TCP wrapper is not covered more extensively here because of a couple
  338.   of reasons.
  339.  
  340.   ╖  It is not a real firewall.
  341.  
  342.   ╖  To use it, you have to be connected to the Internet, thus you have
  343.      to have an IP address.
  344.  
  345.   ╖  It only controls the machine it is installed on, and is thus not
  346.      good for a network.  Firewalls can protect every machine of every
  347.      architecture.  TCP wrapper won't work on Macintoshes and MS Windows
  348.      machines.
  349.  
  350.   4.4.  Ipfw and Ipfw Admin
  351.  
  352.   5.  The Proxy Server
  353.  
  354.   5.1.  Setting up the Proxy Server
  355.  
  356.   The proxy server requires additional software.  You can get this
  357.   software from
  358.   ftp://sunsite.unc.edu/pub/Linux/system/Network/misc/socks-linux-
  359.   src.tgz.  There is also an example config file in that directory
  360.   called "socks-conf".  Uncompress and untar the files into a directory
  361.   on your system, and follow the instructions on how to make it.  I had
  362.   a couple problems in making it.  Make sure that the Makefiles are
  363.   correct.  Some are, some are not.
  364.  
  365.   One important thing to note is that the proxy server needs to be added
  366.   to /etc/inetd.conf.  You must add a line:
  367.  
  368.   socks   stream  tcp     nowait  nobody  /usr/local/etc/sockd    sockd
  369.  
  370.   to tell the server to run when requested.
  371.  
  372.   5.2.  Configuring the Proxy Server
  373.  
  374.   The socks program needs two separate configuration files.  One to tell
  375.   the access allowed, and one to route the requests to the appropriate
  376.   proxy server.  The access file should be housed on the server.  The
  377.   routing file should be housed on every Un*x machine.  The DOS and,
  378.   presumably, Macintosh computers will do their own routing.
  379.  
  380.   5.2.1.  The Access File
  381.  
  382.   With socks4.2 Beta, the access file is called "sockd.conf".  It should
  383.   contain 2 lines, a permit and a deny line.   Each line will have three
  384.   entries:
  385.  
  386.   ╖  The Identifier (permit/deny)
  387.  
  388.   ╖  The IP address
  389.  
  390.   ╖  The address modifier
  391.  
  392.   The identifier is either permit or deny.  You should have both a
  393.   permit and a deny line.
  394.  
  395.   The IP address holds a four byte address in typical IP dot notation.
  396.   Ie 192.168.2.0.
  397.  
  398.   The address modifier is also a typical IP address four byte number.
  399.   It works like a netmask.  Envision this number to be 32 bits (1s or
  400.   0s).  If the bit is a 1, the corresponding bit of the address that it
  401.   is checking must match the corresponding bit in the IP address field.
  402.   For instance, if the line is:
  403.  
  404.   permit 192.168.2.23 255.255.255.255
  405.  
  406.   then, it will permit only the IP address that matches every bit in
  407.   192.168.2.23, eg, only 192.168.2.3.  The line:
  408.  
  409.   permit 192.168.2.0 255.255.255.0
  410.  
  411.   will permit every number within group 192.168.2.0 through
  412.   192.168.2.255, the whole C Class domain.   One should not have the
  413.   line:
  414.  
  415.   permit 192.168.2.0 0.0.0.0
  416.  
  417.   as this will permit every address, regardless.
  418.  
  419.   So, first permit every address you want to permit, and then deny the
  420.   rest.  To allow everyone in the domain 192.168.2.xxx, the lines:
  421.  
  422.   permit 192.168.2.0 255.255.255.0
  423.  
  424.   deny 0.0.0.0 0.0.0.0
  425.  
  426.   will work nicely.  Notice the first "0.0.0.0" in the deny line.  With
  427.   a modifier of 0.0.0.0, the IP address field does not matter.  All 0's
  428.   is the norm because it is easy to type.
  429.  
  430.   More than one entry of each is allowed.
  431.  
  432.   Specific users can also be granted or denied access.  This is done via
  433.   ident authentication.  Not all systems support ident, including
  434.   Trumpet Winsock, so I will not go into it here.  The documentation
  435.   with socks is quite adequate on this subject.
  436.  
  437.   5.2.2.  The Routing File
  438.  
  439.   The routing file in socks is poorly named "socks.conf".  I say "poorly
  440.   named" because it is so close to the name of the access file that it
  441.   is easy to get the two confused.
  442.  
  443.   The routing file is there to tell the socks clients when to use socks
  444.   and when not to.  For instance, in our network, 192.168.2.3 will not
  445.   need to use socks to talk with 192.168.2.1, firewall.  It has a direct
  446.   connection in via Ethernet.  It defines 127.0.0.1, the loopback,
  447.   automatically.  Of course you do not need socks to talk to yourself.
  448.   There are three entries:
  449.  
  450.   ╖  deny
  451.  
  452.   ╖  direct
  453.  
  454.   ╖  sockd
  455.  
  456.   Deny tells socks when to reject a request.  This entry has the same
  457.   three fields as in sockd.conf, identifier, address and modifier.
  458.   Generally, since this is also handled by sockd.conf, the access file,
  459.   the modifier field is set to 0.0.0.0.  If you want to preclude
  460.   yourself from calling any place, you can do it here.
  461.  
  462.   The direct entry tells which addresses to not use socks for.  These
  463.   are all the addresses that can be reached without the proxy server.
  464.   Again we have the three fields, identifier, address and modifier.  Our
  465.   example would have
  466.  
  467.   direct 192.168.2.0 255.255.255.0
  468.  
  469.   Thus going direct for any on our protected network.
  470.  
  471.   The sockd entry tells the computer which host has the socks server
  472.   daemon on it.  The syntax is:
  473.  
  474.   sockd @=<serverlist> <IP address> <modifier>
  475.  
  476.   Notice the @= entry.  This allows you to set the IP addresses of a
  477.   list of proxy servers.  In our example, we only use one proxy server.
  478.   But, you can have many to allow a greater load and for redundancy in
  479.   case of failure.
  480.  
  481.   The IP address and modifier fields work just like in the other
  482.   examples.  You specify which addresses go where through these.
  483.   5.2.3.  DNS from behind a Firewall
  484.  
  485.   Setting up Domain Name service from behind a firewall is a relatively
  486.   simple task.  You need merely to set up the DNS on the firewalling
  487.   machine.  Then, set each machine behind the firewall to use this DNS.
  488.  
  489.   5.3.  Working With a Proxy Server
  490.  
  491.   5.3.1.  Unix
  492.  
  493.   To have your applications work with the proxy server, they need to be
  494.   "sockified".  You will need two different telnets, one for direct
  495.   communication, one for communication via the proxy server.  Socks
  496.   comes with instructions on how to sockify a program, as well as a
  497.   couple pre-sockified programs.  If you use the sockified version to go
  498.   somewhere direct, socks will automatically switch over to the direct
  499.   version for you.  Because of this, we want to rename all the programs
  500.   on our protected network and replace them with the sockified programs.
  501.   "Finger" becomes "finger.orig", "telnet" becomes "telnet.orig", etc.
  502.   You must tell socks about each of these via the include/socks.h file.
  503.  
  504.   Certain programs will handle routing and sockifying itself.  Netscape
  505.   is one of these.  You can use a proxy server under Netscape by
  506.   entering the server's address (192.168.2.1 in our case) in the SOCKs
  507.   field under Proxies.  Each application will need at least a little
  508.   messing with, regardless of how it handles a proxy server.
  509.  
  510.   5.3.2.  MS Windows with Trumpet Winsock
  511.  
  512.   Trumpet Winsock comes with built in proxy server capabilities.  In the
  513.   "setup" menu, enter the IP address of the server, and the addresses of
  514.   all the computers reachable directly.  Trumpet will then handle all
  515.   outgoing packets.
  516.  
  517.   5.4.  Getting the Proxy Server to work with UDP Packets
  518.  
  519.   The socks package works only with TCP packets, not UDP.  This makes it
  520.   quite a bit less useful.  Many useful programs, such as talk and
  521.   Archie, use UDP.  There is a package designed to be used as a proxy
  522.   server for UDP packets called UDPrelay, by Tom Fitzgerald
  523.   <fitz@wang.com>.  Unfortunately, at the time of this writing, it is
  524.   not compatible with Linux.
  525.  
  526.   5.5.  Drawbacks with Proxy Servers
  527.  
  528.   The proxy server is, above all, a security device.  Using it to
  529.   increase internet access with limited IP addresses will have many
  530.   drawbacks.  A proxy server will allow greater access from inside the
  531.   protected network to the outside, but will keep the inside completely
  532.   unaccessible from the outside.  This means no servers, talk or Archie
  533.   connections, or direct mailing to the inside computers.  These
  534.   drawbacks might seem slight, but think of it this way:
  535.  
  536.   ╖  You have left a report you are doing on your computer inside a
  537.      firewall protected network.  You are at home, and decide that you
  538.      would like to go over it.  You can not.  You can not reach your
  539.      computer because it is behind the firewall.  You try to log into
  540.      firewall first, but since everyone has proxy server access, no one
  541.      has set up an account for you on it.
  542.  
  543.   ╖  Your daughter goes to college.  You want to email her.  You have
  544.      some private things to talk about, and would rather have your mail
  545.      sent directly to your machine.  You trust your systems
  546.      administrator completely, but still, this is private mail.
  547.  
  548.   ╖  The inability to use UDP packets represents a big drawback with the
  549.      proxy servers.  I imagine UDP capabilities will be coming shortly.
  550.  
  551.   FTP causes another problem with a proxy server.  When geting or doing
  552.   an ls, the FTP server opens a socket on the client machine and sends
  553.   the information through it.  A proxy server will not allow this, so
  554.   FTP doesn't particularly work.
  555.  
  556.   And, proxy servers run slow.  Because of the greater overhead, almost
  557.   any other means of getting this access will be faster.
  558.  
  559.   Basically, if you have the IP addresses, and you are not worried about
  560.   security, do not use a firewall and/or proxy servers.  If you do not
  561.   have the IP addresses, but you are also not worried about security,
  562.   you might also want to look into using an IP emulator, like Term,
  563.   Slirp or TIA.  Term is available from ftp://sunsite.unc.edu, Slirp is
  564.   available from ftp://blitzen.canberra.edu.au/pub/slirp, and TIA is
  565.   available from marketplace.com.  These packages will run faster, allow
  566.   better connections, and provide a greater level of access to the
  567.   inside network from the internet.  Proxy servers are good for those
  568.   networks which have a lot of hosts that will want to connect to the
  569.   internet on the fly, with one setup and little work after that.
  570.  
  571.   6.  Advanced Configurations
  572.  
  573.   There is one configuration I would like to go over before wrapping
  574.   this document up.  The one I have just outlined will probably suffice
  575.   for most people.  However, I think the next outline will show a more
  576.   advanced configuration that can clear up some questions.  If you have
  577.   questions beyond what I have just covered, or are just interested in
  578.   the versatility of proxy servers and firewalls, read on.
  579.  
  580.   6.1.  A large network with emphasis on security
  581.  
  582.   Say, for instance, you are the leader of the Milwaukee 23rd Discordian
  583.   Cabal.  You wish to network your site.  You have 50 computers and a
  584.   subnet of 32 (5 bits) IP numbers.  You have various levels of access.
  585.   You tell your disciples different things according to each level.
  586.   Obviously, you would want to protect certain parts of the network from
  587.   the disciples that are not in that level.
  588.  
  589.   Disclaimer: I am not a member of the Discordians.  I do not know their
  590.   terminology, nor do I really care.  I am using them as an example
  591.   only.  Please send all flames to
  592.  
  593.   The levels are:
  594.  
  595.   1. The external level.  This is the level that gets shown to
  596.      everybody.  Basically, this is the ranting and raving about Eris,
  597.      Goddess of Discord, and all the rest of the drivel.
  598.  
  599.   2. Sage  This is the level of people who have gotten beyond the
  600.      external level.  Here is where you tell them that discord and
  601.      structure are really one, and that Eris is also Jehovah.
  602.  
  603.   3. Adept  Here is where the real plan is.  In this level is stored all
  604.      the information on how the Discordian Society is going to take over
  605.      the world through a devious, yet humorous, plan involving Newt
  606.      Gingrich, Wheaties Cereal, O.J. Simpson, and five hundred crystals,
  607.      all erroneously marked "6.5 MHz".
  608.  
  609.   6.1.1.  The Network Setup
  610.  
  611.   The IP numbers are arranged as:
  612.  
  613.   ╖  1 number is 192.168.2.255, which is the broadcast address and is
  614.      not usable.
  615.  
  616.   ╖  23 of the 32 IP addresses are allocated to 23 machines that will be
  617.      accessible to the internet.
  618.  
  619.   ╖  1 extra IP goes to a linux box on that network
  620.  
  621.   ╖  1 extra goes to a different linux box on that network.
  622.  
  623.   ╖  2 IP #'s go to the router
  624.  
  625.   ╖  4 are left over, but given domain names paul, ringo, john, and
  626.      george, just to confuse things a bit.
  627.  
  628.   ╖  The protected networks both have the addresses 192.168.2.xxx
  629.  
  630.   Then, two separate networks are built, each in different rooms.  They
  631.   are routed via Infrared Ethernet so that they are completely invisible
  632.   to the outside room.  Luckily, infrared Ethernet works just like
  633.   normal Ethernet (or so i think), so we can just think of them like
  634.   normal.
  635.  
  636.   These networks are each connected to one of the linux boxes with an
  637.   extra IP address.
  638.  
  639.   There is a file server connecting the two protected networks.  This is
  640.   because the plans for taking over the world involves some of the
  641.   higher sages.  The file server holds the address 192.168.2.17 for the
  642.   sage network and 192.168.2.23 for the adept network.  It has to have
  643.   different IP addresses because it has to have different Ethernet
  644.   cards.  IP Forwarding on it is turned off.
  645.  
  646.   IP Forwarding on both Linux boxes is also turned off.  The router will
  647.   not forward packets destined for 192.168.2.xxx unless explicitly told
  648.   to do so, so the internet will not be able to get in.  The reason for
  649.   turning off IP Forwarding here is so that packets from the sage
  650.   network will not be able to reach the adept network, and vica versa.
  651.  
  652.   The NFS server can also be set to offer different files to the
  653.   different networks.  This can come in handy, and a little trickery
  654.   with symbolic links can make it so that the common files can be shared
  655.   with all.  Using this setup and another Ethernet card can offer this
  656.   one file server for all three networks.
  657.  
  658.   6.1.2.  The Proxy Setup
  659.  
  660.   Now, since all three levels want to be able to monitor the network for
  661.   their own devious purposes, all three need to have net access.  The
  662.   external network is connected directly into the internet, so we don't
  663.   have to mess with proxy servers here.  The adept and sage networks are
  664.   behind firewalls, so it is necessary to set up proxy servers here.
  665.  
  666.   Both networks will be setup very similarly.  They both have the same
  667.   IP addresses assigned to them.  I will throw in a couple of
  668.   parameters, just to make things more interesting though.
  669.  
  670.   1. No one can use the file server for internet access.  This exposes
  671.      the file server to viruses and other nasty things, and it is rather
  672.      important, so its off limits.
  673.  
  674.   2. We will not allow Sage access to the World Wide Web.  They are in
  675.      training, and this kind of information retrieval power might prove
  676.      to be damaging.
  677.  
  678.   So, the sockd.conf file on the sage linux box will have this line:
  679.  
  680.   deny 192.168.2.17 255.255.255.255
  681.  
  682.   and on the adept machine:
  683.  
  684.   deny 192.168.2.23 255.255.255.255
  685.  
  686.   And, the sage linux box will have this line
  687.  
  688.   deny 0.0.0.0 0.0.0.0 eq 80
  689.  
  690.   This says to deny access to all machines trying to access the port
  691.   equal (eq) to 80, the http port.  This will still allow all other
  692.   services, just deny Web access.
  693.  
  694.   Then, both files will have:
  695.  
  696.   permit 192.168.2.0 255.255.255.0
  697.  
  698.   to allow all the computers on the 192.168.2.xxx network to use this
  699.   proxy server except for those that have already been denied (ie. the
  700.   file server and Web access from the sage network).
  701.  
  702.   The sage sockd.conf file will look like:
  703.  
  704.   deny 192.168.2.17 255.255.255.255
  705.  
  706.   deny 0.0.0.0 0.0.0.0 eq 80
  707.  
  708.   permit 192.168.2.0 255.255.255.0
  709.  
  710.   and the adept file will look like:
  711.  
  712.   deny 192.168.2.23 255.255.255.255
  713.  
  714.   permit 192.168.2.0 255.255.255.0
  715.  
  716.   This should configure everything correctly.  Each network is isolated
  717.   accordingly, with the proper amount of interaction.  Everyone should
  718.   be happy.  Now, look out for your 6.5 MHz crystals
  719.  
  720.