Skip to content

Instantly share code, notes, and snippets.

@ppmathis
Last active May 25, 2016 20:43
Show Gist options
  • Select an option

  • Save ppmathis/4baa30a4177e7919513f52f39e6bef95 to your computer and use it in GitHub Desktop.

Select an option

Save ppmathis/4baa30a4177e7919513f52f39e6bef95 to your computer and use it in GitHub Desktop.
IPv6 RA Default Gateway for Mikrotik devices
:local "v6ra-router" [:toid ([/ipv6 neighbor find where router]->0)]
:if ([:typeof $"v6ra-router"] = "nil") do={
:error "No IPv6 neighbor with router flag found, can not set default gateway!"
}
:local "v6ra-address" [/ipv6 neighbor get $"v6ra-router" address]
:local "v6ra-interface" [/ipv6 neighbor get $"v6ra-router" interface]
/ipv6 route set [find where comment="Default Gateway (RA)"] gateway="$(v6ra-address)%$(v6ra-interface)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment