Hi there!
I would like to script my new "hEX s" Buddies (65 so far ... more to come) with some settings to make life easier ...
I alreday have the settings I need for SNMP, Firewall, Upgrade and so on.
Runs pretty need and I do find the logic of the SSH commands usefull.
But! I would like to change the last thing I have to manually adjust on each Router: the Identity
Each Router gets it's WAN IP from my Firewall via DHCP Reservation = 192.168.160.50 ... 192.168.160.51 ... 192.168.160.52 ... you get the picture ...
Now I would like to name (Hostname / Identity) each Router with "MT-%%%" - where as "%%%" ist the last part of the IP-Address ...
Examples:
Router with the WAN IP Address: 192.168.160.50 gets the Identity "MT-50"
Router with the WAN IP Address: 192.168.160.51 gets the Identity "MT-51"
Router with the WAN IP Address: 192.168.160.52 gets the Identity "MT-52"
Catch my drift?
Now, If some of you Script-Masters would be so kind and show me the correct way of doing this?
I found an Script (Snippet) for the MAC-Addres, but for the Love of God I've been trying for two hours now to change it for the IP-Address ...
[admin@MT-XXX] > :global IDENTITY [interface ethernet get ether1 mac-address ]
[admin@MT-XXX] > :env print
IDENTITY="2C:C8:1B:42:17:77"
Any Idea?