So basically what i need to do is assign an IP within the range of ones of my main router non dhcp leases (static IP) and then modify the network->switch section as I need. One thing that i didn't get btw is how can I assign one port to be the trunk one.
Here's some picture for a better understanding (at least for me and future users I guess).
This is the default configuration the OpenWrt comes with.
When I want to tag some interfaces (I'm supposing one of the LAN ports for the trunk, let's say port no. 1) I just type the VLAN ID in the port status section and then set the specific port (let's say no. 2) as tagged. Doing this for the rest of the ports (using VLAN tags 20, 30, 40) and I should get something like this.
Now assuming that what I did is correct, I should in some way set the trunk port and assign an IP within the LAN subnet of the main router to the device (this because I'd like to keep it as a "managed switch"). How can I do those two last steps?
EDIT: I forgot to mention the fact that the main router also provides DHCP for all the VLANs.