0

This is not the normal reroute IP through iptables but it is a bit more complicated.

I am using a very stripped down version of Busybox. The version has dropbear installed only a few limitations. It has netcat but extremely limited and it has NO iptables.

Now, my problem is, I need to reroute IP A which is to not be used anymore to IP B.

Sure there is a way with creating a local ssh tunnel with a virtual IP and all together in a script forwarding the Traffic from IP A trough the SSH tunnel to IP B.

The device I am using is extremely limited in cpu usage and RAM, so the less cpu time used and ram occupied the better.

It can be a script, but it cannot be a persistant connection towards that external IP B or A.

Hope this is clear enough, thanks a lot upfront for any ideas !

Siles

1 Answers1

3

What about using a network address translation on a router? Translate the old IP address 'A' to the new IP address 'B'. Or start using DNS instead of IP addresses so you can more easily update everything when an IP address changes.

Tommiie
  • 5,547
  • 2
  • 11
  • 45
  • Won't be possible as the device I am using is using 2G/3G connection. And no DNS is used. – Sir Siles Aug 17 '18 at 12:02
  • Multiple catches then :) Do you have good reasons for not using DNS or for not just changing the IP address being used at the source? Because now traffic is routed towards IP address A and it'll arrive at server A which is a stripped-down version of Busybox without iptables. Without iptables you can't do NAT so there is no way to send the traffic on to server B listening on IP address B. How did you envision using a virtual IP address? I would say some NAT is needed somewhere in that case as well. – Tommiie Aug 17 '18 at 12:19
  • Maybe I should actually mention that there are multiple catches ! DNS is not supported by the SIM provider so I can't use it. So basically what I came up with so far was the following. 1. I create a virtual IP 159.87.57.156 in lo interface with a restricted mask 255.255.255.255 2. Create a key for dropbear and add to auth file 3. Open listening port locally 4. Create a forwarding like ssh -N -y -f -g -i /root/autofix -L 159.87.57.156:8520:124.74.29.34:8520 root@127.0.0.1 But this is not a very good method, so I am looking for an alternative. – Sir Siles Aug 20 '18 at 07:47