Skip to content

sg3des/mikrotik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mikrotik/RouterOS API Client

WIP

Common methods fully workable, but not all API elements released.

install:

go get -u github.com/sg3des/mikrotik

usage:

router, err := mikrotik.Dial(addr, user, pass)
// OR
router, err := mikrotik.DialTimeout(addr, user, pass, timeout)

API methods are presented how a tree, similar to the CLI commands RouterOS.

//get router name
router.System.Identity.Name()

//add ip address
ip := mikrotik.IPAddress{Address: ..., Interface: ...}
router.IP.Address.Add(&ip)

//get all network interfaces
var intfs []mikrotik.Interface
router.Interface.List(&intfs)

Most methods accepts a pointer on the appropriate structure, example: mikrotik.IPAddress , mikrotik.NATRule etc... Structure field names can by founded by tag mikrotik. If tag not specified, go field name auto convert to RouterOS like format, example: FieldName converted to field-name, and back.

About

Human API Client for RouterOS/Mikrotik

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages