Page 1 of 1

2 vlans with NAT

Posted: Wed Jan 13, 2021 11:48 pm
by Urajmal
Hi guys! After few years learning ROS I am facing a task that I am unable to realize. I am fairly new with VLANs. So basicaly the work is something like:

Server with trunk signal with VLAN 22 and VLAN 32 connected with one cable to Mikrotik (Hex lite) Eth1 - then, this is the part that I do not understand - both VLANs should be NATed, then leave Mikrotik through ETH5 with both VLANs, 22 and 32.

My questions are:
How and should I recognize VLANs 22 and 32 on Eth1?
How should I configure NAT?
How can I make leave route trough ETH5 and tagg it with VLAN 22, 32? If those were not tagged (somehow) on Eth1 input?

I would be very glad if someone can help me with a little explanation in parallel with solution?

Re: 2 vlans with NAT

Posted: Thu Jan 14, 2021 9:39 am
by mkx
How and should I recognize VLANs 22 and 32 on Eth1?
How should I configure NAT?
How can I make leave route trough ETH5 and tagg it with VLAN 22, 32? If those were not tagged (somehow) on Eth1 input?
When using VLANs in RouterOS, you have to start using vlan interfaces, these allow ROS to work with individual VLANs. Have a look at this manual page. And look for other manual documents, explaining VLANs, e.g. this nice tutorial. You may want to study some resources dealing with VLANs in general if the concept is not entirely clear to you.

After you properly use vlan interfaces to set up L3 (IP) configuration on router, the rest of functions (routing, NAT, firewalling) are set up in manner, similar to using "plain" interfaces.

Re: 2 vlans with NAT

Posted: Thu Jan 14, 2021 10:48 am
by Urajmal
mkx, thanks a lot!

I have been studying VLANs, and I am still considering myself a beginner with VLANs. However I am learning on examples and study them, it does really make me more productive and overall it makes me more interesant into the problem.

I am not saying you shuld type the syntax code for me, but it helps to give some idea where to start, what to set, etc.

Re: 2 vlans with NAT

Posted: Thu Jan 14, 2021 8:02 pm
by anav
The tutorial he suggested has all the syntax one needs.