Using IP Filter to Protect a Solaris 7, 8, or 9 Workstation
This page contains simple configuration and init files, as well as instructions on how to install them on the following systems:
- Solaris 7, 32-bit
- Solaris 8, 32-bit
- Solaris 8, 64-bit
- Solaris 9, 32-bit, 64-bit
Outline of Procedure
- Download and install the IP Filter package.
- Modify the IP Filter configuration file(s), ipf.conf and ipnat.conf.
- Start IP Filter.
- Confirm that IP Filter works as expected.
Detailed Procedure
-
Download and install the IP Filter package.
For Solaris 7, 32-bit:
- Download the
IP Filter package for Solaris 7.
(If you wish to compile the latest version, you can get the source code
at the IP Filter Home Page listed in the References section at the bottom
of this page.)
- Download a sample ipf.conf file
(ipf.conf, for hme0 interface).
- Download a sample ipnat.conf file
(ipnat.conf, for hme0 interface).
- Install the IP Filter package using pkgadd.
For Solaris 8, 32-bit:
- Download the
IP Filter package for Solaris 8.
(If you wish to compile the latest version, you can get the source code
at the IP Filter Home Page listed in the References section at the bottom
of this page.)
- Download a sample ipf.conf file
(ipf.conf, for hme0 interface).
- Download a sample ipnat.conf file
(ipnat.conf, for hme0 interface).
- Install the IP Filter package using pkgadd. Only install
#1 ipf.
For Solaris 8, 64-bit:
- Download the
IP Filter package for Solaris 8.
(If you wish to compile the latest version, you can get the source code
at the IP Filter Home Page listed in the References section at the bottom
of this page.)
- Download a sample ipf.conf file
(ipf.conf, for hme0 interface or
ipf.conf, for eri0 interface).
- Download a sample ipnat.conf file
(ipnat.conf, for hme0 interface or
ipnat.conf, for eri0 interface).
- Download a
modifed ipfboot file.
Rename the file to the name ipfboot.
- Install the IP Filter package using pkgadd. IMPORTANT: Install #2
ipfx first, then re-run pkgadd and install #1 ipf.
- Rename /etc/init.d/ipfboot to /etc/init.d/ipfboot.orig.
- Copy the modified ipfboot file to /etc/init.d/.
- Make /etc/init.d/ipfboot executable.
- Make /etc/init.d/ipfboot owned by root.
- Remove the hard link /etc/rc2.d/S65ipfboot.
- Create a symlink from runlevel 2 to the modified ipfboot script, e.g.,:
ln -s /etc/init.d/ipfboot /etc/rc2.d/S65ipfboot
For Solaris 9, 32-bit, 64-bit:
- http://www.maraudingpirates.org/ipfilter/ has precompiled IPFilter binaries. Download the appropriate package, then follow the instructions for a 32-bit or 64-bit system as described for Solaris 8 above.
-
Modify the IP Filter configuration file(s), ipf.conf and ipnat.conf.
(To learn how to set up the ipf.conf file, see the ipf HOW-TO page at
http://www.obfuscation.org/ipf/ipf-howto.html.)
-
Rename sample ipf.conf.hme0 or ipf.conf.eri0 to ipf.conf, as
appropriate. Also, rename the sample ipnat.conf.hme0 or
ipnat.conf.eri0 to ipnat.conf, as appropriate.
Note: some Sun ethernet
interfaces are named strangely, such as dmfe0 on the Netras, and you
may have more than one ethernet interface. In such cases, you will
have to edit both configuration files to reflect the proper ethernet
interface name(s).
-
Edit ipf.conf to suit your needs. The sample ipf.conf includes some
commonly-used packet-filtering rules. Uncomment and edit those
that are relevant to your situation.
-
Copy ipf.conf to /etc/opt/ipf. Copy ipnat.conf to /etc/opt/ipf
(all ipnat,conf does is allow you to use outbound active ftp).
-
Start IP Filter.
Run the system initialization script to start IP Filter:
/etc/init.d/ipfboot start
-
Confirm that IP Filter works as expected.
Check what rules are set up on your system. The command below
will show the rules for inbound and outbound, and
additionally display the number of "hits" on a given rule.
/usr/sbin/ipfstat -ioh
You may also wish to run a port scan on your system to ensure that the
ports you think are filtered really are. You might also find the output
of "ipmon -a" interesting.
References
IP Filter Home Page
ipf HOW-TO
Last updated on 4 December 2002 by m-woo@uiuc.edu.
CITES Workstation Services Group
http://www.cites.illinois.edu/wsg