From 7478ade7bf65cca4d9250208172a59cf0dac2cd7 Mon Sep 17 00:00:00 2001 From: snuffy22 <22233310+snuffy22@users.noreply.github.com> Date: Thu, 16 Jul 2026 23:00:39 +1000 Subject: [PATCH 1/5] Add RouterOS7 GRE Tunnel Support --- netsim/ansible/templates/initial/routeros7.j2 | 14 +++++++++++++- netsim/devices/routeros7.yml | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/netsim/ansible/templates/initial/routeros7.j2 b/netsim/ansible/templates/initial/routeros7.j2 index c46cbd779c..4e570b8b02 100644 --- a/netsim/ansible/templates/initial/routeros7.j2 +++ b/netsim/ansible/templates/initial/routeros7.j2 @@ -25,6 +25,12 @@ /ipv6/address add interface=loopback address={{ loopback.ipv6 }} {% endif %} + +{% for l in interfaces if l.type == 'tunnel' %} +{% set t_type = 'gre6' if l.tunnel.af == 'ipv6' else 'gre' %} +/interface/{{ t_type }} add name={{ l.ifname }} local-address={{ l.tunnel._source[l.tunnel.af] }} remote-address={{ l.tunnel._destination[l.tunnel.af] }} +{% endfor %} + {% if vlans is defined %} {% include 'routeros7.vlan.j2' %} {% endif %} @@ -34,7 +40,13 @@ {% endif %} {% for l in interfaces|default([]) %} -{% set intf_type = 'vlan' if l.type == 'svi' else 'ethernet' %} +{% if l.type == 'svi' %} +{% set intf_type = 'vlan' %} +{% elif l.type == 'tunnel' and l.tunnel.mode|default('') == 'gre' %} +{% set intf_type = 'gre6' if l.tunnel.af == 'ipv6' else 'gre' %} +{% else %} +{% set intf_type = 'ethernet' %} +{% endif %} {% if l.name is defined %} /interface/{{ intf_type }} set comment="{{ l.name }}{{ " ["+l.role+"]" if l.role is defined else "" }}" {{ l.ifname }} diff --git a/netsim/devices/routeros7.yml b/netsim/devices/routeros7.yml index e7152879ba..aae8cd3825 100644 --- a/netsim/devices/routeros7.yml +++ b/netsim/devices/routeros7.yml @@ -5,6 +5,7 @@ support: interface_name: ether{ifindex} mgmt_if: ether1 loopback_interface_name: loopback{ifindex if ifindex else ""} +tunnel_interface_name: Tunnel{ifindex} ifindex_offset: 2 libvirt: image: mikrotik/chr7 @@ -45,6 +46,11 @@ features: bgp: True vxlan: vtep6: True + tunnel: + gre: True + routing: + static: + discard: true clab: image: vrnetlab/mikrotik_routeros:7.21.4 build: https://containerlab.dev/manual/kinds/vr-ros/ From 1ee84cd97c8bdf3f7f45d2646f017139e9275c58 Mon Sep 17 00:00:00 2001 From: snuffy22 <22233310+snuffy22@users.noreply.github.com> Date: Sat, 18 Jul 2026 08:46:40 +1000 Subject: [PATCH 2/5] Update to match GRE tunnel changes --- netsim/devices/routeros7.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netsim/devices/routeros7.yml b/netsim/devices/routeros7.yml index aae8cd3825..2f89d570ab 100644 --- a/netsim/devices/routeros7.yml +++ b/netsim/devices/routeros7.yml @@ -5,7 +5,7 @@ support: interface_name: ether{ifindex} mgmt_if: ether1 loopback_interface_name: loopback{ifindex if ifindex else ""} -tunnel_interface_name: Tunnel{ifindex} +tunnel_interface_name: tunnel{ifindex} ifindex_offset: 2 libvirt: image: mikrotik/chr7 @@ -47,7 +47,7 @@ features: vxlan: vtep6: True tunnel: - gre: True + gre: [ ipv4, ipv6, vrf ] routing: static: discard: true From 3b815d728677ca746cd87dcfcb2b2b7fc4af64b8 Mon Sep 17 00:00:00 2001 From: snuffy22 <22233310+snuffy22@users.noreply.github.com> Date: Sat, 18 Jul 2026 11:51:43 +1000 Subject: [PATCH 3/5] Add in documentation for GRE / Static routes --- docs/module/routing-static.txt | 1 + docs/plugins/tunnel.gre.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/module/routing-static.txt b/docs/module/routing-static.txt index 5f1699516c..e014ad3fbf 100644 --- a/docs/module/routing-static.txt +++ b/docs/module/routing-static.txt @@ -21,6 +21,7 @@ _netlab_ supports static routes on these platforms: | FRR | ✅ | ✅ | ✅ | ✅ | | Junos | ✅ | ✅ | ✅ | ❌ | | Linux | ✅ | ❌ | ❌ | ❌ | +| Mikrotik RoutersOS 7 | ✅ | ✅ | ❌ | ❌ | | Nokia SR Linux | ✅ | ✅ | ✅ | ❌ | | Nokia SR OS[^SROS] | ✅ | ✅ | ✅ | ❌ | | OpenBSD | ✅ | ✅ | ❌ | ❌ | diff --git a/docs/plugins/tunnel.gre.md b/docs/plugins/tunnel.gre.md index 6028af8e10..2d7844c64f 100644 --- a/docs/plugins/tunnel.gre.md +++ b/docs/plugins/tunnel.gre.md @@ -13,6 +13,7 @@ The plugin includes Jinja2 templates for the following platforms: | FRR |✅|✅|✅| | Juniper vJunos-switch |✅|✅|✅| | Juniper vSRX |✅|✅|✅| +| Mikrotik RouterOS 7 |✅|✅|✅| | VyOS |✅|✅|✅| [^18v]: Includes Cisco IOSv, Cisco IOSvL2, Cisco CSR 1000v, Cisco Catalyst 8000v, Cisco IOS-on-Linux (IOL), and IOL Layer-2 image. From 46c11f74257b8750048ec0ea0f23b296d2c1429a Mon Sep 17 00:00:00 2001 From: snuffy22 <22233310+snuffy22@users.noreply.github.com> Date: Sun, 19 Jul 2026 13:13:55 +1000 Subject: [PATCH 4/5] Remove static routing changes from GRE change for RouterOS7 --- docs/module/routing-static.txt | 1 - netsim/devices/routeros7.yml | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/module/routing-static.txt b/docs/module/routing-static.txt index e014ad3fbf..5f1699516c 100644 --- a/docs/module/routing-static.txt +++ b/docs/module/routing-static.txt @@ -21,7 +21,6 @@ _netlab_ supports static routes on these platforms: | FRR | ✅ | ✅ | ✅ | ✅ | | Junos | ✅ | ✅ | ✅ | ❌ | | Linux | ✅ | ❌ | ❌ | ❌ | -| Mikrotik RoutersOS 7 | ✅ | ✅ | ❌ | ❌ | | Nokia SR Linux | ✅ | ✅ | ✅ | ❌ | | Nokia SR OS[^SROS] | ✅ | ✅ | ✅ | ❌ | | OpenBSD | ✅ | ✅ | ❌ | ❌ | diff --git a/netsim/devices/routeros7.yml b/netsim/devices/routeros7.yml index 2f89d570ab..cd440b4b9c 100644 --- a/netsim/devices/routeros7.yml +++ b/netsim/devices/routeros7.yml @@ -36,6 +36,8 @@ features: vpn: true ospf: true bfd: true + tunnel: + gre: [ ipv4, ipv6, vrf ] vlan: model: l3-switch svi_interface_name: "vlan{vlan}" @@ -46,11 +48,6 @@ features: bgp: True vxlan: vtep6: True - tunnel: - gre: [ ipv4, ipv6, vrf ] - routing: - static: - discard: true clab: image: vrnetlab/mikrotik_routeros:7.21.4 build: https://containerlab.dev/manual/kinds/vr-ros/ From d33a1a4683d4818d2f4cfcee35db11a7162d4f3c Mon Sep 17 00:00:00 2001 From: snuffy22 <22233310+snuffy22@users.noreply.github.com> Date: Sun, 19 Jul 2026 15:25:10 +1000 Subject: [PATCH 5/5] Fix GRE guard on interface creation --- netsim/ansible/templates/initial/routeros7.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netsim/ansible/templates/initial/routeros7.j2 b/netsim/ansible/templates/initial/routeros7.j2 index 4e570b8b02..f56a3151f3 100644 --- a/netsim/ansible/templates/initial/routeros7.j2 +++ b/netsim/ansible/templates/initial/routeros7.j2 @@ -26,7 +26,7 @@ {% endif %} -{% for l in interfaces if l.type == 'tunnel' %} +{% for l in interfaces if l.type == 'tunnel' and l.tunnel.mode == 'gre' %} {% set t_type = 'gre6' if l.tunnel.af == 'ipv6' else 'gre' %} /interface/{{ t_type }} add name={{ l.ifname }} local-address={{ l.tunnel._source[l.tunnel.af] }} remote-address={{ l.tunnel._destination[l.tunnel.af] }} {% endfor %} @@ -42,7 +42,7 @@ {% for l in interfaces|default([]) %} {% if l.type == 'svi' %} {% set intf_type = 'vlan' %} -{% elif l.type == 'tunnel' and l.tunnel.mode|default('') == 'gre' %} +{% elif l.type == 'tunnel' and l.tunnel.mode == 'gre' %} {% set intf_type = 'gre6' if l.tunnel.af == 'ipv6' else 'gre' %} {% else %} {% set intf_type = 'ethernet' %}