Can I create two VLANs so that VLAN1 use VLAN2 as gateway

I have OpenWRT virtual machine managed by Hyper-V. OpenWRT recieve internet from higer level router by dhcp (No MS NAT and default switch in Hyper-V. Hyper-V Virtual Connections Adapter set up as bridge to physical adapter).
I wonder if I can create two VLANs so that VLAN1 is connected to PPTP VPN server as default internet connection, then VLAN2 is connected to x-ray server via VLAN1 and handling all inbound connections from clients.
So thet clients connection sheme is like:
Clients -> VLAN2 (x-ray server) -> VLAN1(pptp server) -> Internet
Thank you.
P.S.

Likely you make separate virtual networks in windows each bridged to separate vlan on physical adapter/aggregate then have multiple adapters in a VM.

Thank you. I was thinking I can use one Physical Adapter set up for bridge mode in Hyper-V host and create two separated vlan in OpenWRT, can I?

Thats hyperv function.
Refer to their documentation.

As much as it pertains OpenWrt you can use vlans as you please, probably avoid vlan id 1 as often some hardware switches use it internally

Thank you. I think there is some misunderstanding. I want to use only OpenWRT for vlans and routing, without any Microsoft tech. I was thinking that it is possible.
For example, since vlan is literally virtual switch I could set up two vlans in OpenWRT config and give each one it's own network settings. I thought it was possible.

It says you need to split and rejoin vlans per vm. I think no less hassle than using separate interfaces.

But I do not need vlans in host VM. I need vlans in OpenWRT virtual machine...

This don't make any sense. If you do not need seperated layer 2 domains then there is no need for vlans. Then all you have to do is create multiple virtual networks and attach interfaces on every site to it.

The way VLAN-s work in hyperV is that you tag them on each port you need them, which means one virtual bridge per vlan. It is much easier to make separate interface per vlan.

Thank you! I am not quite familiar with OpenWRT yet. So, I do not need to use vlans to achieve my goal, but must use virtual networks instead, as I understand. I never knew about such tech in OpenWRT. Thanks. I believe I must google now.

Microsoft can help you with their product.

As always it depends how you want to setup and build your infrastructure.
Sometimes all you need is a trunk with all vlans and do a router on a stick setup but most of the time a router has 2 or more interface each carrying only one network.

I do not need to use Microsoft tech, I need OpenWRT tech, omg...

I can get another physical network card and use it as bridge, so that OpenWRT can use two network cards. It is not a problem.

OpenWrt can do either multiple VLANs with different functionality over one (virtual) interface or multiple independent (virtual) interfaces - or a combination of both.

Everything else is down to how you set up Hyper-V, which is something we can't really help you with. That is a 'problem' with virtualized systems, you have to do large parts of the configuration twice (once on the hypervisor, another time on OpenWrt), using vastly different semantics and lose the KISS aspects of one (wan-) cable coming in and another (lan-) going out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.