Hi,
I would like to run qemu with all of the network traffic going through a VPN using openconnect but without changing the host network setup, i.e. the host should use the VPN. It would be nice if the VM and the host could communicate, e.g. ssh from VM to host, but this is less important. I do not figure out how to make qemu talk to openconnect. It is probably not helpful that my understanding of networking is very bad.
So far, I tried
sudo openconnect --script "tundevscript" https://vpn....
where tundevscript echoes the TUNDEV environment variable, e.g. tun0. Then I started qemu with
.. -netdev tap,id=net0,ifname=tun0 ..
but it complains:
could not configure /dev/net/tun (tun0): Invalid argument
I also tried (this one does not need sudo):
openconnect --script-tun --script "vpnfdscript" https://vpn....
where vpnfdscript echoes the VPNFD environment variable, e.g. 8, and then started qemu with
.. -netdev tap,id=net0,fd=8 ..
but then I got another error,
.. TUNGETIFF ioctl() failed: Inappropriate ioctl for device ..
I would appreciate getting help with this.
Best regards!