I've been asked this a couple of times - how to use a Mikrotik to see neighbors on all of your Vlans.
In this case , I used a Mikrotik virtual CHR on one of my Proxmox hypervisors ( license Level free ).
- ether1 ( any IP address you want to use for management )
- ether2 ( This port is a trunk port - this ether2 interface is the interface used to see all vlans on your network.
Now add this script , then run it:
script-name: create-4096-vlans
:local startVlan 1
:local endVlan 4094
:local iface "ether2"
:for vlanId from=$startVlan to=$endVlan do={
Format VLAN ID with leading zeros to 4 digits
:local vlanStr ("0000" . $vlanId)
:set vlanStr [:pick $vlanStr ([:len $vlanStr] - 4) [:len $vlanStr]]
Build interface name with leading zeros
:local vlanName ($iface . "-Vlan-" . $vlanStr)
Create VLAN interface
/interface vlan add name=$vlanName vlan-id=$vlanId interface=$iface
:put ("Created VLAN interface: " . $vlanName)
}
The above script will create vlans on your ether2 interface. ( ether2-Vlan-0001 -through- ether2-Vlan-4094 )
Then just go to IP -> neighbors
FYI - in my case - I see 1098 neighbors
Also - go to interfaces -> interface
Look at the Rx tab. You can see what Vlans are passing some traffic.
This uses almost no CPU and works well to check what might be on your network.
Best thing - when you are finished , just shut it down. Keep it for later if you want to use it again.
[admin@CHR-MAC-Neighbors] /interface/vlan> print
Flags: R - RUNNING
Columns: NAME, MTU, ARP, VLAN-ID, INTERFACE
NAME MTU ARP VLAN-ID INTERFACE
0 R ether2-Vlan-0001 1500 enabled 1 ether2
1 R ether2-Vlan-0002 1500 enabled 2 ether2
2 R ether2-Vlan-0003 1500 enabled 3 ether2
3 R ether2-Vlan-0004 1500 enabled 4 ether2
4 R ether2-Vlan-0005 1500 enabled 5 ether2
5 R ether2-Vlan-0006 1500 enabled 6 ether2
6 R ether2-Vlan-0007 1500 enabled 7 ether2
North Idaho Tom Jones