aboutsummaryrefslogtreecommitdiffstats
path: root/learn-mac-based-vlan
diff options
context:
space:
mode:
Diffstat (limited to 'learn-mac-based-vlan')
-rw-r--r--learn-mac-based-vlan12
1 files changed, 12 insertions, 0 deletions
diff --git a/learn-mac-based-vlan b/learn-mac-based-vlan
new file mode 100644
index 0000000..34f7e09
--- /dev/null
+++ b/learn-mac-based-vlan
@@ -0,0 +1,12 @@
+# RouterOS script: learn-mac-based-vlan
+# Copyright (c) 2013-2018 Christian Hesse <mail@eworm.de>
+#
+# learn MAC address for MAC-based-VLAN
+
+:local NewVlanId 33;
+
+/ log info ("MAC-based-VLAN: learning MAC address " . $leaseActMAC . " for VLAN " . $NewVlanId . ".");
+
+:if ( [ :len [ / interface ethernet switch mac-based-vlan find where src-mac-address=$leaseActMAC ] ] = 0 ) do={
+ / interface ethernet switch mac-based-vlan add src-mac-address=$leaseActMAC new-customer-vid=$NewVlanId;
+};