network-utility 1.1.49 → 1.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/document/bgp-CR16010H-F.md +12 -8
  3. data/document/bgp-CR16018-F.md +12 -8
  4. data/document/bgp-CR19000-20.md +12 -8
  5. data/document/bgp-M6000-16E.md +8 -8
  6. data/document/bgp-M6000-18S.md +8 -8
  7. data/document/bgp-M6000-8.md +8 -8
  8. data/document/bgp-M6000-8E.md +8 -8
  9. data/document/bgp-MA5200G-8.md +12 -8
  10. data/document/bgp-ME60-16.md +12 -8
  11. data/document/bgp-ME60-X16.md +12 -8
  12. data/document/bgp-NE40E-X16.md +12 -8
  13. data/document/bgp-NE40E-X16A.md +12 -8
  14. data/document/bgp-NE40E-X8.md +12 -8
  15. data/document/bgp-NE40E.md +12 -8
  16. data/document/bgp-NE5000E-20.md +12 -8
  17. data/document/bgp-NE5000E-X16.md +12 -8
  18. data/document/bgp-NE5000E-X16A.md +12 -8
  19. data/document/bgp-NE80E.md +12 -8
  20. data/document/bgp-T8000-18.md +24 -0
  21. data/document/config.md +45 -44
  22. data/document/if-ALCATEL7750.md +174 -12
  23. data/document/if-CRS-16.md +54 -2
  24. data/document/if-Nokia7750.md +174 -12
  25. data/document/isis-NE5000E-20.md +141 -0
  26. data/document/isis-NE5000E-X16.md +141 -0
  27. data/document/isis-NE5000E-X16A.md +141 -0
  28. data/document/pool-ALCATEL7750.md +20 -0
  29. data/document/pool-CR16010H-F.md +108 -0
  30. data/document/pool-CR16018-F.md +108 -0
  31. data/document/pool-Nokia7750.md +20 -0
  32. data/document/pool-V6000.md +126 -0
  33. data/document/pool-VNE9000.md +63 -0
  34. data/document/static-ALCATEL7750.md +32 -0
  35. data/document/static-CR16010H-F.md +2 -2
  36. data/document/static-CR16018-F.md +2 -2
  37. data/document/static-CRS-16.md +40 -0
  38. data/document/static-Nokia7750.md +32 -0
  39. data/document/static-V6000.md +34 -0
  40. data/document/static-VNE9000.md +28 -0
  41. data/network.rb +1 -1
  42. data/utility/ipv4_address.rb +16 -0
  43. metadata +16 -1
