.\" Process this file with
.\" groff -man -Tascii foo.1
.\"
.TH FWKNOP 8 "Jun, 2004" Linux
.SH NAME
.B fwknop
\- Firewall Knock Operator
.SH SYNOPSIS
.B fwknop [-c
.I config-file
.B ] [-u
.I user-rc file
.B ] [-k
.I knock-dst
.B ] [-d] [-e] [-s] [-p
.I port
.B ] [-P
.I protocol
.B ] [-g] [--offset
.I port-offset
.B ] [--os] [-v] [-V] [-h]

.SH DESCRIPTION
.B fwknop
implements a flexible port knocking scheme based around log messages generated by
the
.B iptables
firewall in the Linux kernel.
.SH OPTIONS
.PP
.PD 0
.TP

.BR \-c "\fR,\fP " \-\^\-config\ \<config-file>
When run in server mode
.B fwknop
references the file
.B /etc/fwknop/fwknop.conf
for various run-time configuration
variables.  The path to this file can be changed through the use of the
.B --config
command line option.
.TP

.BR \-u "\fR,\fP " \-\^\-user-rc\ \<rc-file>
The default connection rc file
.B fwknop
uses to know what shared port knocking sequence to send to a destination machine
is defined in the file
.B ~/.fwknoprc.
The path to this file can be changed with the
.B --user-rc
command line option.
.TP

.BR \-k "\fR,\fP " \-\^\-knock-dst\ \<IP>
Run
.B fwknop
is port knocking mode against the destination IP address.  The specific port
knock sequence that is sent to the destination will either be encrypted (if
.B --encrypt
is passed on the command line) or read out of the file
.B ~/.fwknoprc.
.TP


.BR \-e "\fR,\fP " \-\^\-encrypt
Instruct
.B fwknop
to form an encrypted knock sequence that the destination knock server will
decrypt to determine which port, protocol, and IP address should be allowed
through the local firewall.  Options that should also be specified with
.B --encrypt
are
.B --allow-ip
or
.B --source-ip,
.B --port,
and
.B --Proto.
The port knock sequence will be encrypted with the Rijndael AES block cipher.  The
encryption key is specified in /etc/fwknop/access.conf on the server side, and is
read from STDIN on the client side (or read from
.B ~/.fwknoprc
if
.B --get-key
is passed on the command line).
.TP

.BR \-a "\fR,\fP " \-\^\-allow-ip\ \<allow-IP>
Specify a third-party IP address (can be the local machine) to allow
through the destination knock server firewall.  This option is only used
when
.B fwknop
is being run in
.B --encrypt
encrypted knock mode.
.TP

.BR \-s "\fR,\fP " \-\^\-source-ip
Instruct
.B fwknop
to form an encrypted knock sequence that will contain the special-case IP
address "0.0.0.0" which will inform the destination knock server to use
the source IP address from which an encrypted knock sequence originates as
the IP that will be allowed through upon modification of the firewall ruleset.
This option is useful if the fwknop client is deployed on a machine that is
behind a NAT device.  This option is only used in
.B --encrypt
encrypted knock mode.
.TP

.BR \-p "\fR,\fP " \-\^\-port\ \<port>
Port to open on the remote knock server.  If --Proto is not also given,
.B fwknop
will default to a tcp port.
.TP

.BR \-P "\fR,\fP " \-\^\-Proto\ \<protocol>
Protocol associated with the port to open on the remote knock server.
Either
.B tcp
or
.B udp
may be specified, but
.B fwknop
will default to tcp if this command line arguement is not given.
.TP

.BR \-\^\-offset\ \<port>
Specify a port offset to use when running
.B fwknop
in encrypted knock mode.  The default is 61000.
.TP

.BR \-\^\-os
Run
.B fwknop
in OS fingerprinting mode against an existing iptables
logfile.  This will generate a listing of IP addresses along with a
guess at the associated operating system type.  The default iptables
logfile path is
.B /var/log/fwknop/fwdata
but this path can be altered through the use of the --iptables-log
option below.
.TP

.BR \-i "\fR,\fP " \-\^\-iptables-log\ \<iptables logfile>
Specify path to an existing iptables logfile when running
.B fwknop
in --os mode.
.TP

.BR \-g "\fR,\fP " \-\^\-get-key
Get encryption key from
.B ~/.fwknoprc
file instead of from STDIN.  This
option can only be specified when running fwknop in encrypted knock
mode against a system running a fwknop server.
.TP

.BR \-v "\fR,\fP " \-\^\-verbose
Run fwknop in verbose mode.
.TP

.BR \-h "\fR,\fP " \-\^\-help
Display usage information and exit.
.TP

.BR \-V "\fR,\fP " \-\^\-Version
Display version information and exit.
.TP

.SH FILES
.B /etc/fwknop/fwknop.conf
.RS
The main configuration file for
.B fwknop.
.RE

.SH EXAMPLES
The following examples illustrate the command line arguments that could
be supplied to fwknop in a few situations:

# fwknop

.SH DEPENDENCIES
.B fwknop

.SH DIAGNOSTICS
.B fwknop

.SH "SEE ALSO"
.BR iptables (8),
.BR knopmd(8),
.BR knopwatchd(8)

.SH AUTHOR
Michael Rash <mbr@cipherdyne.org>

.SH BUGS
Send bug reports to mbr@cipherdyne.org.  Suggestions and/or comments are
always welcome as well.

.SH DISTRIBUTION
.B fwknop
is distributed under the GNU General Public License (GPL), and the latest
version may be downloaded from
.B http://www.cipherdyne.org
