/ .. / / -> download
I2P Gopher tunnel setup
=======================

The normal process for creating a standard tunnel to connect to this
Gopherhole works fine for the initial connection. However, all Gopher
"links" (on a menu) have an explicit hostname and port attached to
them. In other words, there are no relative links from the
perspective of the client (many Gopher servers support something like
a "gophermap" which lets the maintainer write relative links, but the
server resolves them before sending them to the client). This is in
contrast to HTTP/HTML links, where the client will assume any link
without a hostname or port is relative to the current website.

The effect is that following any Gopher link would send you back on
the clearnet. There is no way to fix this from the server's end,
since it cannot know the local IP and port of your I2P client tunnel.

Therefore, you'll need to map whatever the Gopher server thinks its
"real" hostname/port is to your tunnel by some other means.

Using iptables
--------------

iptables is one way to accomplish this:

1. Create a standard client tunnel. Example properties:

   - local IP: 127.0.0.1
   
   - local port: 5678

   - destination: (base32).b32.i2p

2. Create two REDIRECT rules in the nat table:

   # iptables -t nat -A PREROUTING \
         -d <REALHOST> \
         -p tcp --dport <REALPORT> \
         -j REDIRECT --to-port 5678

   # iptables -t nat -A OUTPUT \
   	-d <REALHOST> \
	-p tcp --dport <REALPORT> \
	-j REDIRECT --to-port 5678

   Where <REALHOST> and <REALPORT> are the "real" hostname and port
   of the Gopher server (that is, what it thinks its hostname and
   port are)

3. Connect normally with any Gopher client to <REALHOST>:<REALPORT>

Example: khzae.net I2P gopherhole
=================================

1. Create a standard client tunnel with properties:

   - local IP: 127.0.0.1

   - local port: 5678

   - destination: ql4l3ftj7lmrt5lxincilpey6czhphmozl2typgumaieysy7jf4q.b32.i2p

2. Create two REDIRECT rules in the nat table:

   # iptables -t nat -A PREROUTING \
         -d khzae.net \
	 -p tcp --dport 7071 \
	 -j REDIRECT --to-port 5678

   # iptables -t nat -A OUTPUT \
         -d khzae.net \
	 -p tcp --dport 7071 \
	 -j REDIRECT --to-port 5678

3. Connect with any Gopher client to khzae.net:7071


/ gopher://khzae.net/0/i2p/i2pgophersetup.txt