Score:0

How to configure a double proxy jump for apt install?

cn flag

I need to install packets in a KVM guest (vm) but the KVM host (hypervisor) doesn't have internet. I already know how to configure an ssh+apt proxy to give apt install capabilities to computers in a one jump lenght proxy.

I tried setting a bridged interface but I keep getting connexion error after a few seconds of apt install through ssh.

I'm now in the need to perform a double jump to work aroung this issue. I tried chaining the proxy like below but I encounter some errors :

|    pc-wan    |                    |  hypervisor  |
|192.168.254.50|<-------ssh1------->|192.168.254.20|                    |      VM1      |
                        /           |192.168.122.1 |<-------ssh2------->|192.168.122.15 |
            -R 3334:ftp-debian:80           |                \                 |
                                            |         -R 3333:pc-wan:3334      |
                                            |                                  |
                                   apt-proxy = localhost:3334           apt-proxy = localhost:3333

\_______________working_______________/
\_____________________________________________KO_____________________________________________/

The first jump work fine, I can apt install on the hypervisor. But when I try it on VM1, the following error apprear : connect_to to 192.168.254.50 port 3344: failed.

It seems to come from the redirection between the two ssh sessions, the hypervisor seems to fail to redirect the apt install request from VM1 to the ssh1 tunnel.

Do you know how to resolve my issue ?

Note : The KVM host-guest network interconnexion is done by the default NAT bridge (switch).

in flag
What happens if you use the redirect `3333:127.0.0.1:3334` at the "ssh2" connection? Also, I think the `-R` flags should be `-L`s instead.
cn flag
I got some time to try your solution and it worked, the "ssh2" connection needed the redirect you specified (to localhost). It work with the `-R` flag.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.