{"id":2012,"date":"2018-06-12T04:42:56","date_gmt":"2018-06-12T04:42:56","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=2012"},"modified":"2018-06-12T04:44:53","modified_gmt":"2018-06-12T04:44:53","slug":"add-multiple-ip-bindings-to-mikrotik-hotspot-bash-script","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/add-multiple-ip-bindings-to-mikrotik-hotspot-bash-script\/","title":{"rendered":"Add multiple IP bindings to Mikrotik Hotspot &#8211; Bash Script"},"content":{"rendered":"<p>Copy and paste the following into a file named mtbypass.sh and then &#8220;chmod +x mtbypass.sh&#8221;\u00a0 Or download from this direct <a href=\"http:\/\/www.incredigeek.com\/home\/downloads\/mtbypass\/mtbypass.sh\">link<\/a>.\u00a0 Be sure to change the username and password<\/p>\n<pre>#!bin\/bash\r\nfilelist=\"bypasslist.txt\"\r\nusername=\"admin\"\r\npassword=\"password!\"\r\nip=\"$1\"\r\n\r\nfor i in `cat ${filelist}`\r\ndo\r\naddress=`echo $i | cut -d= -f1`\r\nmac=`echo $i | cut -d= -f2`\r\nsshpass -p ${password} ssh ${username}@${ip} \"ip hotspot ip-binding add address=${address} mac-address=${mac} type=bypassed\"\r\ndone<\/pre>\n<p>Now create a file named bypasslist.txt and put all the addresses you want bypassed.\u00a0 You&#8217;ll need the Mac Address and the IP Address.<\/p>\n<p>Example file<\/p>\n<pre>192.168.88.2=4C:5E:0C:B8:4E:01\r\n192.168.88.3=3E:AA:A1:2D:8B:2C\r\n192.168.88.5=DE:D1:39:65:91:4E<\/pre>\n<p>Usage of script is<\/p>\n<pre>.\/mtbypass.sh MikrotikIP<\/pre>\n<p>Example:<\/p>\n<pre>.\/mtbypass.sh 192.168.88.1<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Copy and paste the following into a file named mtbypass.sh and then &#8220;chmod +x mtbypass.sh&#8221;\u00a0 Or download from this direct link.\u00a0 Be sure to change the username and password #!bin\/bash filelist=&#8221;bypasslist.txt&#8221; username=&#8221;admin&#8221; password=&#8221;password!&#8221; ip=&#8221;$1&#8243; for i in `cat ${filelist}` do &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/add-multiple-ip-bindings-to-mikrotik-hotspot-bash-script\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,452],"tags":[211,453,7,301,405],"class_list":["post-2012","post","type-post","status-publish","format-standard","hentry","category-linux","category-mikrotik","tag-bash","tag-hotspot","tag-linux-2","tag-mikrotik","tag-scripting"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=2012"}],"version-history":[{"count":3,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2012\/revisions"}],"predecessor-version":[{"id":2016,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2012\/revisions\/2016"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=2012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=2012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=2012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}