README for natkeep-0.1 Copyright (c) 2000 Matthew Fredette. All rights reserved. See the file COPYING for no-warranty and distribution terms. natkeep is a program for internal networks that are connected to the Internet through a NAT. NATs normally delete mappings for UDP connections after a timeout; this breaks protocols where a server can send to a client at any later time. AFS and Zephyr are two such protocols. natkeep runs on the internal network, and periodically sends fake packets through the NAT to keep certain UDP mappings alive. natkeep's fake packets have a junk one-byte UDP payload; they're sent with a user-specified TTL that's supposed to be enough to get them forwarded through the NAT but die soon after, never making it to any real servers. natkeep is two programs. natkeepd is a daemon that monitors the network, watching for new UDP connections that it should keep open, and sending fake packets to keep those connections open. usage: natkeepd [OPTIONS] TTL where OPTIONS are: --period SECONDS set the transmit period to SECONDS [default=25] -d, --debug set debug mode The TTL is used in transmitting the fake packets. The optional period controls how often natkeepd will transmit. natkeep is a command-line utility for managing the list of UDP connections inside natkeepd. usage: natkeep [OPTIONS] VERB where OPTIONS are: -n show addresses instead of names where VERB is: add RULE-NUMBER [src ADDRESS] [dst ADDRESS] delete RULE-NUMBER dump an ADDRESS is: [HOSTNAME[/PREFIX]][:PORT] natkeep takes one of three verbs on the command line. The first, add, is used to add new rules to natkeepd. For example: natkeep add 50 src 10.0.0.2:3000 dst something.nowhere.com:3000 natkeep add 100 dst :afs3-fileserver natkeep add 200 src :zephyr-hm dst zephyr-1.nowhere.com:zephyr-clt natkeep add 200 src :zephyr-hm dst zephyr-2.nowhere.com:zephyr-clt natkeep add 200 src :zephyr-hm dst zephyr-2.nowhere.com:zephyr-clt The first rule is fully specified, and will cause a packet to be sent from 10.0.0.2 port 3000 to something.nowhere.com:3000 once per period. The remaining rules are wildcarded. These rules don't cause packets to be sent directly; rather, natkeepd monitors the network for packets matching these rules, and adds real, fully-specified rules matching any packets seen. The delete rule deletes all rules with the given rule number. For example: natkeep delete 200 would delete all of the Zephyr rules added above. The dump verb dumps the current set of rules, including those added automatically from wildcarded rules. natkeepd has rough support for monitoring specific protocols. This release contains a monitor for the Zephyr protocol. natkeep depends on libpcap, the packet capture library, and on pth, the GNU portable thread library. natkeep has been compiled under NetBSD, FreeBSD, and RedHat Linux, but it has only ever been tested on NetBSD. To configure natkeep for compiling, run the 'configure' script, followed by make. To report bugs in compiling or using natkeep, email fredette@mit.edu, and please include as much information as you can about what you're trying to do and what goes wrong. I don't have much time to do support, but I'll try.