NAME

peapod - EAPOL Proxy Daemon

SYNOPSIS

peapod [-dtsqCoh] [-vvv] [-p pidfile] [-c configfile] [-l [logfile]]

DESCRIPTION

peapod is a daemon that proxies IEEE 802.1X Extensible Authentication Protocol over LAN (EAPOL) packets between Ethernet interfaces. It supports a few tricks on a per-interface basis, so it may be considered a (highly) rudimentary general-purpose transparent bridging firewall/rewriting proxy for EAPOL.

EAPOL is a port-based network access control (PNAC) mechanism ensuring that only authorized devices are allowed to use a network. In a nutshell, EAPOL blocks regular network traffic, such as TCP/IP, from traversing the physical port (e.g. on a switch) to which a client is connected until the client successfully authenticates and establishes an EAPOL session.

Abilities surpassing those of a simple proxy include:

EAPOL/EAP classification, filtering, and script execution
Proxy only certain kinds of packets between certain interfaces and execute user-defined scripts when proxying recognized packet types. This is supported for the nine EAPOL Packet Types defined by IEEE Std 802.1X-2010 and the four EAP Codes defined by IETF RFC 2284.
802.1Q VLAN priority tag handling
Add, modify, or remove priority tags in proxied EAPOL packets. (In fact, more than just the Priority Code Point field in the 802.1Q tag may be manipulated.)
MAC spoofing
Change interface MAC to a user-defined address, or to the address of an actual supplicant behind the proxy learned during runtime. This enables the device running peapod to masquerade as the supplicant and originate what appears to be authorized network traffic once the supplicant establishes an EAPOL session (as long as MACsec is not in use).

OPERATION

At startup, peapod reads its config file to determine the network interfaces on which it should listen for EAPOL packets and how packets should be received and sent on those interfaces. "EAPOL packet" in this sense is an Ethernet frame with the EAPOL EtherType of 0x888e encapsulating either an EAP packet or certain EAPOL control messages.

See peapod.conf(5) for config file semantics and syntax.

The remainder of this section provides an overview of peapod's control flow once it begins proxying packets proper, and is intended to assist in the creation of config files. This can be divided into ingress and egress phases.

ingress phase

peapod waits until an EAPOL packet arrives on any configured interface, which then becomes the ingress interface.

The following is then performed:

  1. If the packet is the first packet to be received on the ingress interface, and another interface is configured with "set-mac-from ingress-interface-name;":
    • Change the other interface's MAC address to that of the packet's sender.
    • Drop the packet.
  2. Determine the type of the packet.
    • Check for ingress scripts and/or ingress filters (scripts/filters configured as ingress stanza options on the ingress interface) that match the packet type.
  3. Execute any matching ingress script.
  4. Apply any matching ingress filter (i.e. drop the packet).

Dropping a packet in this phase means immediately discarding it and returning to the beginning of the ingress phase.

If the packet was not dropped, peapod moves on to the egress phase.

egress phase

The received packet is proxied to all configured interfaces except for the ingress interface, which then become the egress interfaces.

For each egress interface, the following is then performed:

  1. Make a copy of the packet to be used with the current egress interface.
  2. If an existing 802.1Q VLAN tag in the packet should be manipulated or removed, or one should be added (as configured in a dot1q option on the current egress interface):
    • Make the necessary changes to the copy.
  3. Determine the type of the packet.
    • Check for egress filters and/or egress scripts (filters/scripts configured as egress stanza options on the current egress interface) that match the packet type.
  4. Apply any matching egress filter (i.e. drop the packet).
  5. Execute any matching egress script.
  6. Send the (copy of the) packet on the current egress interface.

Dropping a packet in this phase means discarding the copy and moving on to the next egress interface.

At the end of the egress phase, the packet may have been proxied to one or more egress interfaces, and peapod returns to the beginning of the ingress phase to listen for more packets.

EXAMPLES

Example config files and scripts are included in peapod's shared resources in /usr/share/peapod/examples, as well as in the doc/examples subdirectory of the program sources.

See peapod.conf(5) for config file semantics and syntax.

OPTIONS

All short options except -v also have a long form listed.
Mandatory arguments are mandatory for both forms.

-d, --daemon

Run as a daemon. Logging to the console (stdout and stderr) is disabled. Sets -s and causes a PID file to be used.

-p pidfile, --pid pidfile

Specify a different PID file than /var/run/peapod.pid, the default. Sets -d.

-c configfile, --config configfile

Specify a different config file than /etc/peapod.conf, the default.

A config file is required. See peapod.conf(5) for more details.

-t, --test

Test the config file and exit.

-l [logfile], --log [logfile]

Enable logging to a log file. Optionally, specify a different log file than /var/log/peapod.log, the default.

-s, --syslog

Enable logging to syslog. Set automatically by -d and -p.

-v

Increase log verbosity. Can be specified up to three times. Overridden by the verbosity option in the config file.

With -v, informational messages are also logged.
With -vv, so are debug messages.
With -vvv, so are low-level debug messages such as Ethernet frame hexdumps. (As these last are extremely voluble, they are logged only to the console and/or to a log file, and never to syslog.)

-q, --quiet-script

Treat script execution notices as informational, so that they are logged only if at least one -v was specified.

-C, --color

Colorize logging output to console.

-o, --oneshot

Do not restart the proxy after certain errors occur, such as a configured interface going down unexpectedly.

The default error handling behavior once the proxy is running is to wait ten seconds between unlimited restart attempts.

-h, --help
Print a help message to the console.

FILES

/usr/sbin/peapod
/etc/peapod.conf
/var/log/peapod.log
/var/run/peapod.pid

BUGS

Definitely. For suggestions, bug reports, contributions, pull requests, etc., please contact the author via the project page at https://github.com/kangtastic/peapod or via e-mail.

While not a bug per se, note that peapod's usefulness is greatly limited on MACsec-enabled networks.

SEE ALSO

peapod.conf(5)

AUTHORS

kangtastic