aboutsummaryrefslogtreecommitdiffstats
path: root/learn-mac-based-vlan
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2018-07-05 15:29:26 +0200
committerGravatar Christian Hesse <mail@eworm.de>2018-07-05 15:34:08 +0200
commite1f134ead584c7b2e9ed406f5520d7f1a23294aa (patch)
tree929660280fb0acc183401d7e59a40f1cd7e8992c /learn-mac-based-vlan
parent1d99dc38ff1f583d6e46adc5d1ba3455114d53c1 (diff)
add scripts
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;
+};