Difference between revisions of "NOC:ctwug lobridge fixer"
From CTWUG Wiki
Bigmikedavis (talk | contribs) (New page: == Purpose == == Dependencies == == Script == == WMS == Wug Management System) |
Bigmikedavis (talk | contribs) |
||
Line 4: | Line 4: | ||
== Script == | == Script == | ||
+ | :foreach iobridge in=[/interface bridge find name=iobridge] do={ | ||
+ | /interface bridge set $iobridge name=lobridge; | ||
+ | } | ||
+ | |||
+ | :if ([:len [/interface bridge find name=lobridge]]=0) do={ | ||
+ | log info "creating lobridge"; | ||
+ | |||
+ | /interface bridge add name=lobridge; | ||
+ | } | ||
+ | |||
+ | :if ([:len [/ip address find interface=lobridge]]=0) do={ | ||
+ | |||
+ | :local backbonearea [/routing ospf area get [/routing ospf area find area-id=0.0.0.0] name] | ||
+ | |||
+ | log info ("checking backbonearea (".$backbonearea.")"); | ||
+ | |||
+ | :local ospfip "" | ||
+ | :foreach backbone in=[/routing ospf network find area=$backbonearea] do={ | ||
+ | :local bbnet [/routing ospf network get $backbone network] | ||
+ | log info ("checking bbnet (".$bbnet.")"); | ||
+ | |||
+ | :for i from=0 to=([:len $bbnet] - 1) do={ | ||
+ | :if ( [:pick $bbnet $i] = "/") do={ | ||
+ | :local tmp [:pick $bbnet 0 $i] | ||
+ | :set bbnet $tmp; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | log info ("checking bbnet (".$bbnet.")"); | ||
+ | :set ospfip [/ip address get [/ip address find network=$bbnet] address] | ||
+ | } | ||
+ | |||
+ | :for i from=0 to=([:len $ospfip] - 1) do={ | ||
+ | :if ( [:pick $ospfip $i] = "/") do={ | ||
+ | :local tmp [:pick $ospfip 0 $i] | ||
+ | :set ospfip $tmp; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | log info ("current ospf ip (".$ospfip.")"); | ||
+ | |||
+ | /ip address add address=($ospfip."/32") interface=lobridge | ||
+ | } | ||
== WMS == | == WMS == | ||
[[Wug Management System]] | [[Wug Management System]] |
Revision as of 22:25, 7 November 2012
Contents
Purpose
Dependencies
Script
:foreach iobridge in=[/interface bridge find name=iobridge] do={ /interface bridge set $iobridge name=lobridge; } :if ([:len [/interface bridge find name=lobridge]]=0) do={ log info "creating lobridge"; /interface bridge add name=lobridge; } :if ([:len [/ip address find interface=lobridge]]=0) do={ :local backbonearea [/routing ospf area get [/routing ospf area find area-id=0.0.0.0] name] log info ("checking backbonearea (".$backbonearea.")"); :local ospfip "" :foreach backbone in=[/routing ospf network find area=$backbonearea] do={ :local bbnet [/routing ospf network get $backbone network] log info ("checking bbnet (".$bbnet.")"); :for i from=0 to=([:len $bbnet] - 1) do={ :if ( [:pick $bbnet $i] = "/") do={ :local tmp [:pick $bbnet 0 $i] :set bbnet $tmp; } } log info ("checking bbnet (".$bbnet.")"); :set ospfip [/ip address get [/ip address find network=$bbnet] address] } :for i from=0 to=([:len $ospfip] - 1) do={ :if ( [:pick $ospfip $i] = "/") do={ :local tmp [:pick $ospfip 0 $i] :set ospfip $tmp; } } log info ("current ospf ip (".$ospfip.")"); /ip address add address=($ospfip."/32") interface=lobridge }