Open source MAC Telnet client and server for connecting to Microtik RouterOS routers and Posix machines via MAC address.
C Makefile
Failed to load latest commit information.
config Removed .deb specific files and updated makefile/readme Feb 27, 2011
docs Completed functional autologin support. Jun 30, 2013
po Added "batch-mode" output for mactelnet -l option. Added interface in… Jan 13, 2013
LICENSE GPL'd it Sep 26, 2010
Makefile Added Makefile changes from antwal's fork May 19, 2016
README.markdown Added Makefile changes from antwal's fork May 19, 2016
autologin.c Fix of an uninitialized variable May 19, 2016
autologin.h Completed functional autologin support. Jun 30, 2013
config.h Update version to 0.4.3 May 19, 2016
console.c Cleaned up description and synopsis of files May 1, 2011
console.h Cleaned up description and synopsis of files May 1, 2011
interfaces.c Changes to build everything on OS X May 14, 2016
interfaces.h Changed to doubly linked list, for faster append/delete functionality. Dec 17, 2014
macping.c Changes to build everything on OS X May 14, 2016
mactelnet.c Changes to build everything on OS X May 14, 2016
mactelnet.h Cleaned up description and synopsis of files May 1, 2011
mactelnetd.c Changes to build everything on OS X May 14, 2016
md5.c Removed dependency of libssl/crypto. Added L. Peter Deutsch's impleme… Nov 1, 2010
md5.h Removed dependency of libssl/crypto. Added L. Peter Deutsch's impleme… Nov 1, 2010
mndp.c Changes to build everything on OS X May 14, 2016
mndp.h Added "batch-mode" output for mactelnet -l option. Added interface in… Jan 13, 2013
protocol.c Changes to build everything on OS X May 14, 2016
protocol.h port to freebsd Feb 3, 2014
users.c Use linked list for credentials too Dec 17, 2014
users.h Use linked list for credentials too Dec 17, 2014
utlist.h First time i downloaded utlist.h it was kind of corrupted. This is th… Dec 17, 2014

README.markdown

MAC-Telnet for Posix systems

Console tools for connecting to, and serving, devices using MikroTik RouterOS MAC-Telnet protocol.

Installation

Linux / kfreebsd

Download source tarball, extract, compile and install:

wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master
tar zxvf haakonness*.tar.gz
cd haakonness*/
make all install

Now you're ready.

Mac OS X

Install dependencies, download source tarball, extract, compile and install:

wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master
tar zxvf haakonness*.tar.gz
cd haakonness*/

# Install dependencies
brew install gettext

# Check what paths it tells you to use, for a standard install, the following should suffice:
make LDFLAGS=-L/usr/local/opt/gettext/lib CFLAGS=-I/usr/local/opt/gettext/include all install

And you are ready..

Usage

# mactelnet -h
Usage: mactelnet <MAC|identity> [-h] [-n] [-t <timeout>] [-u <user>] [-p <password>] [-U <user>] | -l

Parameters:
  MAC            MAC-Address of the RouterOS/mactelnetd device. Use mndp to
                 discover it.
  identity       The identity/name of your destination device. Uses
                 MNDP protocol to find it.
  -l             List/Search for routers nearby. (using MNDP)
  -n             Do not use broadcast packets. Less insecure but requires
                 root privileges.
  -t <timeout>   Amount of seconds to wait for a response on each interface.
  -u <user>      Specify username on command line.
  -p <password>  Specify password on command line.
  -U <user>      Drop privileges to this user. Used in conjunction with -n
                 for security.
  -q             Quiet mode.
  -h             This help.

Example:

$ mactelnet 0:c:42:43:58:a5 -u admin
Password: 
Connecting to 0:c:42:43:58:a5...done


  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
  MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK
  MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK
  MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK
  MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK
  MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK

  MikroTik RouterOS 4.0 (c) 1999-2009       http://www.mikrotik.com/


 [admin@HMG] >

Tips

You can use the well known "expect" tool to automate/script dialogues via mactelnet!

List available hosts

# mactelnet -l

MAC-Ping usage

# macping -h
Usage: macping <MAC> [-h] [-c <count>] [-s <packet size>]

Parameters:
  MAC       MAC-Address of the RouterOS/mactelnetd device.
  -s        Specify size of ping packet.
  -c        Number of packets to send. (0 = for ever)
  -h        This help.

Example:

# macping 0:c:42:43:58:a5
0:c:42:43:58:a5 56 byte, ping time 1.17 ms
0:c:42:43:58:a5 56 byte, ping time 1.07 ms
0:c:42:43:58:a5 56 byte, ping time 1.20 ms
0:c:42:43:58:a5 56 byte, ping time 0.65 ms
0:c:42:43:58:a5 56 byte, ping time 1.19 ms

5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.65/1.06/1.20 ms

Or for use in bash-scripting:

# macping 0:c:42:43:58:a5 -c 2 >/dev/null 2>&1 || ( echo "No answer for 2 pings" | mail -s "router down" my.email@address.com )