There is a small addition to all of the above.
I don’t know why, but the tun2socks container has stopped working recently - it couldn’t ping either local machines or remote hosts.
Colleagues who are not indifferent to our common problem figured out what the problem was with the container and advised us to make changes.
The solution was a change in spelling Entrypoint.sh , adding commands to turn interfaces off and on.
At the moment, I have restored work on all devices, so I will post an updated version:
#!/bin/sh
sleep 2
ifconfig eth0 down
sleep 2
ifconfig eth0 up
ip tuntap add mode tun dev tun0
ip addr add 198.18.0.1/15 dev tun0
ip link set dev tun0 up
sleep 2
ifconfig tun0 down
sleep 2
ifconfig tun0 up
ip route del default
ip route add default via 198.18.0.1 dev tun0 metric 1
ip route add default via 10.6.2.1 dev eth0 metric 10
tun2socks -device tun0 -proxy socks5://10.6.2.3:30804 -interface eth0
In Russian
Ко всему вышенаписанному небольшое дополнение.
Не знаю почему но все же контейнер tun2socks в последнее время переставал работать - не мог пинговать ни локальные машины, ни удаленные хосты.
Коллеги не равнодушные к нашей общей проблеме, разобрались в чем была проблема с контейнером и посоветовали внести изменения.
Решением стало изменение в написании Entrypoint.sh, добавление команд на выключение и включение интерфейсов.
В данный момент, у меня восстановилась работа на всех устройствах, так что выложу обновлённый вариант: