Linux SSH – How to Use IPv4 on IPv6-Only Machine Through SSH Tunnel

ipv4ipv6linuxsshtunnel

Our non-IT company uses a IPv4-only webservice which only allows access from our (whitelisted) IPv4 ip. This ip is assigned to one of our VPSes (this VPS also has a IPv6 assigned to it).

We usually SSH tunnel from other IPv4 machines in to this VPS and use the ip address via the proxy settings in Firefox.
This works exactly how we want it, but not on our IPv6-only machines. These can SSH tunnel in to the VPS with it's IPv6 address, but then we can only use the IPv6 of the VPS and not the IPv4.

Is there any way to use the IPv4 from this VPS, and maybe use the VPS as a intermediate server to 'translate' the requests? We prefer a tunnel-like solution but every possible tool is allowed if it helps us to achieve our goal.

We already tried most ways of setting up a ssh connection (ssh & sshuttle) and also did things with socat, but haven't had luck yet and most solutions we find are about turning IPv4 into IPv6, not IPv6 to IPv4.

Best Answer

Let's draft a more comprehensive explanation if the problem should affect also other people. The OP is connecting to the web through a SOCKS5 proxy established with:

ssh -D <local_port>

Unfortunately there is a Firefox bug, which doesn't allow IPv6-only hosts to connect to an IPv4 address using the proxy. They must enable DNS proxying too.

In the other direction, IPv4-only hosts can connect to an IPv6 address using the proxy.