0

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).

2
  • 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 -Ls instead.
    – Lacek
    Apr 22, 2022 at 8:30
  • 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.
    – user161458
    Apr 27, 2022 at 8:06

0

You must log in to answer this question.

Browse other questions tagged .