@@ -0,0 +1,141 @@
1
+
2
+ # NE5000E-20 isis
3
+
4
+ ```ruby
5
+ @sign << ['NE5000E-20', '接口isis']
6
+ @sign << ['NE5000E-20', 'isis']
7
+
8
+ module NE5000E_20
9
+ module_function
10
+
11
+ def 接口isis 接口配置
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
15
+ lines.each do|line|
16
+ isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
17
+ isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
18
+ isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('isis circuit-type')
19
+ isis['cost'] = line.strip.split(' ').last.to_i if line.include?('isis cost')
20
+ isis['ipv6-cost'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 cost')
21
+ if line.include?('isis ldp-sync')
22
+ isis['ldp-sync'] ||= {}
23
+ isis['ldp-sync']['state'] = 'enable'
24
+ isis['ldp-sync']['hold-max-cost-timer'] = line.strip.split(' ').last+'s' if line.include?('isis timer ldp-sync')
25
+ end
26
+ isis['hold-max-cost-timer'] = line.strip.split(' ').last+'ms' if line.include?('isis peer hold-max-cost')
27
+ end
28
+ return { port_name => isis }
29
+ end
30
+
31
+ def isis isis配置
32
+ isis = {};frr4_flag, frr6_flag = false, false
33
+ isis配置.split("\n").each do|line|
34
+ isis['pid'] = line.split(' ').last.strip if line[0..4]=='isis '
35
+ isis['level'] = line.split(' ').last.strip if line.include?('is-level')
36
+ isis['cost-style'] = line.split(' ').last.strip if line.include?('cost-style')
37
+ if line.include?('timer lsp-generation')
38
+ isis['lsp-generation-timer'] ||= {}
39
+ setter = line.split('lsp-generation').last.strip.split(' ')
40
+ setlevels = []
41
+ setlevels = ['level-1'] if setter[-1]=='level-1'
42
+ setlevels = ['level-2'] if setter[-1]=='level-2'
43
+ setlevels = ['level-1', 'level-2']
44
+ setlevels.each do|setlevel|
45
+ isis['lsp-generation-timer']['max-interval'] = setter[0]+'s'
46
+ isis['lsp-generation-timer']['init-interval'] = setter[1]+'ms' if setter[1] && !setter[1].include?('level')
47
+ isis['lsp-generation-timer']['incr-interval'] = setter[2]+'ms' if setter[2] && !setter[2].include?('level')
48
+ end
49
+ end
50
+ if line.include?('bfd all-interfaces') && line.strip[0..2]=='bfd'
51
+ isis['bfd'] ||= {}
52
+ isis['bfd']['interface'] = 'enable' if line.include?('enable')
53
+ words = line.split(' ')
54
+ isis['bfd']['min-tx-interval'] = words[words.index('min-tx-interval')+1] + 'ms' if words.index('min-tx-interval')
55
+ isis['bfd']['min-rx-interval'] = words[words.index('min-rx-interval')+1] + 'ms' if words.index('min-rx-interval')
56
+ isis['bfd']['detect-multiplier'] = words[words.index('detect-multiplier')+1].to_i if words.index('detect-multiplier')
57
+ isis['bfd']['tos-exp'] = words[words.index('tos-exp')+1].to_i if words.index('tos-exp')
58
+ isis['bfd']['frr-binding'] = 'enable' if line.include?('frr-binding')
59
+ end
60
+ if line.include?('ipv6 bfd all-interfaces')
61
+ isis['ipv6-bfd'] ||= {}
62
+ isis['ipv6-bfd']['interface'] = 'enable' if line.include?('enable')
63
+ words = line.split(' ')
64
+ isis['ipv6-bfd']['min-tx-interval'] = words[words.index('min-tx-interval')+1] + 'ms' if words.index('min-tx-interval')
65
+ isis['ipv6-bfd']['min-rx-interval'] = words[words.index('min-rx-interval')+1] + 'ms' if words.index('min-rx-interval')
66
+ isis['ipv6-bfd']['detect-multiplier'] = words[words.index('detect-multiplier')+1].to_i if words.index('detect-multiplier')
67
+ isis['ipv6-bfd']['frr-binding'] = 'enable' if line.include?('frr-binding')
68
+ end
69
+ isis['net'] = line.split(' ').last if line.include?('network-entity')
70
+ isis['is-name'] = line.split(' ').last if line.include?('is-name')
71
+ if line.include?('avoid-microloop') && line.strip[0..4]=='avoid'
72
+ isis['avoid-microloop'] ||= {}
73
+ isis['avoid-microloop']['frr-protected'] ||= {'rib-update-delay'=>'100ms'} if line.include?('frr-protected')
74
+ isis['avoid-microloop']['frr-protected']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('frr-protected') && line.include?('rib-update-delay')
75
+ isis['avoid-microloop']['te-tunnel'] ||= {'rib-update-delay'=>'1000ms'} if line.include?('te-tunnel')
76
+ isis['avoid-microloop']['te-tunnel']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('te-tunnel') && line.include?('rib-update-delay')
77
+ end
78
+ if line.include?('ipv6 avoid-microloop')
79
+ isis['ipv6-avoid-microloop'] ||= {}
80
+ isis['ipv6-avoid-microloop']['segment-routing'] ||= {'rib-update-delay'=>'5000ms'} if line.include?('segment-routing')
81
+ isis['ipv6-avoid-microloop']['segment-routing']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('segment-routing') && line.include?('rib-update-delay')
82
+ end
83
+ isis['preference'] = line.split(' ').last.to_i if line.strip[0..10]=='preference '
84
+ isis['ipv6-preference'] = line.split(' ').last.to_i if line.include?('ipv6 preference ')
85
+ if line.include?('timer spf')
86
+ setter = line.split('timer spf').last.strip.split(' ')
87
+ isis['spf-timer'] ||= {}
88
+ isis['spf-timer']['max-interval'] = setter[0]+'s'
89
+ isis['spf-timer']['init-interval'] = setter[1]+'ms' if setter[1]
90
+ isis['spf-timer']['incr-interval'] = setter[2]+'ms' if setter[2]
91
+ end
92
+ if line.include?('set-overload')
93
+ isis['set-overload'] ||= {}
94
+ isis['set-overload']['allow'] = 'interlevel' if line.include?('allow interlevel')
95
+ isis['set-overload']['allow'] = 'external' if line.include?('allow external')
96
+ isis['set-overload']['on-startup'] ||= {} if line.include?('on-startup')
97
+ words = line.strip.split(' ')
98
+ if line.include?('on-startup') && words[words.index('on-startup')+1].to_s.match(/^\d+$/)
99
+ isis['set-overload']['on-startup']['timeout'] = words[words.index('on-startup')+1]+'s'
100
+ else
101
+ # isis['set-overload']['on-startup']['timeout'] = '600s'
102
+ if line.include?('send-sa-bit') && words[words.index('send-sa-bit')+1].match(/^\d+$/)
103
+ isis['set-overload']['on-startup']['send-sa-bit'] = words[words.index('send-sa-bit')+1]+'s'
104
+ else
105
+ # isis['set-overload']['on-startup']['send-sa-bit'] = '30s'
106
+ end
107
+ # TODO: start-from-nbr | wait-for-bgp | route-delay-distribute
108
+ end
109
+ end
110
+ (isis['frr'] = {}; frr4_flag = true) if line.strip=='frr'
111
+ isis['frr']['loop-free-alternate'] = line.split(' ').last if line.include?('loop-free-alternate ') && frr4_flag
112
+ isis['frr']['ti-lfa'] = line.split(' ').last if line.include?('ti-lfa ') && frr4_flag
113
+ (frr4_flag = false) if frr4_flag && line==' #'
114
+ (isis['ipv6-frr'] = {}; frr6_flag = true) if line.include?('ipv6 frr')
115
+ isis['ipv6-frr']['loop-free-alternate'] = line.split(' ').last if line.include?('loop-free-alternate ') && frr6_flag
116
+ isis['ipv6-frr']['ti-lfa'] = line.split(' ').last if line.include?('ti-lfa ') && frr6_flag
117
+ (frr6_flag = false) if frr6_flag && line==' #'
118
+ isis['topology'] = line.split('topology ').last.strip if line.include?('ipv6 enable topology ')
119
+ isis['ipv6-advertise'] = 'link-attributes' if line.include?('ipv6 advertise link attributes')
120
+ isis['ipv6-traffic-eng'] = line.split(' ').last if line.include?('ipv6 traffic-eng')
121
+ if line.include?('ipv6 metric-delay')
122
+ isis['ipv6-metric-delay'] ||= {}
123
+ isis['ipv6-metric-delay']['advertisement'] = line.split(' ').last if line.include?('advertisement enable')
124
+ if line.include?('suppress')
125
+ words = line.split(' ')
126
+ isis['ipv6-metric-delay']['suppress'] ||= {}
127
+ isis['ipv6-metric-delay']['suppress']['timer'] = words[words.index('timer')+1]+'s' if words.index('timer')
128
+ isis['ipv6-metric-delay']['suppress']['percent-threshold'] = words[words.index('percent-threshold')+1]+'%' if words.index('percent-threshold')
129
+ isis['ipv6-metric-delay']['suppress']['absolute-threshold'] = words[words.index('absolute-threshold')+1]+'ms' if words.index('absolute-threshold')
130
+ end
131
+ end
132
+ if line.include?('segment-routing ipv6 locator')
133
+ isis['srv6-locator'] ||= {}
134
+ isis['srv6-locator']['name'] = line.split('locator').last.strip.split(' ').first
135
+ isis['srv6-locator']['auto-sid-disable'] = true if line.split('locator').last.strip.split(' ')[1]
136
+ end
137
+ end
138
+ return isis
139
+ end
140
+ end
141
+ ```
@@ -0,0 +1,141 @@
1
+
2
+ # NE5000E-X16 isis
3
+
4
+ ```ruby
5
+ @sign << ['NE5000E-X16', '接口isis']
6
+ @sign << ['NE5000E-X16', 'isis']
7
+
8
+ module NE5000E_X16
9
+ module_function
10
+
11
+ def 接口isis 接口配置
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
15
+ lines.each do|line|
16
+ isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
17
+ isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
18
+ isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('isis circuit-type')
19
+ isis['cost'] = line.strip.split(' ').last.to_i if line.include?('isis cost')
20
+ isis['ipv6-cost'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 cost')
21
+ if line.include?('isis ldp-sync')
22
+ isis['ldp-sync'] ||= {}
23
+ isis['ldp-sync']['state'] = 'enable'
24
+ isis['ldp-sync']['hold-max-cost-timer'] = line.strip.split(' ').last+'s' if line.include?('isis timer ldp-sync')
25
+ end
26
+ isis['hold-max-cost-timer'] = line.strip.split(' ').last+'ms' if line.include?('isis peer hold-max-cost')
27
+ end
28
+ return { port_name => isis }
29
+ end
30
+
31
+ def isis isis配置
32
+ isis = {};frr4_flag, frr6_flag = false, false
33
+ isis配置.split("\n").each do|line|
34
+ isis['pid'] = line.split(' ').last.strip if line[0..4]=='isis '
35
+ isis['level'] = line.split(' ').last.strip if line.include?('is-level')
36
+ isis['cost-style'] = line.split(' ').last.strip if line.include?('cost-style')
37
+ if line.include?('timer lsp-generation')
38
+ isis['lsp-generation-timer'] ||= {}
39
+ setter = line.split('lsp-generation').last.strip.split(' ')
40
+ setlevels = []
41
+ setlevels = ['level-1'] if setter[-1]=='level-1'
42
+ setlevels = ['level-2'] if setter[-1]=='level-2'
43
+ setlevels = ['level-1', 'level-2']
44
+ setlevels.each do|setlevel|
45
+ isis['lsp-generation-timer']['max-interval'] = setter[0]+'s'
46
+ isis['lsp-generation-timer']['init-interval'] = setter[1]+'ms' if setter[1] && !setter[1].include?('level')
47
+ isis['lsp-generation-timer']['incr-interval'] = setter[2]+'ms' if setter[2] && !setter[2].include?('level')
48
+ end
49
+ end
50
+ if line.include?('bfd all-interfaces') && line.strip[0..2]=='bfd'
51
+ isis['bfd'] ||= {}
52
+ isis['bfd']['interface'] = 'enable' if line.include?('enable')
53
+ words = line.split(' ')
54
+ isis['bfd']['min-tx-interval'] = words[words.index('min-tx-interval')+1] + 'ms' if words.index('min-tx-interval')
55
+ isis['bfd']['min-rx-interval'] = words[words.index('min-rx-interval')+1] + 'ms' if words.index('min-rx-interval')
56
+ isis['bfd']['detect-multiplier'] = words[words.index('detect-multiplier')+1].to_i if words.index('detect-multiplier')
57
+ isis['bfd']['tos-exp'] = words[words.index('tos-exp')+1].to_i if words.index('tos-exp')
58
+ isis['bfd']['frr-binding'] = 'enable' if line.include?('frr-binding')
59
+ end
60
+ if line.include?('ipv6 bfd all-interfaces')
61
+ isis['ipv6-bfd'] ||= {}
62
+ isis['ipv6-bfd']['interface'] = 'enable' if line.include?('enable')
63
+ words = line.split(' ')
64
+ isis['ipv6-bfd']['min-tx-interval'] = words[words.index('min-tx-interval')+1] + 'ms' if words.index('min-tx-interval')
65
+ isis['ipv6-bfd']['min-rx-interval'] = words[words.index('min-rx-interval')+1] + 'ms' if words.index('min-rx-interval')
66
+ isis['ipv6-bfd']['detect-multiplier'] = words[words.index('detect-multiplier')+1].to_i if words.index('detect-multiplier')
67
+ isis['ipv6-bfd']['frr-binding'] = 'enable' if line.include?('frr-binding')
68
+ end
69
+ isis['net'] = line.split(' ').last if line.include?('network-entity')
70
+ isis['is-name'] = line.split(' ').last if line.include?('is-name')
71
+ if line.include?('avoid-microloop') && line.strip[0..4]=='avoid'
72
+ isis['avoid-microloop'] ||= {}
73
+ isis['avoid-microloop']['frr-protected'] ||= {'rib-update-delay'=>'100ms'} if line.include?('frr-protected')
74
+ isis['avoid-microloop']['frr-protected']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('frr-protected') && line.include?('rib-update-delay')
75
+ isis['avoid-microloop']['te-tunnel'] ||= {'rib-update-delay'=>'1000ms'} if line.include?('te-tunnel')
76
+ isis['avoid-microloop']['te-tunnel']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('te-tunnel') && line.include?('rib-update-delay')
77
+ end
78
+ if line.include?('ipv6 avoid-microloop')
79
+ isis['ipv6-avoid-microloop'] ||= {}
80
+ isis['ipv6-avoid-microloop']['segment-routing'] ||= {'rib-update-delay'=>'5000ms'} if line.include?('segment-routing')
81
+ isis['ipv6-avoid-microloop']['segment-routing']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('segment-routing') && line.include?('rib-update-delay')
82
+ end
83
+ isis['preference'] = line.split(' ').last.to_i if line.strip[0..10]=='preference '
84
+ isis['ipv6-preference'] = line.split(' ').last.to_i if line.include?('ipv6 preference ')
85
+ if line.include?('timer spf')
86
+ setter = line.split('timer spf').last.strip.split(' ')
87
+ isis['spf-timer'] ||= {}
88
+ isis['spf-timer']['max-interval'] = setter[0]+'s'
89
+ isis['spf-timer']['init-interval'] = setter[1]+'ms' if setter[1]
90
+ isis['spf-timer']['incr-interval'] = setter[2]+'ms' if setter[2]
91
+ end
92
+ if line.include?('set-overload')
93
+ isis['set-overload'] ||= {}
94
+ isis['set-overload']['allow'] = 'interlevel' if line.include?('allow interlevel')
95
+ isis['set-overload']['allow'] = 'external' if line.include?('allow external')
96
+ isis['set-overload']['on-startup'] ||= {} if line.include?('on-startup')
97
+ words = line.strip.split(' ')
98
+ if line.include?('on-startup') && words[words.index('on-startup')+1].to_s.match(/^\d+$/)
99
+ isis['set-overload']['on-startup']['timeout'] = words[words.index('on-startup')+1]+'s'
100
+ else
101
+ # isis['set-overload']['on-startup']['timeout'] = '600s'
102
+ if line.include?('send-sa-bit') && words[words.index('send-sa-bit')+1].match(/^\d+$/)
103
+ isis['set-overload']['on-startup']['send-sa-bit'] = words[words.index('send-sa-bit')+1]+'s'
104
+ else
105
+ # isis['set-overload']['on-startup']['send-sa-bit'] = '30s'
106
+ end
107
+ # TODO: start-from-nbr | wait-for-bgp | route-delay-distribute
108
+ end
109
+ end
110
+ (isis['frr'] = {}; frr4_flag = true) if line.strip=='frr'
111
+ isis['frr']['loop-free-alternate'] = line.split(' ').last if line.include?('loop-free-alternate ') && frr4_flag
112
+ isis['frr']['ti-lfa'] = line.split(' ').last if line.include?('ti-lfa ') && frr4_flag
113
+ (frr4_flag = false) if frr4_flag && line==' #'
114
+ (isis['ipv6-frr'] = {}; frr6_flag = true) if line.include?('ipv6 frr')
115
+ isis['ipv6-frr']['loop-free-alternate'] = line.split(' ').last if line.include?('loop-free-alternate ') && frr6_flag
116
+ isis['ipv6-frr']['ti-lfa'] = line.split(' ').last if line.include?('ti-lfa ') && frr6_flag
117
+ (frr6_flag = false) if frr6_flag && line==' #'
118
+ isis['topology'] = line.split('topology ').last.strip if line.include?('ipv6 enable topology ')
119
+ isis['ipv6-advertise'] = 'link-attributes' if line.include?('ipv6 advertise link attributes')
120
+ isis['ipv6-traffic-eng'] = line.split(' ').last if line.include?('ipv6 traffic-eng')
121
+ if line.include?('ipv6 metric-delay')
122
+ isis['ipv6-metric-delay'] ||= {}
123
+ isis['ipv6-metric-delay']['advertisement'] = line.split(' ').last if line.include?('advertisement enable')
124
+ if line.include?('suppress')
125
+ words = line.split(' ')
126
+ isis['ipv6-metric-delay']['suppress'] ||= {}
127
+ isis['ipv6-metric-delay']['suppress']['timer'] = words[words.index('timer')+1]+'s' if words.index('timer')
128
+ isis['ipv6-metric-delay']['suppress']['percent-threshold'] = words[words.index('percent-threshold')+1]+'%' if words.index('percent-threshold')
129
+ isis['ipv6-metric-delay']['suppress']['absolute-threshold'] = words[words.index('absolute-threshold')+1]+'ms' if words.index('absolute-threshold')
130
+ end
131
+ end
132
+ if line.include?('segment-routing ipv6 locator')
133
+ isis['srv6-locator'] ||= {}
134
+ isis['srv6-locator']['name'] = line.split('locator').last.strip.split(' ').first
135
+ isis['srv6-locator']['auto-sid-disable'] = true if line.split('locator').last.strip.split(' ')[1]
136
+ end
137
+ end
138
+ return isis
139
+ end
140
+ end
141
+ ```
@@ -0,0 +1,141 @@
1
+
2
+ # NE5000E-X16A isis
3
+
4
+ ```ruby
5
+ @sign << ['NE5000E-X16A', '接口isis']
6
+ @sign << ['NE5000E-X16A', 'isis']
7
+
8
+ module NE5000E_X16A
9
+ module_function
10
+
11
+ def 接口isis 接口配置
12
+ isis = {}
13
+ port_name = self.端口识别(接口配置.split("\n").first.to_s).join()
14
+ lines = 接口配置.split("\n").select{|line|line.strip[0..4]=='isis '}
15
+ lines.each do|line|
16
+ isis['pid'] = line.strip.split(' ').last.to_i if line.include?('isis enable')
17
+ isis['ipv6-pid'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 enable')
18
+ isis['circuit-type'] = line.split('circuit-type').last.strip if line.include?('isis circuit-type')
19
+ isis['cost'] = line.strip.split(' ').last.to_i if line.include?('isis cost')
20
+ isis['ipv6-cost'] = line.strip.split(' ').last.to_i if line.include?('isis ipv6 cost')
21
+ if line.include?('isis ldp-sync')
22
+ isis['ldp-sync'] ||= {}
23
+ isis['ldp-sync']['state'] = 'enable'
24
+ isis['ldp-sync']['hold-max-cost-timer'] = line.strip.split(' ').last+'s' if line.include?('isis timer ldp-sync')
25
+ end
26
+ isis['hold-max-cost-timer'] = line.strip.split(' ').last+'ms' if line.include?('isis peer hold-max-cost')
27
+ end
28
+ return { port_name => isis }
29
+ end
30
+
31
+ def isis isis配置
32
+ isis = {};frr4_flag, frr6_flag = false, false
33
+ isis配置.split("\n").each do|line|
34
+ isis['pid'] = line.split(' ').last.strip if line[0..4]=='isis '
35
+ isis['level'] = line.split(' ').last.strip if line.include?('is-level')
36
+ isis['cost-style'] = line.split(' ').last.strip if line.include?('cost-style')
37
+ if line.include?('timer lsp-generation')
38
+ isis['lsp-generation-timer'] ||= {}
39
+ setter = line.split('lsp-generation').last.strip.split(' ')
40
+ setlevels = []
41
+ setlevels = ['level-1'] if setter[-1]=='level-1'
42
+ setlevels = ['level-2'] if setter[-1]=='level-2'
43
+ setlevels = ['level-1', 'level-2']
44
+ setlevels.each do|setlevel|
45
+ isis['lsp-generation-timer']['max-interval'] = setter[0]+'s'
46
+ isis['lsp-generation-timer']['init-interval'] = setter[1]+'ms' if setter[1] && !setter[1].include?('level')
47
+ isis['lsp-generation-timer']['incr-interval'] = setter[2]+'ms' if setter[2] && !setter[2].include?('level')
48
+ end
49
+ end
50
+ if line.include?('bfd all-interfaces') && line.strip[0..2]=='bfd'
51
+ isis['bfd'] ||= {}
52
+ isis['bfd']['interface'] = 'enable' if line.include?('enable')
53
+ words = line.split(' ')
54
+ isis['bfd']['min-tx-interval'] = words[words.index('min-tx-interval')+1] + 'ms' if words.index('min-tx-interval')
55
+ isis['bfd']['min-rx-interval'] = words[words.index('min-rx-interval')+1] + 'ms' if words.index('min-rx-interval')
56
+ isis['bfd']['detect-multiplier'] = words[words.index('detect-multiplier')+1].to_i if words.index('detect-multiplier')
57
+ isis['bfd']['tos-exp'] = words[words.index('tos-exp')+1].to_i if words.index('tos-exp')
58
+ isis['bfd']['frr-binding'] = 'enable' if line.include?('frr-binding')
59
+ end
60
+ if line.include?('ipv6 bfd all-interfaces')
61
+ isis['ipv6-bfd'] ||= {}
62
+ isis['ipv6-bfd']['interface'] = 'enable' if line.include?('enable')
63
+ words = line.split(' ')
64
+ isis['ipv6-bfd']['min-tx-interval'] = words[words.index('min-tx-interval')+1] + 'ms' if words.index('min-tx-interval')
65
+ isis['ipv6-bfd']['min-rx-interval'] = words[words.index('min-rx-interval')+1] + 'ms' if words.index('min-rx-interval')
66
+ isis['ipv6-bfd']['detect-multiplier'] = words[words.index('detect-multiplier')+1].to_i if words.index('detect-multiplier')
67
+ isis['ipv6-bfd']['frr-binding'] = 'enable' if line.include?('frr-binding')
68
+ end
69
+ isis['net'] = line.split(' ').last if line.include?('network-entity')
70
+ isis['is-name'] = line.split(' ').last if line.include?('is-name')
71
+ if line.include?('avoid-microloop') && line.strip[0..4]=='avoid'
72
+ isis['avoid-microloop'] ||= {}
73
+ isis['avoid-microloop']['frr-protected'] ||= {'rib-update-delay'=>'100ms'} if line.include?('frr-protected')
74
+ isis['avoid-microloop']['frr-protected']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('frr-protected') && line.include?('rib-update-delay')
75
+ isis['avoid-microloop']['te-tunnel'] ||= {'rib-update-delay'=>'1000ms'} if line.include?('te-tunnel')
76
+ isis['avoid-microloop']['te-tunnel']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('te-tunnel') && line.include?('rib-update-delay')
77
+ end
78
+ if line.include?('ipv6 avoid-microloop')
79
+ isis['ipv6-avoid-microloop'] ||= {}
80
+ isis['ipv6-avoid-microloop']['segment-routing'] ||= {'rib-update-delay'=>'5000ms'} if line.include?('segment-routing')
81
+ isis['ipv6-avoid-microloop']['segment-routing']['rib-update-delay'] = line.split(' ').last+'ms' if line.include?('segment-routing') && line.include?('rib-update-delay')
82
+ end
83
+ isis['preference'] = line.split(' ').last.to_i if line.strip[0..10]=='preference '
84
+ isis['ipv6-preference'] = line.split(' ').last.to_i if line.include?('ipv6 preference ')
85
+ if line.include?('timer spf')
86
+ setter = line.split('timer spf').last.strip.split(' ')
87
+ isis['spf-timer'] ||= {}
88
+ isis['spf-timer']['max-interval'] = setter[0]+'s'
89
+ isis['spf-timer']['init-interval'] = setter[1]+'ms' if setter[1]
90
+ isis['spf-timer']['incr-interval'] = setter[2]+'ms' if setter[2]
91
+ end
92
+ if line.include?('set-overload')
93
+ isis['set-overload'] ||= {}
94
+ isis['set-overload']['allow'] = 'interlevel' if line.include?('allow interlevel')
95
+ isis['set-overload']['allow'] = 'external' if line.include?('allow external')
96
+ isis['set-overload']['on-startup'] ||= {} if line.include?('on-startup')
97
+ words = line.strip.split(' ')
98
+ if line.include?('on-startup') && words[words.index('on-startup')+1].to_s.match(/^\d+$/)
99
+ isis['set-overload']['on-startup']['timeout'] = words[words.index('on-startup')+1]+'s'
100
+ else
101
+ # isis['set-overload']['on-startup']['timeout'] = '600s'
102
+ if line.include?('send-sa-bit') && words[words.index('send-sa-bit')+1].match(/^\d+$/)
103
+ isis['set-overload']['on-startup']['send-sa-bit'] = words[words.index('send-sa-bit')+1]+'s'
104
+ else
105
+ # isis['set-overload']['on-startup']['send-sa-bit'] = '30s'
106
+ end
107
+ # TODO: start-from-nbr | wait-for-bgp | route-delay-distribute
108
+ end
109
+ end
110
+ (isis['frr'] = {}; frr4_flag = true) if line.strip=='frr'
111
+ isis['frr']['loop-free-alternate'] = line.split(' ').last if line.include?('loop-free-alternate ') && frr4_flag
112
+ isis['frr']['ti-lfa'] = line.split(' ').last if line.include?('ti-lfa ') && frr4_flag
113
+ (frr4_flag = false) if frr4_flag && line==' #'
114
+ (isis['ipv6-frr'] = {}; frr6_flag = true) if line.include?('ipv6 frr')
115
+ isis['ipv6-frr']['loop-free-alternate'] = line.split(' ').last if line.include?('loop-free-alternate ') && frr6_flag
116
+ isis['ipv6-frr']['ti-lfa'] = line.split(' ').last if line.include?('ti-lfa ') && frr6_flag
117
+ (frr6_flag = false) if frr6_flag && line==' #'
118
+ isis['topology'] = line.split('topology ').last.strip if line.include?('ipv6 enable topology ')
119
+ isis['ipv6-advertise'] = 'link-attributes' if line.include?('ipv6 advertise link attributes')
120
+ isis['ipv6-traffic-eng'] = line.split(' ').last if line.include?('ipv6 traffic-eng')
121
+ if line.include?('ipv6 metric-delay')
122
+ isis['ipv6-metric-delay'] ||= {}
123
+ isis['ipv6-metric-delay']['advertisement'] = line.split(' ').last if line.include?('advertisement enable')
124
+ if line.include?('suppress')
125
+ words = line.split(' ')
126
+ isis['ipv6-metric-delay']['suppress'] ||= {}
127
+ isis['ipv6-metric-delay']['suppress']['timer'] = words[words.index('timer')+1]+'s' if words.index('timer')
128
+ isis['ipv6-metric-delay']['suppress']['percent-threshold'] = words[words.index('percent-threshold')+1]+'%' if words.index('percent-threshold')
129
+ isis['ipv6-metric-delay']['suppress']['absolute-threshold'] = words[words.index('absolute-threshold')+1]+'ms' if words.index('absolute-threshold')
130
+ end
131
+ end
132
+ if line.include?('segment-routing ipv6 locator')
133
+ isis['srv6-locator'] ||= {}
134
+ isis['srv6-locator']['name'] = line.split('locator').last.strip.split(' ').first
135
+ isis['srv6-locator']['auto-sid-disable'] = true if line.split('locator').last.strip.split(' ')[1]
136
+ end
137
+ end
138
+ return isis
139
+ end
140
+ end
141
+ ```
@@ -0,0 +1,20 @@
1
+
2
+ # ALCATEL7750 pool
3
+
4
+ ```ruby
5
+ @sign << ['ALCATEL7750', '地址池解析']
6
+ @sign << ['ALCATEL7750', 'nat地址配置']
7
+
8
+ module ALCATEL7750
9
+ module_function
10
+
11
+ def 地址池解析 配置散列
12
+ _intfs, _subintfs, abpools, vpn_apply = self.接口关联 配置散列
13
+ return (abpools + vpn_apply).select{|a|!a[-1].empty?}
14
+ end
15
+
16
+ def nat地址配置 配置散列
17
+ end
18
+
19
+ end
20
+ ```
@@ -0,0 +1,108 @@
1
+
2
+ # CR16010H-F pool
3
+
4
+ ```ruby
5
+ @sign << ['CR16010H-F', '地址池解析']
6
+ @sign << ['CR16010H-F', 'nat地址配置']
7
+
8
+ module CR16010H_F
9
+ module_function
10
+
11
+ def 地址池解析 配置散列
12
+ 地址池列表 = []; 分组列表 = {}
13
+ 地址池配置 = 配置散列['ip'].select{|配置|配置.include?('ip pool ')}
14
+ 地址池分组 = 配置散列['ip'].select{|配置|配置.include?('ip pool-group')}
15
+ 地址池分组.each do|分组|
16
+ tag = nil
17
+ 分组.each_line do|line|
18
+ if line.include?('pool-group') and (args = line.split('ip pool-group ')[-1].split(' '))
19
+ tag = args[0]
20
+ 分组列表[tag] ||= {}
21
+ end
22
+ if line.include?('pool') and !line.include?('pool-group') and (args = line.split('pool ')[-1].strip)
23
+ 分组列表[tag]['pool'] ||= []
24
+ 分组列表[tag]['pool'] << args
25
+ end
26
+ if line.include?('vpn-instance') and (args = line.split('vpn-instance ')[-1].strip)
27
+ 分组列表[tag]['vpn-instance'] = args
28
+ end
29
+ end
30
+ end
31
+
32
+ 地址池配置.each do|地址池|参数 = {}
33
+ 地址池.each_line do|line|
34
+ if line.include?('ip pool') and (args = line.split('ip pool ')[-1].split(' '))
35
+ 参数['name'] = args[0]
36
+ 分组列表.each do|tag,args|
37
+ 参数['vpn-instance'] = args['vpn-instance'] if args['pool'].include?(参数['name']) && args['vpn-instance']
38
+ end
39
+ end
40
+ if line.include?('gateway') and (args = line.split('gateway-list ')[-1].split(' '))
41
+ 参数['gateway'] = args[0]
42
+ 参数['mode'] = args[1] if args.size>1
43
+ end
44
+ if line.include?('network') and (args = line.split('network ')[-1].split(' '))
45
+ 参数['network'] ||= []
46
+ 参数['gatemsk'] = args[2]
47
+ 参数['network'] << [args[0],args[2]] # network, netmask
48
+ end
49
+ if line.include?('dns-list') and (args = line.split('dns-list ')[-1].split(' '))
50
+ 参数['dns-list'] = args
51
+ end
52
+ # if line.include?('forbidden-ip') and (args = line.split('forbidden-ip ')[-1].split(' '))
53
+ # 参数['forbidden-ip'] = args
54
+ # end
55
+ end
56
+ 地址池列表 << 参数
57
+ end
58
+ 地址池列表
59
+ end
60
+
61
+ def nat地址配置 配置散列
62
+ nat地址组 = {}
63
+ address_groups = 配置散列['nat'].select{|配置|配置.include?('nat address-group')}
64
+ address_groups.each do|地址组|
65
+ id = nil
66
+ 地址组.each_line do|line|
67
+ if line.include?('nat address-group') and (args = line.split('nat address-group ')[-1].split(' '))
68
+ id = args[0]
69
+ nat地址组[id] ||= {}
70
+ end
71
+ if line.include?('port-range') and (args = line.split('port-range ')[-1].split(' '))
72
+ nat地址组[id]['port-range'] = args.map{|a|a.to_i}
73
+ end
74
+ if line.include?('port-block') and (args = line.split('port-block ')[-1].split(' '))
75
+ nat地址组[id]['port-block'] = args.last.to_i
76
+ end
77
+ if line.include?('address') and !line.include?('nat address') and (args = line.split('address ')[-1].split(' '))
78
+ nat地址组[id]['address'] ||= []
79
+ nat地址组[id]['address'] << [args[0],args[1]] # start, finish
80
+ end
81
+ end
82
+ end
83
+
84
+ nat_instances = 配置散列['nat'].select{|配置|配置.include?('nat instance')}
85
+ nat_instances.each do|nat_instance|
86
+ nat_inst_id,nat_inst_name,service_inst_group,addr_group,vpn_inst = nil,nil,nil,nil,nil
87
+ nat_instance.each_line do|line|
88
+ if line.include?('nat instance')
89
+ nat_inst_id = line.split('id').last.to_i
90
+ nat_inst_name = line.split('instance').last.split(' ').first.strip
91
+ end
92
+ if line.include?('service-instance-group')
93
+ service_inst_group = line.split('service-instance-group ')[-1].strip
94
+ end
95
+ if line.include?('address-group')
96
+ addr_group = line.split('address-group ')[-1].split(' ').first
97
+ vpn_inst = line.split('vpn-instance ')[-1] if line.include?('vpn-instance')
98
+ end
99
+ end
100
+ nat地址组[addr_group]['nat-instance-id'] = nat_inst_id
101
+ nat地址组[addr_group]['nat-instance-name'] = nat_inst_name
102
+ nat地址组[addr_group]['service-inst-group'] = service_inst_group
103
+ nat地址组[addr_group]['vpn-instance'] = vpn_inst if vpn_inst
104
+ end
105
+ nat地址组
106
+ end
107
+ end
108
+ ```