Beginner question: How do I retrieve the current mac address of ether1 into a string variable?
The MAC address I need is the RouterBoard MAC, not the attached device.
Beginner question: How do I retrieve the current mac address of ether1 into a string variable?
The MAC address I need is the RouterBoard MAC, not the attached device.
Ok, I think I figured it out
:global mac [/interface ethernet get 0 orig-mac-address]
:put $mac
New problem. The terminal freezes on me repeatedly with “Internal Server Error”.
Any idea why this would occur?
I’ve never seen the error, but you should use
get [find where name=“ether1”]
instead of using
get 0
Sent from my SM-G955W using Tapatalk
As Jonah writes, never ever use the ID of any object directly, it will change from time to time.
Only use global variable if you need variables to work in other scripts or you like to save it outside the script for later use.
So:
{
:local mac [/interface ethernet get [find where name="ether1"] orig-mac-address]
:put $mac
}
Thanks for the help/replies and info.
FYI, the last issue described above was due to DHCP lease time being set to 10 seconds, not 10 minutes.