I’ve been trying to find out if proxy devices are supported for VMs (yet?) but because there is so much development happening and the information is mostly in release notes it’s hard to figure out.
I don’t get any errors when adding a proxy device.
@Maran yes proxy devices are not supported yet for VMs. I’ll investigate why you were able to add a proxy device, as it should have resulted in an error.
We are probably going to end up adding limited proxy device support for VMs, at least when using nat=true mode, which avoids the need to pass any file handles into the instance.
We are probably going to end up adding limited proxy device support for VMs, at least when using nat=true mode, which avoids the need to pass any file handles into the instance.
I’m sorry but what does this mean exactly? How should I be port-forwarding into VMs and why is this structurally different from containers? Isn’t the technique behind it the same? Are you not simply taking a package for one ip and port and forwarding it on to an other duo?
Sorry for all the questions trying to wrap my head around things
I can’t see the device has been added to your VM, are you certain you added it to this VM and another container or profile? Can you show the output of lxc config show vmtester --expanded also please?
As for the difference between proxy device modes, the ‘normal’ proxy mode creates a listening socket on the LXD host (or in the container depending on the configuration) and then for each inbound connection to that socket it switches network namespace into the container and opens a new connection inside the container to the specified target address.
This has several advantages:
It doesn’t require the container’s listening socket to be reachable from the LXD host (i.e the service can be listening on 127.0.0.1 inside the container).
It doesn’t require a static address (for the reason above).
It allows protocol translation (i.e tcp to udp).
It allows binding to the wildcard address on the listening socket, which NAT mode doesn’t allow.
However the downside is that it runs a small process per proxy device.
Because LXD cannot switch network namespaces for a VM (because it has no namespaces) we cannot use forkproxy as it is.
The alternative is to do ‘true’ network level port forwarding, which the proxy device also supports when nat=true is specified as an option.
In NAT mode, it requires the instance to have a static IP (so the the NAT rules can be added to the host), and it requires the listening service to be listening on that IP. It is this particular mode that we may be able to add for VMs, as it uses the existing network connection of the VM. However it is not supported at this time.
No it’s not added, however the message Device aa-web added to vmtester got me chasing ghosts for a while because it seems to imply it was added. Sorry if that was unclear.
If the proxy device is not supported at this time would adding iptable rules to forward incoming traffic to the VMs be a good idea or is there some other trick I could use to get my traffic where it needs to go?