I have a QEMU VM with Windows 10 from which I can connect to a VPN. I would like to connect also the guest system (GNU/Linux) to the VPN, but unfortunately the VPN works only on Windows.
I use virt-manager
to manage my VM.
Here there is a solution for virtualbox: https://stackoverflow.com/questions/53573337/how-to-share-guest-vms-vpn-connection-with-host
It could be easily adapted for QEMU following https://brockmcelroy.com/kvm-host-only and https://serverfault.com/questions/929081/how-can-i-enable-packet-forwarding-on-windows
virt-manager
virt-manager
main window right click on QEMU/KVM
→ Deatils → Add newtwork (+
)
host-only
Isolated
192.168.56.0/24
virt-manager
press Add hardware
below → Network
host-only
isolated networkHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
edit/create the DWORD
IPEnableRouter
setting it to 1
Network & Internet Settings
→ Network and Sharing Center
.192.168.56.2
Network & Internet Settings
→ Network and Sharing Center
.ip route add xxx.yyy.zzz.www/qq via 192.168.56.2
with sudo (where xxx.yyy.zzz.www/qq
is the network you want to access through the VPN)