oxidized 0.30.1 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -2
- data/.github/workflows/stale.yml +4 -2
- data/.rubocop.yml +18 -2
- data/.rubocop_todo.yml +5 -12
- data/CHANGELOG.md +61 -1
- data/CONTRIBUTING.md +5 -0
- data/Dockerfile +82 -21
- data/README.md +5 -21
- data/Rakefile +3 -2
- data/docs/Configuration.md +36 -12
- data/docs/Creating-Models.md +45 -4
- data/docs/Hooks.md +34 -0
- data/docs/Issues.md +91 -0
- data/docs/Model-Notes/Cumulus.md +5 -0
- data/docs/Model-Notes/FSOS.md +5 -0
- data/docs/Model-Notes/FortiOS.md +21 -5
- data/docs/Model-Notes/HPEAruba.md +31 -0
- data/docs/Model-Notes/OS6.md +10 -0
- data/docs/Model-Notes/RouterOS.md +15 -0
- data/docs/Model-Notes/SikluMHTG.md +7 -0
- data/docs/Outputs.md +2 -0
- data/docs/Release.md +18 -15
- data/docs/Sources.md +21 -0
- data/docs/Supported-OS-Types.md +11 -5
- data/docs/Troubleshooting.md +35 -0
- data/examples/device-simulation/README.md +173 -0
- data/examples/device-simulation/cmdsets/aoscx +9 -0
- data/examples/device-simulation/cmdsets/arubainstant +5 -0
- data/examples/device-simulation/cmdsets/asa +7 -0
- data/examples/device-simulation/cmdsets/ios +7 -0
- data/examples/device-simulation/cmdsets/nxos +5 -0
- data/examples/device-simulation/cmdsets/routeros +5 -0
- data/examples/device-simulation/cmdsets/srosmd +11 -0
- data/examples/device-simulation/device2yaml.rb +225 -0
- data/examples/device-simulation/yaml/aoscx_R0X25A-6410_FL.10.10.1100.yaml +2281 -0
- data/examples/device-simulation/yaml/aoscx_R8N85A-C6000-48G-CL4_PL.10.08.1010.yaml +451 -0
- data/examples/device-simulation/yaml/arubainstant_IAP515_8.10.0.6_VWLC.yaml +213 -0
- data/examples/device-simulation/yaml/asa_5512_9.12-4-67_single-context.yaml +531 -0
- data/examples/device-simulation/yaml/asr920_16.8.1b.yaml +1122 -0
- data/examples/device-simulation/yaml/garderos_R7709_003_006_068.yaml +101 -0
- data/examples/device-simulation/yaml/iosxe_C9200L-24P-4G_17.09.04a.yaml +514 -0
- data/examples/device-simulation/yaml/iosxe_C9800-L-F-K9_17.06.05.yaml +417 -0
- data/examples/device-simulation/yaml/riverbed_915.yaml +123 -0
- data/examples/device-simulation/yaml/routeros_CHR_7.10.1.yaml +145 -0
- data/examples/device-simulation/yaml/routeros_CHR_7.16.yaml +79 -0
- data/examples/device-simulation/yaml/routeros_L009UiGS_7.15.2.yaml +353 -0
- data/examples/podman-compose/Makefile +60 -17
- data/examples/podman-compose/README.md +63 -27
- data/examples/podman-compose/docker-compose.yml +11 -2
- data/examples/podman-compose/gitserver/.gitignore +1 -0
- data/examples/podman-compose/gitserver/Dockerfile +14 -0
- data/examples/podman-compose/model-simulation/Dockerfile-model +1 -1
- data/examples/podman-compose/model-simulation/asternos.sh +2 -0
- data/examples/podman-compose/oxidized-config/.gitignore +2 -0
- data/examples/podman-compose/oxidized-config/config +1 -1
- data/examples/podman-compose/oxidized-config/config_csv-file +46 -0
- data/examples/podman-compose/oxidized-config/config_csv-gitserver +56 -0
- data/examples/podman-compose/oxidized-ssh/.gitignore +1 -0
- data/lib/oxidized/config.rb +7 -1
- data/lib/oxidized/hook/githubrepo.rb +37 -7
- data/lib/oxidized/hook/slackdiff.rb +29 -7
- data/lib/oxidized/input/http.rb +1 -0
- data/lib/oxidized/input/telnet.rb +1 -1
- data/lib/oxidized/manager.rb +17 -16
- data/lib/oxidized/model/aoscx.rb +16 -2
- data/lib/oxidized/model/aosw.rb +7 -1
- data/lib/oxidized/model/arubainstant.rb +90 -0
- data/lib/oxidized/model/audiocodes.rb +2 -2
- data/lib/oxidized/model/cnos.rb +13 -10
- data/lib/oxidized/model/cumulus.rb +3 -0
- data/lib/oxidized/model/dlink.rb +1 -0
- data/lib/oxidized/model/dlinknextgen.rb +3 -0
- data/lib/oxidized/model/edgecos.rb +2 -1
- data/lib/oxidized/model/eos.rb +2 -0
- data/lib/oxidized/model/f5os.rb +17 -0
- data/lib/oxidized/model/firewareos.rb +10 -1
- data/lib/oxidized/model/fortios.rb +24 -1
- data/lib/oxidized/model/garderos.rb +43 -0
- data/lib/oxidized/model/h3c.rb +1 -1
- data/lib/oxidized/model/ibos.rb +1 -0
- data/lib/oxidized/model/ios.rb +20 -12
- data/lib/oxidized/model/iosxr.rb +1 -1
- data/lib/oxidized/model/lenovonos.rb +2 -0
- data/lib/oxidized/model/linuxgeneric.rb +1 -1
- data/lib/oxidized/model/netgear.rb +1 -1
- data/lib/oxidized/model/nodegrid.rb +1 -1
- data/lib/oxidized/model/nsxdfw.rb +30 -0
- data/lib/oxidized/model/nxos.rb +2 -1
- data/lib/oxidized/model/os6.rb +48 -0
- data/lib/oxidized/model/rgos.rb +1 -1
- data/lib/oxidized/model/riverbed.rb +104 -0
- data/lib/oxidized/model/routeros.rb +2 -2
- data/lib/oxidized/model/saos.rb +18 -1
- data/lib/oxidized/model/siklumhtg.rb +22 -0
- data/lib/oxidized/model/uplinkolt.rb +46 -0
- data/lib/oxidized/model/vyatta.rb +2 -2
- data/lib/oxidized/model/xos.rb +7 -0
- data/lib/oxidized/node.rb +30 -18
- data/lib/oxidized/nodes.rb +13 -5
- data/lib/oxidized/output/file.rb +45 -42
- data/lib/oxidized/output/git.rb +185 -160
- data/lib/oxidized/output/gitcrypt.rb +188 -186
- data/lib/oxidized/output/http.rb +53 -51
- data/lib/oxidized/output/output.rb +6 -4
- data/lib/oxidized/source/csv.rb +44 -49
- data/lib/oxidized/source/http.rb +63 -81
- data/lib/oxidized/source/jsonfile.rb +63 -0
- data/lib/oxidized/source/source.rb +43 -18
- data/lib/oxidized/source/sql.rb +66 -59
- data/lib/oxidized/version.rb +2 -2
- data/oxidized.gemspec +22 -16
- metadata +111 -15
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
init_prompt:
|
3
|
+
commands:
|
4
|
+
/system resource print: |-
|
5
|
+
\x20 uptime: 32m36s
|
6
|
+
version: 7.16 (stable)
|
7
|
+
build-time: 2024-09-20 13:00:27
|
8
|
+
factory-software: 7.1
|
9
|
+
free-memory: 165.6MiB
|
10
|
+
total-memory: 384.0MiB
|
11
|
+
cpu: QEMU
|
12
|
+
cpu-count: 1
|
13
|
+
cpu-frequency: 2999MHz
|
14
|
+
cpu-load: 2%
|
15
|
+
free-hdd-space: 71.2MiB
|
16
|
+
total-hdd-space: 89.2MiB
|
17
|
+
write-sect-since-reboot: 584
|
18
|
+
write-sect-total: 584
|
19
|
+
architecture-name: x86_64
|
20
|
+
board-name: CHR QEMU Standard PC (i440FX + PIIX, 1996)
|
21
|
+
platform: MikroTik
|
22
|
+
|
23
|
+
/system package update print: |-
|
24
|
+
\x20 channel: stable
|
25
|
+
installed-version: 7.16
|
26
|
+
|
27
|
+
/system history print without-paging: |-
|
28
|
+
|
29
|
+
/export show-sensitive: |-
|
30
|
+
# 2024-11-16 06:25:32 by RouterOS 7.16
|
31
|
+
# software id =\x20
|
32
|
+
#
|
33
|
+
/interface ethernet
|
34
|
+
set [ find default-name=ether1 ] disable-running-check=no
|
35
|
+
set [ find default-name=ether2 ] disable-running-check=no
|
36
|
+
set [ find default-name=ether3 ] disable-running-check=no
|
37
|
+
set [ find default-name=ether4 ] disable-running-check=no
|
38
|
+
set [ find default-name=ether5 ] disable-running-check=no
|
39
|
+
set [ find default-name=ether6 ] disable-running-check=no
|
40
|
+
set [ find default-name=ether7 ] disable-running-check=no
|
41
|
+
set [ find default-name=ether8 ] disable-running-check=no
|
42
|
+
/port
|
43
|
+
set 0 name=serial0
|
44
|
+
/ip address
|
45
|
+
add address=10.0.2.100/24 interface=ether1 network=10.0.2.0
|
46
|
+
/ip dhcp-client
|
47
|
+
add interface=ether1
|
48
|
+
/system note
|
49
|
+
set show-at-login=no
|
50
|
+
quit: |-
|
51
|
+
interrupted
|
52
|
+
oxidized_output: |
|
53
|
+
# version: 7.16 (stable)
|
54
|
+
# factory-software: 7.1
|
55
|
+
# total-memory: 384.0MiB
|
56
|
+
# cpu: QEMU
|
57
|
+
# cpu-count: 1
|
58
|
+
# total-hdd-space: 89.2MiB
|
59
|
+
# architecture-name: x86_64
|
60
|
+
# board-name: CHR QEMU Standard PC (i440FX + PIIX, 1996)
|
61
|
+
# platform: MikroTik# installed-version: 7.16# software id =\x20
|
62
|
+
#
|
63
|
+
/interface ethernet
|
64
|
+
set [ find default-name=ether1 ] disable-running-check=no
|
65
|
+
set [ find default-name=ether2 ] disable-running-check=no
|
66
|
+
set [ find default-name=ether3 ] disable-running-check=no
|
67
|
+
set [ find default-name=ether4 ] disable-running-check=no
|
68
|
+
set [ find default-name=ether5 ] disable-running-check=no
|
69
|
+
set [ find default-name=ether6 ] disable-running-check=no
|
70
|
+
set [ find default-name=ether7 ] disable-running-check=no
|
71
|
+
set [ find default-name=ether8 ] disable-running-check=no
|
72
|
+
/port
|
73
|
+
set 0 name=serial0
|
74
|
+
/ip address
|
75
|
+
add address=10.0.2.100/24 interface=ether1 network=10.0.2.0
|
76
|
+
/ip dhcp-client
|
77
|
+
add interface=ether1
|
78
|
+
/system note
|
79
|
+
set show-at-login=no
|
@@ -0,0 +1,353 @@
|
|
1
|
+
---
|
2
|
+
init_prompt:
|
3
|
+
commands:
|
4
|
+
/system resource print: |-
|
5
|
+
\x20 uptime: 14w1d19h55m4s
|
6
|
+
\x20 version: 7.15.2 (stable)
|
7
|
+
\x20 build-time: 2024-06-26 11:42:37
|
8
|
+
\x20 factory-software: 7.12
|
9
|
+
\x20 free-memory: 432.4MiB
|
10
|
+
\x20 total-memory: 512.0MiB
|
11
|
+
\x20 cpu: ARM
|
12
|
+
\x20 cpu-count: 2
|
13
|
+
\x20 cpu-frequency: 800MHz
|
14
|
+
\x20 cpu-load: 0%
|
15
|
+
\x20 free-hdd-space: 103.8MiB
|
16
|
+
\x20 total-hdd-space: 128.0MiB
|
17
|
+
\x20 write-sect-since-reboot: 361943
|
18
|
+
\x20 write-sect-total: 669893
|
19
|
+
\x20 bad-blocks: 0%
|
20
|
+
\x20 architecture-name: arm
|
21
|
+
\x20 board-name: L009UiGS
|
22
|
+
\x20 platform: MikroTik
|
23
|
+
|
24
|
+
/system package update print: |-
|
25
|
+
\x20 channel: stable
|
26
|
+
\x20 installed-version: 7.15.2
|
27
|
+
\x20 latest-version: 7.15.3
|
28
|
+
\x20 status: New version is available
|
29
|
+
|
30
|
+
/system history print without-paging: |-
|
31
|
+
Flags: U - UNDOABLE
|
32
|
+
Columns: ACTION, BY, POLICY, TIME
|
33
|
+
\x20 ACTION BY POLICY TIME \x20
|
34
|
+
U bridge port changed user write 2024-07-31 09:33:47
|
35
|
+
U bridge port changed user write 2024-07-31 09:32:52
|
36
|
+
U bridge port changed user write 2024-07-31 09:32:50
|
37
|
+
U detect-internet settings changed user write 2024-07-31 09:28:59
|
38
|
+
|
39
|
+
/export show-sensitive: |-
|
40
|
+
# 2024-10-25 12:09:43 by RouterOS 7.15.2
|
41
|
+
# software id = A0AA-AAA0
|
42
|
+
#
|
43
|
+
# model = L009UiGS
|
44
|
+
# serial number = AA111AAAAAA
|
45
|
+
/interface bridge
|
46
|
+
add admin-mac=00:00:5E:00:53:00 auto-mac=no comment=defconf name=bridge \\
|
47
|
+
\x20 port-cost-mode=short
|
48
|
+
/interface vlan
|
49
|
+
add interface=ether1 name=vlan6 vlan-id=6
|
50
|
+
/interface pppoe-client
|
51
|
+
add add-default-route=yes disabled=no interface=vlan6 name=pppoe-out1 \\
|
52
|
+
\x20 password=password use-peer-dns=yes user=user
|
53
|
+
/interface list
|
54
|
+
add comment=defconf name=WAN
|
55
|
+
add comment=defconf name=LAN
|
56
|
+
/interface wireless security-profiles
|
57
|
+
set [ find default=yes ] supplicant-identity=MikroTik
|
58
|
+
/ip pool
|
59
|
+
add name=default-dhcp ranges=192.0.2.0-192.0.2.254
|
60
|
+
/ip dhcp-server
|
61
|
+
add address-pool=default-dhcp interface=bridge lease-time=10m name=defconf
|
62
|
+
/port
|
63
|
+
set 0 name=serial0
|
64
|
+
/snmp community
|
65
|
+
add addresses=0.0.0.0/0 name=community security=authorized
|
66
|
+
/interface bridge port
|
67
|
+
add bridge=bridge comment=defconf interface=ether2 internal-path-cost=10 \\
|
68
|
+
\x20 path-cost=10
|
69
|
+
add bridge=bridge comment=defconf interface=ether3 internal-path-cost=10 \\
|
70
|
+
\x20 path-cost=10
|
71
|
+
add bridge=bridge comment=defconf interface=ether4 internal-path-cost=10 \\
|
72
|
+
\x20 path-cost=10
|
73
|
+
add bridge=bridge comment=defconf interface=ether5 internal-path-cost=10 \\
|
74
|
+
\x20 path-cost=10
|
75
|
+
add bridge=bridge comment=defconf interface=ether6 internal-path-cost=10 \\
|
76
|
+
\x20 path-cost=10
|
77
|
+
add bridge=bridge comment=defconf interface=ether7 internal-path-cost=10 \\
|
78
|
+
\x20 path-cost=10
|
79
|
+
add bridge=bridge comment=defconf interface=ether8 internal-path-cost=10 \\
|
80
|
+
\x20 path-cost=10
|
81
|
+
add bridge=bridge comment=defconf interface=sfp1 internal-path-cost=10 \\
|
82
|
+
\x20 path-cost=10
|
83
|
+
/ip firewall connection tracking
|
84
|
+
set udp-timeout=10s
|
85
|
+
/ip neighbor discovery-settings
|
86
|
+
set discover-interface-list=LAN
|
87
|
+
/ip settings
|
88
|
+
set max-neighbor-entries=14336
|
89
|
+
/ipv6 settings
|
90
|
+
set max-neighbor-entries=7168
|
91
|
+
/interface list member
|
92
|
+
add comment=defconf interface=bridge list=LAN
|
93
|
+
add comment=defconf interface=ether1 list=WAN
|
94
|
+
add interface=pppoe-out1 list=WAN
|
95
|
+
/ip address
|
96
|
+
add address=192.0.2.1/24 comment=defconf interface=bridge network=\\
|
97
|
+
\x20 192.0.2.0
|
98
|
+
/ip dhcp-client
|
99
|
+
add comment=defconf interface=ether1
|
100
|
+
/ip dhcp-server network
|
101
|
+
add address=192.0.2.0/24 comment=defconf dns-server=192.0.2.1 gateway=\\
|
102
|
+
\x20 192.0.2.1
|
103
|
+
/ip dns
|
104
|
+
set allow-remote-requests=yes
|
105
|
+
/ip dns static
|
106
|
+
add address=192.0.2.1 comment=defconf name=router.lan
|
107
|
+
/ip firewall address-list
|
108
|
+
add address=198.51.100.1 list=\"office\"
|
109
|
+
add address=198.51.100.2 list=\"nms\"
|
110
|
+
/ip firewall filter
|
111
|
+
add action=accept chain=input comment=\\
|
112
|
+
\x20 \"defconf: accept established,related,untracked\" connection-state=\\
|
113
|
+
\x20 established,related,untracked
|
114
|
+
add action=drop chain=input comment=\"defconf: drop invalid\" connection-state=\\
|
115
|
+
\x20 invalid
|
116
|
+
add action=accept chain=input comment=\"defconf: accept ICMP\" protocol=icmp
|
117
|
+
add action=accept chain=input comment=\"Remote MGTM\" in-interface-list=WAN \\
|
118
|
+
\x20 src-address-list=\"office\"
|
119
|
+
add action=accept chain=input in-interface-list=WAN src-address-list=\\
|
120
|
+
\x20 \"nms\"
|
121
|
+
add action=accept chain=input comment=\\
|
122
|
+
\x20 \"defconf: accept to local loopback (for CAPsMAN)\" dst-address=127.0.0.1
|
123
|
+
add action=drop chain=input comment=\"defconf: drop all not coming from LAN\" \\
|
124
|
+
\x20 in-interface-list=!LAN
|
125
|
+
add action=accept chain=forward comment=\"defconf: accept in ipsec policy\" \\
|
126
|
+
\x20 ipsec-policy=in,ipsec
|
127
|
+
add action=accept chain=forward comment=\"defconf: accept out ipsec policy\" \\
|
128
|
+
\x20 ipsec-policy=out,ipsec
|
129
|
+
add action=fasttrack-connection chain=forward comment=\"defconf: fasttrack\" \\
|
130
|
+
\x20 connection-state=established,related hw-offload=yes
|
131
|
+
add action=accept chain=forward comment=\\
|
132
|
+
\x20 \"defconf: accept established,related, untracked\" connection-state=\\
|
133
|
+
\x20 established,related,untracked
|
134
|
+
add action=drop chain=forward comment=\"defconf: drop invalid\" \\
|
135
|
+
\x20 connection-state=invalid
|
136
|
+
add action=drop chain=forward comment=\\
|
137
|
+
\x20 \"defconf: drop all from WAN not DSTNATed\" connection-nat-state=!dstnat \\
|
138
|
+
\x20 connection-state=new in-interface-list=WAN
|
139
|
+
/ip firewall nat
|
140
|
+
add action=masquerade chain=srcnat comment=\"defconf: masquerade\" \\
|
141
|
+
\x20 ipsec-policy=out,none out-interface-list=WAN
|
142
|
+
/ipv6 firewall address-list
|
143
|
+
add address=::/128 comment=\"defconf: unspecified address\" list=bad_ipv6
|
144
|
+
add address=::1/128 comment=\"defconf: lo\" list=bad_ipv6
|
145
|
+
add address=fec0::/10 comment=\"defconf: site-local\" list=bad_ipv6
|
146
|
+
add address=::ffff:0.0.0.0/96 comment=\"defconf: ipv4-mapped\" list=bad_ipv6
|
147
|
+
add address=::/96 comment=\"defconf: ipv4 compat\" list=bad_ipv6
|
148
|
+
add address=100::/64 comment=\"defconf: discard only \" list=bad_ipv6
|
149
|
+
add address=2001:db8::/32 comment=\"defconf: documentation\" list=bad_ipv6
|
150
|
+
add address=2001:10::/28 comment=\"defconf: ORCHID\" list=bad_ipv6
|
151
|
+
add address=3ffe::/16 comment=\"defconf: 6bone\" list=bad_ipv6
|
152
|
+
/ipv6 firewall filter
|
153
|
+
add action=accept chain=input comment=\\
|
154
|
+
\x20 \"defconf: accept established,related,untracked\" connection-state=\\
|
155
|
+
\x20 established,related,untracked
|
156
|
+
add action=drop chain=input comment=\"defconf: drop invalid\" connection-state=\\
|
157
|
+
\x20 invalid
|
158
|
+
add action=accept chain=input comment=\"defconf: accept ICMPv6\" protocol=\\
|
159
|
+
\x20 icmpv6
|
160
|
+
add action=accept chain=input comment=\"defconf: accept UDP traceroute\" port=\\
|
161
|
+
\x20 33434-33534 protocol=udp
|
162
|
+
add action=accept chain=input comment=\\
|
163
|
+
\x20 \"defconf: accept DHCPv6-Client prefix delegation.\" dst-port=546 protocol=\\
|
164
|
+
\x20 udp src-address=fe80::/10
|
165
|
+
add action=accept chain=input comment=\"defconf: accept IKE\" dst-port=500,4500 \\
|
166
|
+
\x20 protocol=udp
|
167
|
+
add action=accept chain=input comment=\"defconf: accept ipsec AH\" protocol=\\
|
168
|
+
\x20 ipsec-ah
|
169
|
+
add action=accept chain=input comment=\"defconf: accept ipsec ESP\" protocol=\\
|
170
|
+
\x20 ipsec-esp
|
171
|
+
add action=accept chain=input comment=\\
|
172
|
+
\x20 \"defconf: accept all that matches ipsec policy\" ipsec-policy=in,ipsec
|
173
|
+
add action=drop chain=input comment=\\
|
174
|
+
\x20 \"defconf: drop everything else not coming from LAN\" in-interface-list=\\
|
175
|
+
\x20 !LAN
|
176
|
+
add action=accept chain=forward comment=\\
|
177
|
+
\x20 \"defconf: accept established,related,untracked\" connection-state=\\
|
178
|
+
\x20 established,related,untracked
|
179
|
+
add action=drop chain=forward comment=\"defconf: drop invalid\" \\
|
180
|
+
\x20 connection-state=invalid
|
181
|
+
add action=drop chain=forward comment=\\
|
182
|
+
\x20 \"defconf: drop packets with bad src ipv6\" src-address-list=bad_ipv6
|
183
|
+
add action=drop chain=forward comment=\\
|
184
|
+
\x20 \"defconf: drop packets with bad dst ipv6\" dst-address-list=bad_ipv6
|
185
|
+
add action=drop chain=forward comment=\"defconf: rfc4890 drop hop-limit=1\" \\
|
186
|
+
\x20 hop-limit=equal:1 protocol=icmpv6
|
187
|
+
add action=accept chain=forward comment=\"defconf: accept ICMPv6\" protocol=\\
|
188
|
+
\x20 icmpv6
|
189
|
+
add action=accept chain=forward comment=\"defconf: accept HIP\" protocol=139
|
190
|
+
add action=accept chain=forward comment=\"defconf: accept IKE\" dst-port=\\
|
191
|
+
\x20 500,4500 protocol=udp
|
192
|
+
add action=accept chain=forward comment=\"defconf: accept ipsec AH\" protocol=\\
|
193
|
+
\x20 ipsec-ah
|
194
|
+
add action=accept chain=forward comment=\"defconf: accept ipsec ESP\" protocol=\\
|
195
|
+
\x20 ipsec-esp
|
196
|
+
add action=accept chain=forward comment=\\
|
197
|
+
\x20 \"defconf: accept all that matches ipsec policy\" ipsec-policy=in,ipsec
|
198
|
+
add action=drop chain=forward comment=\\
|
199
|
+
\x20 \"defconf: drop everything else not coming from LAN\" in-interface-list=\\
|
200
|
+
\x20 !LAN
|
201
|
+
/snmp
|
202
|
+
set contact=user enabled=yes location=\"Riga, LATIVA\" \\
|
203
|
+
\x20 trap-community=community
|
204
|
+
/system clock
|
205
|
+
set time-zone-name=Europe/Riga
|
206
|
+
/system identity
|
207
|
+
set name=router
|
208
|
+
/system note
|
209
|
+
set show-at-login=no
|
210
|
+
/system routerboard settings
|
211
|
+
set enter-setup-on=delete-key
|
212
|
+
/tool mac-server
|
213
|
+
set allowed-interface-list=LAN
|
214
|
+
/tool mac-server mac-winbox
|
215
|
+
set allowed-interface-list=LAN
|
216
|
+
quit: |-
|
217
|
+
interrupted
|
218
|
+
oxidized_output: |
|
219
|
+
# version: 7.15.2 (stable)
|
220
|
+
# factory-software: 7.12
|
221
|
+
# total-memory: 512.0MiB
|
222
|
+
# cpu: ARM
|
223
|
+
# cpu-count: 2
|
224
|
+
# total-hdd-space: 128.0MiB
|
225
|
+
# architecture-name: arm
|
226
|
+
# board-name: L009UiGS
|
227
|
+
# platform: MikroTik# installed-version: 7.15.2
|
228
|
+
# Flags: U - UNDOABLE
|
229
|
+
# Columns: ACTION, BY, POLICY, TIME
|
230
|
+
# ACTION BY POLICY TIME \x20
|
231
|
+
# U bridge port changed user write 2024-07-31 09:33:47
|
232
|
+
# U bridge port changed user write 2024-07-31 09:32:52
|
233
|
+
# U bridge port changed user write 2024-07-31 09:32:50
|
234
|
+
# U detect-internet settings changed user write 2024-07-31 09:28:59# software id = A0AA-AAA0
|
235
|
+
#
|
236
|
+
# model = L009UiGS
|
237
|
+
# serial number = AA111AAAAAA
|
238
|
+
/interface bridge
|
239
|
+
add admin-mac=00:00:5E:00:53:00 auto-mac=no comment=defconf name=bridge port-cost-mode=short
|
240
|
+
/interface vlan
|
241
|
+
add interface=ether1 name=vlan6 vlan-id=6
|
242
|
+
/interface pppoe-client
|
243
|
+
add add-default-route=yes disabled=no interface=vlan6 name=pppoe-out1 password=password use-peer-dns=yes user=user
|
244
|
+
/interface list
|
245
|
+
add comment=defconf name=WAN
|
246
|
+
add comment=defconf name=LAN
|
247
|
+
/interface wireless security-profiles
|
248
|
+
set [ find default=yes ] supplicant-identity=MikroTik
|
249
|
+
/ip pool
|
250
|
+
add name=default-dhcp ranges=192.0.2.0-192.0.2.254
|
251
|
+
/ip dhcp-server
|
252
|
+
add address-pool=default-dhcp interface=bridge lease-time=10m name=defconf
|
253
|
+
/port
|
254
|
+
set 0 name=serial0
|
255
|
+
/snmp community
|
256
|
+
add addresses=0.0.0.0/0 name=community security=authorized
|
257
|
+
/interface bridge port
|
258
|
+
add bridge=bridge comment=defconf interface=ether2 internal-path-cost=10 path-cost=10
|
259
|
+
add bridge=bridge comment=defconf interface=ether3 internal-path-cost=10 path-cost=10
|
260
|
+
add bridge=bridge comment=defconf interface=ether4 internal-path-cost=10 path-cost=10
|
261
|
+
add bridge=bridge comment=defconf interface=ether5 internal-path-cost=10 path-cost=10
|
262
|
+
add bridge=bridge comment=defconf interface=ether6 internal-path-cost=10 path-cost=10
|
263
|
+
add bridge=bridge comment=defconf interface=ether7 internal-path-cost=10 path-cost=10
|
264
|
+
add bridge=bridge comment=defconf interface=ether8 internal-path-cost=10 path-cost=10
|
265
|
+
add bridge=bridge comment=defconf interface=sfp1 internal-path-cost=10 path-cost=10
|
266
|
+
/ip firewall connection tracking
|
267
|
+
set udp-timeout=10s
|
268
|
+
/ip neighbor discovery-settings
|
269
|
+
set discover-interface-list=LAN
|
270
|
+
/ip settings
|
271
|
+
set max-neighbor-entries=14336
|
272
|
+
/ipv6 settings
|
273
|
+
set max-neighbor-entries=7168
|
274
|
+
/interface list member
|
275
|
+
add comment=defconf interface=bridge list=LAN
|
276
|
+
add comment=defconf interface=ether1 list=WAN
|
277
|
+
add interface=pppoe-out1 list=WAN
|
278
|
+
/ip address
|
279
|
+
add address=192.0.2.1/24 comment=defconf interface=bridge network=192.0.2.0
|
280
|
+
/ip dhcp-client
|
281
|
+
add comment=defconf interface=ether1
|
282
|
+
/ip dhcp-server network
|
283
|
+
add address=192.0.2.0/24 comment=defconf dns-server=192.0.2.1 gateway=192.0.2.1
|
284
|
+
/ip dns
|
285
|
+
set allow-remote-requests=yes
|
286
|
+
/ip dns static
|
287
|
+
add address=192.0.2.1 comment=defconf name=router.lan
|
288
|
+
/ip firewall address-list
|
289
|
+
add address=198.51.100.1 list=\"office\"
|
290
|
+
add address=198.51.100.2 list=\"nms\"
|
291
|
+
/ip firewall filter
|
292
|
+
add action=accept chain=input comment=\"defconf: accept established,related,untracked\" connection-state=established,related,untracked
|
293
|
+
add action=drop chain=input comment=\"defconf: drop invalid\" connection-state=invalid
|
294
|
+
add action=accept chain=input comment=\"defconf: accept ICMP\" protocol=icmp
|
295
|
+
add action=accept chain=input comment=\"Remote MGTM\" in-interface-list=WAN src-address-list=\"office\"
|
296
|
+
add action=accept chain=input in-interface-list=WAN src-address-list=\"nms\"
|
297
|
+
add action=accept chain=input comment=\"defconf: accept to local loopback (for CAPsMAN)\" dst-address=127.0.0.1
|
298
|
+
add action=drop chain=input comment=\"defconf: drop all not coming from LAN\" in-interface-list=!LAN
|
299
|
+
add action=accept chain=forward comment=\"defconf: accept in ipsec policy\" ipsec-policy=in,ipsec
|
300
|
+
add action=accept chain=forward comment=\"defconf: accept out ipsec policy\" ipsec-policy=out,ipsec
|
301
|
+
add action=fasttrack-connection chain=forward comment=\"defconf: fasttrack\" connection-state=established,related hw-offload=yes
|
302
|
+
add action=accept chain=forward comment=\"defconf: accept established,related, untracked\" connection-state=established,related,untracked
|
303
|
+
add action=drop chain=forward comment=\"defconf: drop invalid\" connection-state=invalid
|
304
|
+
add action=drop chain=forward comment=\"defconf: drop all from WAN not DSTNATed\" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
|
305
|
+
/ip firewall nat
|
306
|
+
add action=masquerade chain=srcnat comment=\"defconf: masquerade\" ipsec-policy=out,none out-interface-list=WAN
|
307
|
+
/ipv6 firewall address-list
|
308
|
+
add address=::/128 comment=\"defconf: unspecified address\" list=bad_ipv6
|
309
|
+
add address=::1/128 comment=\"defconf: lo\" list=bad_ipv6
|
310
|
+
add address=fec0::/10 comment=\"defconf: site-local\" list=bad_ipv6
|
311
|
+
add address=::ffff:0.0.0.0/96 comment=\"defconf: ipv4-mapped\" list=bad_ipv6
|
312
|
+
add address=::/96 comment=\"defconf: ipv4 compat\" list=bad_ipv6
|
313
|
+
add address=100::/64 comment=\"defconf: discard only \" list=bad_ipv6
|
314
|
+
add address=2001:db8::/32 comment=\"defconf: documentation\" list=bad_ipv6
|
315
|
+
add address=2001:10::/28 comment=\"defconf: ORCHID\" list=bad_ipv6
|
316
|
+
add address=3ffe::/16 comment=\"defconf: 6bone\" list=bad_ipv6
|
317
|
+
/ipv6 firewall filter
|
318
|
+
add action=accept chain=input comment=\"defconf: accept established,related,untracked\" connection-state=established,related,untracked
|
319
|
+
add action=drop chain=input comment=\"defconf: drop invalid\" connection-state=invalid
|
320
|
+
add action=accept chain=input comment=\"defconf: accept ICMPv6\" protocol=icmpv6
|
321
|
+
add action=accept chain=input comment=\"defconf: accept UDP traceroute\" port=33434-33534 protocol=udp
|
322
|
+
add action=accept chain=input comment=\"defconf: accept DHCPv6-Client prefix delegation.\" dst-port=546 protocol=udp src-address=fe80::/10
|
323
|
+
add action=accept chain=input comment=\"defconf: accept IKE\" dst-port=500,4500 protocol=udp
|
324
|
+
add action=accept chain=input comment=\"defconf: accept ipsec AH\" protocol=ipsec-ah
|
325
|
+
add action=accept chain=input comment=\"defconf: accept ipsec ESP\" protocol=ipsec-esp
|
326
|
+
add action=accept chain=input comment=\"defconf: accept all that matches ipsec policy\" ipsec-policy=in,ipsec
|
327
|
+
add action=drop chain=input comment=\"defconf: drop everything else not coming from LAN\" in-interface-list=!LAN
|
328
|
+
add action=accept chain=forward comment=\"defconf: accept established,related,untracked\" connection-state=established,related,untracked
|
329
|
+
add action=drop chain=forward comment=\"defconf: drop invalid\" connection-state=invalid
|
330
|
+
add action=drop chain=forward comment=\"defconf: drop packets with bad src ipv6\" src-address-list=bad_ipv6
|
331
|
+
add action=drop chain=forward comment=\"defconf: drop packets with bad dst ipv6\" dst-address-list=bad_ipv6
|
332
|
+
add action=drop chain=forward comment=\"defconf: rfc4890 drop hop-limit=1\" hop-limit=equal:1 protocol=icmpv6
|
333
|
+
add action=accept chain=forward comment=\"defconf: accept ICMPv6\" protocol=icmpv6
|
334
|
+
add action=accept chain=forward comment=\"defconf: accept HIP\" protocol=139
|
335
|
+
add action=accept chain=forward comment=\"defconf: accept IKE\" dst-port=500,4500 protocol=udp
|
336
|
+
add action=accept chain=forward comment=\"defconf: accept ipsec AH\" protocol=ipsec-ah
|
337
|
+
add action=accept chain=forward comment=\"defconf: accept ipsec ESP\" protocol=ipsec-esp
|
338
|
+
add action=accept chain=forward comment=\"defconf: accept all that matches ipsec policy\" ipsec-policy=in,ipsec
|
339
|
+
add action=drop chain=forward comment=\"defconf: drop everything else not coming from LAN\" in-interface-list=!LAN
|
340
|
+
/snmp
|
341
|
+
set contact=user enabled=yes location=\"Riga, LATIVA\" trap-community=community
|
342
|
+
/system clock
|
343
|
+
set time-zone-name=Europe/Riga
|
344
|
+
/system identity
|
345
|
+
set name=router
|
346
|
+
/system note
|
347
|
+
set show-at-login=no
|
348
|
+
/system routerboard settings
|
349
|
+
set enter-setup-on=delete-key
|
350
|
+
/tool mac-server
|
351
|
+
set allowed-interface-list=LAN
|
352
|
+
/tool mac-server mac-winbox
|
353
|
+
set allowed-interface-list=LAN
|
@@ -6,12 +6,18 @@ help:
|
|
6
6
|
|
7
7
|
rights:
|
8
8
|
podman unshare chown -R 30000:30000 oxidized-config oxidized-ssh
|
9
|
+
podman unshare chown -R 30001 gitserver/repo.git
|
9
10
|
|
10
11
|
clean-rights:
|
11
12
|
podman unshare chown -R 0:0 *
|
12
13
|
|
13
|
-
start: rights
|
14
|
-
|
14
|
+
start: gitserver-createrepo rights images
|
15
|
+
if [ -f oxidized-config/config ]; then \
|
16
|
+
podman-compose -p oxidized up ; \
|
17
|
+
else { \
|
18
|
+
echo "\n########\noxidized-config/config does not exist"; \
|
19
|
+
echo "create one or copy an example in the folder"; \
|
20
|
+
} fi
|
15
21
|
|
16
22
|
run: start
|
17
23
|
|
@@ -23,7 +29,7 @@ start-local:
|
|
23
29
|
if [ -f oxidized-config/config.local ]; then \
|
24
30
|
cp oxidized-config/config.local oxidized-config/config; \
|
25
31
|
else \
|
26
|
-
echo "
|
32
|
+
echo "\n########\noxidized-config/config.local does not exist"; \
|
27
33
|
fi
|
28
34
|
$(MAKE) start
|
29
35
|
|
@@ -31,31 +37,68 @@ stop-local: stop
|
|
31
37
|
if [ -f oxidized-config/config.local ]; then \
|
32
38
|
git checkout -- oxidized-config/config; \
|
33
39
|
else \
|
34
|
-
echo "
|
40
|
+
echo "\n########\noxidized-config/config.local does not exist"; \
|
35
41
|
fi
|
36
42
|
|
43
|
+
# creates a container image for the model simulation
|
37
44
|
model-image:
|
38
|
-
podman image exists
|
45
|
+
podman image exists local/model || \
|
39
46
|
podman build -t local/model -f model-simulation/Dockerfile-model .
|
40
47
|
|
41
48
|
model-clean:
|
42
49
|
podman rmi local/model
|
43
50
|
|
44
|
-
|
51
|
+
# creates a container image for gitserver
|
52
|
+
gitserver-image:
|
53
|
+
podman image exists local/gitserver || \
|
54
|
+
podman build -t local/gitserver gitserver/
|
55
|
+
|
56
|
+
# create the repo repo.git inside the gitserver mapped volume
|
57
|
+
gitserver-createrepo: clean-rights
|
58
|
+
if [ ! -d gitserver/repo.git ]; then \
|
59
|
+
git init --bare gitserver/repo.git; \
|
60
|
+
fi
|
61
|
+
|
62
|
+
gitserver-clean:
|
63
|
+
podman rmi local/gitserver
|
64
|
+
rm -rf gitserver/repo.git
|
65
|
+
|
66
|
+
gitserver-getkey:
|
67
|
+
podman exec --user oxidized -t oxidized_oxidized_1 sh -c "ssh-keyscan gitserver > /home/oxidized/.ssh/known_hosts"
|
68
|
+
|
69
|
+
# build all helper containter images
|
70
|
+
images: model-image gitserver-image oxidized-image
|
71
|
+
|
72
|
+
# build the oxidized image from the curent repository
|
73
|
+
oxidized-image:
|
74
|
+
podman image exists local/oxidized || \
|
75
|
+
podman build -t local/oxidized ../../
|
76
|
+
|
77
|
+
# removes the oxidized image
|
78
|
+
oxidized-image-clean:
|
79
|
+
podman rmi local/oxidized
|
80
|
+
|
81
|
+
# run evey clean line, even if the previous fails
|
82
|
+
clean:
|
83
|
+
-$(MAKE) stop-local
|
84
|
+
-$(MAKE) model-clean
|
85
|
+
-$(MAKE) gitserver-clean
|
86
|
+
-$(MAKE) oxidized-image-clean
|
45
87
|
|
46
88
|
define HELP
|
47
89
|
make help - This help
|
48
|
-
make rights - Change the rights of mapped folders for
|
49
|
-
|
90
|
+
make rights - Change the rights of mapped folders for the users inside
|
91
|
+
the container
|
50
92
|
make clean-rights - Revert the rights of mapped folders to the local user
|
51
|
-
make start - Start the
|
93
|
+
make start - Start the pod with all containers (alias - make run)
|
52
94
|
You can interrupt with Ctrl-C, but make sure you run
|
53
|
-
make stop to realy stop the container
|
54
|
-
make
|
55
|
-
make
|
56
|
-
|
57
|
-
make stop-local - Stops the
|
58
|
-
|
59
|
-
make
|
60
|
-
|
95
|
+
'make stop' to realy stop the container
|
96
|
+
make stop - Stop the pod
|
97
|
+
make start-local - Starts the pod with the local configuration
|
98
|
+
oxidized-config/config.local
|
99
|
+
make stop-local - Stops the pod and restores
|
100
|
+
oxidized-config/config from git
|
101
|
+
make gitserver-getkey - stores the public key of the gitserver into
|
102
|
+
oxidized-ssh/known_hosts (the pod must be running)
|
103
|
+
make clean - reverts everything to its original state
|
61
104
|
endef
|
@@ -1,35 +1,47 @@
|
|
1
|
-
# Running
|
2
|
-
This
|
3
|
-
podman
|
1
|
+
# Running Oxidized with podman-compose
|
2
|
+
This example demonstrates running Oxidized within an OCI container using
|
3
|
+
podman-compose. It’s actively used in Oxidized development to validate the
|
4
|
+
container’s functionality and to simulate potential issues.
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
implement.
|
6
|
+
While this example uses podman and podman-compose, it should also be compatible
|
7
|
+
with docker, as podman supports docker’s CLI.
|
8
8
|
|
9
|
-
To
|
10
|
-
|
9
|
+
To make this example work seamlessly, a simulated network device is included.
|
10
|
+
The asternos model is used here for simplicity, as it requires minimal commands
|
11
|
+
to implement. The simulated output doesn’t replicate real device responses but
|
12
|
+
provides changing lines over time to test Oxidized’s functionality.
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
|
15
|
+
The example also provides a Git server to test the interaction with it.
|
16
|
+
|
17
|
+
# Run the example
|
18
|
+
> :warning: the example builds local containers and will require at least 2 GB
|
19
|
+
> of disk space along with some CPU and time during the first run.
|
20
|
+
|
21
|
+
To start the example, simply run `make start`. Ensure you have installed the
|
22
|
+
necessary [dependencies](#dependencies) before.
|
23
|
+
|
24
|
+
To stop, press `CTRL-C` or run `make stop` in a separate shell. If you exit
|
25
|
+
with `CTRL-C`, make sure to run `make stop` afterward to properly clean up the
|
26
|
+
environment.
|
15
27
|
|
16
28
|
## Running Environment
|
17
|
-
This example of oxidized with podman-compose
|
18
|
-
Bookworm (Version 12)
|
29
|
+
This example of oxidized with podman-compose is running on Debian
|
30
|
+
Bookworm (Version 12). It should work with few adaptations on any Linux
|
19
31
|
box running podman, and maybe also with docker.
|
20
32
|
|
21
33
|
## Dependencies
|
22
|
-
|
34
|
+
To get started, install the required packages on your Debian system:
|
23
35
|
```shell
|
24
36
|
sudo apt install podman containers-storage podman-compose make
|
25
37
|
```
|
26
38
|
|
27
|
-
|
28
|
-
|
29
|
-
|
39
|
+
Ensure Podman is using the overlay driver for image storage.
|
40
|
+
Without this driver, Podman may save every container layer separately rather
|
41
|
+
than only the changes, which can quickly consume disk space.
|
30
42
|
|
31
|
-
This
|
32
|
-
|
43
|
+
This issue can occur if podman was run before installing the
|
44
|
+
`container-storage` package.
|
33
45
|
|
34
46
|
```shell
|
35
47
|
podman info | grep graphDriverName
|
@@ -43,16 +55,40 @@ You should get this reply
|
|
43
55
|
If not, the quick way I found to solve it is to delete `~/.local/share/containers/`.
|
44
56
|
Beware - this will delete **all** your containers!
|
45
57
|
|
46
|
-
##
|
47
|
-
Feel free
|
48
|
-
|
58
|
+
## Adapting to your needs
|
59
|
+
Feel free to customize this setup as you wish! You may want to edit
|
60
|
+
`docker-compose.yml` to remove any containers simulating specific components.
|
49
61
|
|
50
|
-
## Use your own oxidized configuration
|
51
|
-
When developing oxidized
|
52
|
-
|
62
|
+
## Use your own oxidized configuration in the git repository
|
63
|
+
When developing oxidized or testing the container, you may want to use a custom
|
64
|
+
configuration. This can be done by saving it under `oxidized-config/config.local`
|
53
65
|
|
54
66
|
`make start-local` will recognize the local configuration and copy it to
|
55
67
|
`oxidized-config/config` before starting the container.
|
56
68
|
|
57
|
-
You
|
58
|
-
configuration from git.
|
69
|
+
You should stop the container with `make stop-local` in order to restore the
|
70
|
+
original configuration from the git repository.
|
71
|
+
|
72
|
+
In the folder `oxidized-config/, you will also find some example configs,
|
73
|
+
for example `config_csv-gitserver`. To use them, just copy the file to `config`.
|
74
|
+
|
75
|
+
## Git server public keys
|
76
|
+
To enable Oxidized to access the Git server, you'll need to retrieve the
|
77
|
+
servers' public SSH keys and store them under `oxidized-ssh/known_hosts`.
|
78
|
+
Without this, you will encounter the following error:
|
79
|
+
|
80
|
+
```
|
81
|
+
ERROR -- : Hook push_to_remote (#<GithubRepo:0x00007f4cff47d918>) failed (#<Rugged::SshError: invalid or unknown remote ssh hostkey>) for event :post_store
|
82
|
+
```
|
83
|
+
|
84
|
+
While the container environment is running (`make start`), open a separate shell
|
85
|
+
and run:
|
86
|
+
```
|
87
|
+
make gitserver-getkey
|
88
|
+
```
|
89
|
+
|
90
|
+
You do not need to restart the container environment; Oxidized will
|
91
|
+
automatically use the key the next time it pushes to the remote Git repository.
|
92
|
+
|
93
|
+
|
94
|
+
|