19 lines
1014 B
Plaintext
19 lines
1014 B
Plaintext
# Creates an isolated /30 network for the IDS container.
|
|
# Defaults: RouterOS 172.31.255.1, container 172.31.255.2.
|
|
|
|
:if ([:len [/interface/bridge/find where name="br-ids"]] = 0) do={
|
|
/interface/bridge/add name=br-ids comment="Suricata IDS container bridge"
|
|
}
|
|
:if ([:len [/ip/address/find where interface="br-ids" and address="172.31.255.1/30"]] = 0) do={
|
|
/ip/address/add address=172.31.255.1/30 interface=br-ids comment="Suricata IDS gateway"
|
|
}
|
|
:if ([:len [/interface/veth/find where name="veth-ids"]] = 0) do={
|
|
/interface/veth/add name=veth-ids address=172.31.255.2/30 gateway=172.31.255.1 comment="Suricata IDS container"
|
|
}
|
|
:if ([:len [/interface/bridge/port/find where bridge="br-ids" and interface="veth-ids"]] = 0) do={
|
|
/interface/bridge/port/add bridge=br-ids interface=veth-ids
|
|
}
|
|
:if ([:len [/ip/firewall/nat/find where comment="Suricata IDS outbound NAT"]] = 0) do={
|
|
/ip/firewall/nat/add chain=srcnat src-address=172.31.255.0/30 action=masquerade comment="Suricata IDS outbound NAT"
|
|
}
|