Full I2P Router on Android with termux HowTo

HowTos, FAQs, Tips & Tricks, & Guides
Post Reply
robabok978
Posts: 36
Joined: 12 Feb 2022 02:58

Full I2P Router on Android with termux HowTo

Post by robabok978 »

Remote I2p in/by Android
With TERMUX:

install termux app
https://termux.com/

in termux:
apt-get update
apt-get install wget nmap htop byobu openjdk-17 dropbear

Start dropbear as sshserver for access and port forwarding:
dropbear

Don't know if needed but i did anyways
Password for user:
passwd

Who we are and where are we - for the ssh login
User id:
id
Ip:
ifconfig


I2p router install. I use i2p+:

mkdir i2p
cd ./i2p
wget https://i2pplus.github.io/installers/i2 ... x-only.jar
java -jar i2pinstall_1.6.1-0+_linux-only.jar -console

start router:
./i2prouter start - does not work
./runplain.sh - as alternative


Getting process id by router
ps aux - is the pid of i2p running?

nmap -sV 127.0.0.1 - Looking for open ports
Ports needed some time to show up.
Should be:

4444 i2pproxy
6668 irc i2p?
8xxx ssh

Does not show explicit the 7667 but echoed it.

Remote connect - forwarding the ports via ssh on your remote:
ssh -v -L 4444:localhost:4444 -L 7667:localhost:7667 -L 7657:localhost:7657 -L 6668:localhost:6668 uO_axx@xxx.xxx8.xxx.xxx -p 8xxx

Fast test with midori (got no eceptions for localhost, not so good for i2p console). http://notbob.i2p/ does work.

Test Firefox esr. Manual proxy conf with except for localhost.Test http://notbob.i2p/ - does work. Test 127.0.0.1:7667 for i2p+ console - does not work.
Test 127.0.0.1:7657 for i2p console - does work and it is the i2p+ (thought this would be at 7657 but it reroutes somehow.
I have to say like all remote access with forwarding, this is faster than expexted. Its a samsung galaxy s2 4cores 1gb ram. 300mb ram in termux.

That is accessible:
$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 392M 332K 392M 1% /dev
tmpfs 392M 0 392M 0% /mnt
/dev/block/mmcblk0p9 1.4G 829M 683M 55% /system
/dev/block/mmcblk0p7 98M 4.1M 94M 5% /cache
/dev/block/mmcblk0p10 3.6G 1.7G 1.6G 52% /data
/data/media 3.6G 1.7G 1.6G 52% /storage/emulated

free -h
total used free shared buff/cache available
Mem: 784Mi 542Mi 21Mi 0.0Ki 220Mi 231Mi
Swap: 349Mi 167Mi 182Mi

Service tunnels irc, http, torrent

Termux is running in the backround, so you can still use your android.

Access from android app browser did not work. Every browser wanted a running i2papp to configure for proxy. Lighting, privacy browser.

How easy is this to do with a script - not to much
A installation would require
install termux
apt-get update
apt-get wget
wget url/to/script
chmod +x script
bash ./script
echo ssh line
Thats it.

Maybe even a solution like anlinux, where the app only copy a string for termux. Should be easy for the user.


i2psnark test:

here it wants to write to:
/data/data/com.termux/files/home/.i2p/i2psnark
got write access
paste torrent link in snark.
Works.

Cpuload:

$ htop
Cannot open /proc/stat: Permission denied

with all running by top:
Tasks: 10 total, 1 running, 9 sleeping, 0 stopped, 0 zombie
Mem: 802860k total, 785004k used, 17856k free, 7724k buffers
Swap: 358396k total, 175080k used, 183316k free, 198148k cached
100%cpu 0%user 0%nice 0%sys 100%idle 0%iow 0%irq 0%sirq 0%host
PID USER PR NI VIRT RES SHR S[%CPU] %MEM TIME+ ARGS
14778 u0_a84 10 -10 398M 146M 6.2M S 70.3 18.6 182:12.05 java -cp "/data+
8308 u0_a84 10 -10 5.7M 1.7M 1.2M R 1.6 0.2 0:00.28 top
5631 u0_a84 10 -10 6.1M 812K 560K S 0.6 0.1 0:11.91 dropbear
6861 u0_a84 10 -10 6.1M 744K 512K S 0.3 0.0 0:00.90 dropbear
6864 u0_a84 10 -10 6.1M 2.3M 1.7M S 0.0 0.3 0:00.18 bash -l
5650 u0_a84 10 -10 6.1M 2.3M 1.7M S 0.0 0.2 0:00.09 bash -l
14584 u0_a84 10 -10 6.1M 492K 368K S 0.0 0.0 0:00.23 dropbear
11760 u0_a84 10 -10 6.1M 1.2M 984K S 0.0 0.1 0:00.40 bash -l
9892 u0_a84 10 -10 6.1M 632K 608K S 0.0 0.0 0:00.22 bash -l
7121 u0_a84 20 0 860M 42M 30M S 0.0 5.3 1:20.83 com.termux

It is running full load, but not getting hot. But i don't trust the 100%. Htop was denied and top could be crippled.

Something about using the sdcard in termux:
https://wiki.termux.com/wiki/Internal_a ... al_storage
"Full read-write access to external SD cards and USB drives is available only on rooted devices"
not that bad, considering that androidtvboxes are rooted.

With the dropbear ssh server we also get sftp access for downloading files to your desktop. And not to forget with the possibilty to use a android browser on the termux router, it should also be possible to use a ssh client app to get the files, if you can't access them natively from the android env. (have not tested, but should be in /data)

I do think the ssh port forwarding and sftp client can be done by putty, so windows people can use this too.

With the usbstick/i2pdistro it is also possible to archieve the client for remote access either by booting it native or use it in a vm like vbox or vmware.
The combi for windows would only need vm, putty and the stick to have remote access with file transfer.

I2pmailserver runs too and maybe i will try the muwire plugin, but i am afraid thats it for my 1gb ram :)

Conclusion:
I have to say i like this solution for android better than the android app, because i am a friend of the console and all these numbers and blinking :)
Maybe it is also easy to mantain, because this the main i2prouter in java. So no new development required here.
I also tested the android app to test the remote access with i2p app and sshd app. Did work too, but no console and torrent. I like this combi too and will test it a little bit more with a apk from the i2psite and not from fdroid. because it is a little bit outdated there. This should be great if people want to browse on their desktops or tablet and not on the device where the router runs with the app. With bittorent this could be the cherry on cake or ice.

Some of craziest things i can think of, is using a microsd instead of the usbstick. Why? Showing how portable it is. :) When you have your 512GB microsd card in adapter in an usbadapter for seeding your big big collections of cloud and aquarium videos on your main power machine. Now imagine you can't do that for a time along, but someone in the internet desperatly needs his last blocks...then you pull out and stick the microsdcard in your rooted android mobile/android tvbox (doesn't have to be your own device :) ), with termux and help this guy getting his cloud videos !!! and this other shitty crap. ;) Just pull out and stick it in, lol
Post Reply