Category Archives: Uncategorized

The basics of reading and writing files in RouterOS

My good friend Greg was asking about how to store data to files onboard a MikroTik device so I thought I’d elaborate here with some information and examples.

Before we get started, some things to note:

  1. While you can fetch and read the contents of any file, you are limited to working with 4096 character files as this is a limitation on the amount of information that can be contained in a string variable in RouterOS at this time.
  2. When creating new files in RouterOS via terminal the extension .txt will be appended to anything that doesn’t already have .txt at the end.
  3. You can work with newlines \n\r as delimeters (which is super helpful when downloading something list of IP addresses from somewhere)

The basic commands for working with a file, using variables in place of static content or file names:
1. To create a new file

/file print file=$filename

2. To read an existing file

:set $filedata [/file get $filename contents]

3. To write to an existing file

/file set $filename contents=$newdata

4. To append to an existing file

/file set $filename contents=([get $filename contents] . $newdata)

TheBrothersWISP 27 – US MUM 2016, Switches, Upcoming Events

We are back peeps! Greg, Mike, Justin Miller, Justin Wilson, Alex, Tomas, and Tom chat about a few important things, and a lot of everything else. We gave a shout out to a few new people we’ve met, but please forgive me for forgetting a few(looking at you forestry service guys and Costa Ricans).

Topics include:

  • US MUM Hardware
  • US MUM Presentations
  • US MUM Announcements
  • Switches(CRS, EdgeSwitch, UnifiSwitch, etc)
  • Ubiquiti AmpliFi
  • Security FlowSpec
  • Unimus – backup system – http://unimus.net/
  • StrayaNet – MDU ISP – http://StrayaNet.com
  • Here’s the video:(if you don’t see it, hit refresh)

    TheBrothersWISP – The Guys Go To WISPAmerica 2016

    Spoiler alert, Mike has some new recording equipment, so let’s see what he does with it.

    Mike, Wilson and Miller went to WISPAmerica 2016 in Louisville, KY last week. We came out with six interviews that are of far better quality than last fall in Vegas. The show just started a week ago and we already have 3/5ths of the views of the new videos. We interviewed Baicells, Mimosa, VISP, Trango, IgniteNet and TowerOne.

    Here’s the video:(if you don’t see it, hit refresh)

    TheBrothersWISP 25 – Wireless Gear, Monitoring, SDN

    Mike(Mom), Tom, Tomas, Justin Miller, and Alex talk about how much they wish Greg was no this cast…but alas, he is not.

    Some of the things discussed:
    WISPAPalooza video interviews
    WISPAPalooza in general
    Cambium ePMP
    ICANN
    Mimosa B11
    AirFiber NxN
    Docker
    NetXMS
    The Dude
    SDN\OpenFlow\Performant Networks\Bonding\ etc.
    New TBW formats
    Other stuff I probably forgot

    Here’s the video:(if you don’t see it, hit refresh)