use i2p without proxy

use i2p without proxy


install & run i2pd to server:

zypper in -y i2pd
systemctl enable --now i2pd

add new ip (all traffic coming to this ip will be redirected to the i2p network)

in the example, the role of the ip address will be performed by XXX.XXX.XXX.XXX

add iptables rules:

iptables -t nat -A PREROUTING -p tcp -d XXX.XXX.XXX.XXX --syn -j REDIRECT --to-port 4444
iptables -t nat -A OUTPUT -p tcp -d XXX.XXX.XXX.XXX --syn -j REDIRECT --to-port 4444

allow i2pd listen XXX.XXX.XXX.XXX and restart

sed -i "s/address = 127.0.0.1/address = 0.0.0.0/g" /etc/i2pd/i2pd.conf
systemctl restart i2pd

add new zone to your dns server (in example bind named):

/etc/named.conf

***
zone "i2p" in {
type master;
file "i2p.zone";
};
***

/var/lib/named/i2p.zone

$ORIGIN i2p
$TTL 7200
i2p. IN SOA ns.i2p. hostmaster.i2p. (
2022031700
7200
1800
7200
7200
)
i2p. IN NS ns.i2p.
i2p. IN A XXX.XXX.XXX.XXX
*.i2p. IN A XXX.XXX.XXX.XXX

restart bind named:

systemctl restart named

Содержание