The „First-Step-Configuration“ ist pretty easy to handle.
But I need some help for a VLAN Configuration.
What I want to achieve is a „Router-On-A-Stick“ configuration. Means multiple VLAN on one Port with different DHCP Server /Subnets.
I’ve already configured multiple VLANs (ID 10,20) on ether2 (DHCP not configured yet). With Static IPs it worked fine, but I can’t reach the Internet.
Most likely the additional networks are not having NAT performed before heading for the ‘WAN’ interface, post the output of /export hide-sensitive after sanitising any public IPs, etc.
Your L2 VLAN setup is very far from complete (and what’s done is wrong). I suggest you to read through this nice tutorial. After you’re done and still have problems, come back with questions.
I’ve added DHCP on the VLANs and turned NAT on as well. I guess NAT was the issue (since DHCP has nothing to do with the Internetconnection with a static IP)
@mkx: Thanks for guide, but it didn’t help (still a good guide for learning about VLAN)
It still doesn’t look right … but if it works for you, fine.
Might stop working after some ROS upgrade though:
when an interface is member of bridge, then all the rest of configuration should go to the bridge.
In your case, ether2 is member of bridge named “bridge”, and vlan interfaces should be anchored on bridge. There’s some plain (non-vlan) configuration dispersed between ether2 and bridge as well.
If you really don’t intend to use the rest of wired ports (ether3-5, sfp1) in the same “switched” network as ether2, then you should remove ether2 from bridge. Beware that doing so you might loose admin access to RB due to various reasons: bridge admin-mac is set statically, possibly to MAC of ether2 interface. If interface with same MAC address is not member of bridge any more, interesting things can happen. Also, if you remove ether2 from bridge, you’ll loose untagged access to RB as a whole. Could be that currently you actually use untagged for administrative access.
Default SRC NAT rule should be working just fine. As the order of rules matters, you can check if the additional NAT rule really takes the traffic (check rule stats, e.g. by executing /ip firewall nat print stats … the rule actually servicing your traffic will have considerable numbers recorded).
Rationale: default rules use interface lists and WAN interface should be member of interface list named “WAN”. Your WAN seems to be ether1 with running DHCP client and that interface was already member of WAN interface list. The same interface list concept is used both by firewall filter rules as well as NAT rules.
What does matter is that your VLAN interfaces are not members of any interface lists (and should be members of LAN interface list by the functionality of it). So currently rule #4 from the export (last one in chain=input) blocks communication from VLANs (as compared to plain untagged traffic over ether2, which is member of bridge and bridge “interface” is member of LAN interface list).
There are other, potentially dangerous, inconsistencies in the configuration.