From e1f134ead584c7b2e9ed406f5520d7f1a23294aa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 5 Jul 2018 15:29:26 +0200 Subject: add scripts --- learn-mac-based-vlan | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 learn-mac-based-vlan (limited to 'learn-mac-based-vlan') 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 +# +# 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; +}; -- cgit v1.2.3-70-g09d2