Forward and map port to VM

hi

i created this issue as a new one as a related one to Forward and map port to container

I am trying to forward http request from host browser port 8078 to incus VM port 8078 where there is already an installed apache/nginx server .

I have read the well structured incus documentation but i can see an example of how to do this for virtual machine (nat=true)

I would appreciate if anyone can help

Thanks

for any one reading below is step by step solution i used:

Note: Please keep in mind that host’s localhost ip 127.0.0.1 as listen address may not work so you have to use a real ip (the on currently on your host’s ip4 tab. if possible a fixed ip ). It could also be a good idea to also fix the virtual machine destination ip address.

So assuming that,

  • both incus server and client are on the same machine
  • listen_address (on the host our incus host) is 192.168.0.10
  • listen_port (the host’ port you’re forwarding from to the incus VM’’s port) is 8056
  • target_address (the incus VM’s ip) is 10.74.77.28
  • target_port (the incus VM’s port) is 8056 (or any other port greater that 1024 i think**)**
  • is incusbr0 (so i think if the server was elsewhere the format will be remote: )

here are steps commands

  1. incus network forward create incusbr0 192.168.0.10 #(Creating a forward)
  2. incus network forward port add dfincusbr0 192.168.0.10 tcp 8056 10.74.77.28 8056

Home it helps and expecting others to comments if needed

Thanks