@usex/mikrotik-mcp 4.6.0 → 4.8.0

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 (47) hide show
  1. package/README.md +35 -28
  2. package/dist/cli.js +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/shared/{cli-hfhmh1qe.js → cli-s2s6hryh.js} +4725 -3226
  5. package/dist/shared/{cli-6xcbh1kn.js → cli-xfa5x65h.js} +1 -1
  6. package/dist/shared/{library-8hq0qqwm.js → library-6zh75zhp.js} +1 -1
  7. package/dist/shared/{library-399v2azd.js → library-wm3vc8kq.js} +4725 -3226
  8. package/dist/ui/observability.html +4 -4
  9. package/package.json +1 -1
  10. package/prompts/security-hardening-sweep.md +132 -0
  11. package/prompts/setup-eoip-tunnel-between-sites.md +119 -0
  12. package/prompts/setup-gre-tunnel-between-sites.md +163 -0
  13. package/prompts/setup-ipip-tunnel-between-sites.md +110 -0
  14. package/prompts/setup-openvpn-tunnel-between-sites.md +136 -0
  15. package/prompts/setup-sstp-tunnel-between-sites.md +136 -0
  16. package/prompts/setup-tunnel-between-sites.md +55 -8
  17. package/prompts/setup-vxlan-tunnel-between-sites.md +129 -0
  18. package/prompts/setup-wireguard-tunnel-between-sites.md +183 -0
  19. package/schemas/README.md +1 -1
  20. package/schemas/tool-catalog.json +674 -6
  21. package/schemas/tools/add_firewall_default_deny.json +25 -0
  22. package/schemas/tools/add_ip_address.json +7 -1
  23. package/schemas/tools/add_ipv6_address.json +7 -1
  24. package/schemas/tools/apply_security_hardening_fixes.json +25 -0
  25. package/schemas/tools/audit_account_hygiene.json +7 -0
  26. package/schemas/tools/audit_address_list_enforcement.json +7 -0
  27. package/schemas/tools/audit_certificate_hygiene.json +7 -0
  28. package/schemas/tools/audit_connection_tracking_helpers.json +7 -0
  29. package/schemas/tools/audit_dns_resolver_exposure.json +7 -0
  30. package/schemas/tools/audit_firewall_default_deny.json +7 -0
  31. package/schemas/tools/audit_ip_service_exposure.json +7 -0
  32. package/schemas/tools/audit_ipv6_firewall_baseline.json +7 -0
  33. package/schemas/tools/audit_kernel_ip_hardening.json +7 -0
  34. package/schemas/tools/audit_management_plane_exposure.json +7 -0
  35. package/schemas/tools/audit_network_segmentation.json +7 -0
  36. package/schemas/tools/audit_ssh_hardening.json +7 -0
  37. package/schemas/tools/bootstrap_ipv6_firewall_baseline.json +25 -0
  38. package/schemas/tools/enforce_address_list_blocking.json +25 -0
  39. package/schemas/tools/fix_certificate_crl_policy.json +25 -0
  40. package/schemas/tools/fix_password_policy.json +25 -0
  41. package/schemas/tools/harden_connection_tracking_helpers.json +25 -0
  42. package/schemas/tools/harden_dns_resolver_exposure.json +25 -0
  43. package/schemas/tools/harden_ip_service_exposure.json +25 -0
  44. package/schemas/tools/harden_kernel_ip_settings.json +25 -0
  45. package/schemas/tools/harden_management_plane_exposure.json +25 -0
  46. package/schemas/tools/harden_ssh_service.json +25 -0
  47. package/schemas/tools/run_security_hardening_audit.json +29 -0
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: setup-openvpn-tunnel-between-sites
3
+ title: Build an OpenVPN (TLS) tunnel between two MikroTik devices
4
+ description: Configure a MikroTik-to-MikroTik OpenVPN site-to-site link — certificates, PPP profile + secret, server + client, L3 (ip) or L2 (ethernet) mode, routing, firewall — over TCP/UDP 443 for HTTPS-like camouflage. Verified end to end, with DPI/censorship-bypass guidance.
5
+ arguments:
6
+ - name: server_device
7
+ description: The device that will run the OpenVPN SERVER — reachable public IP/DDNS + a certificate. Config key or label from list_mikrotik_devices.
8
+ required: false
9
+ - name: client_device
10
+ description: The device that will run the OpenVPN CLIENT (may be behind NAT). Config key or label.
11
+ required: false
12
+ - name: mode
13
+ description: Tunnel mode — "ip" (L3 routed, default) or "ethernet" (L2 TAP, bridgeable across sites). Omit for ip.
14
+ required: false
15
+ - name: protocol
16
+ description: Transport — "tcp" (works with 443 camouflage, survives more DPI) or "udp" (faster). Omit for tcp when bypassing blocks, udp otherwise.
17
+ required: false
18
+ - name: port
19
+ description: Port for OpenVPN. 1194 is default; use 443 to look like HTTPS through restrictive networks. Omit for 1194.
20
+ required: false
21
+ ---
22
+
23
+ You are building an **OpenVPN site-to-site tunnel between two MikroTik routers**.
24
+ OpenVPN is a mature TLS VPN: it can be **L3 routed (`mode=ip`)** or **L2 bridgeable
25
+ (`mode=ethernet`/TAP)**, over **TCP or UDP**, and on **any port** — running it on
26
+ **TCP 443** makes it look like HTTPS, a strong DPI-bypass option (a different TLS
27
+ fingerprint than SSTP). It is client↔server: one device is the **server** (reachable
28
+ endpoint + certificate), the other the **client** (NAT-friendly). Drive both via the
29
+ `device` argument. Confirm before writing — this touches certificates, PPP, and the
30
+ firewall.
31
+
32
+ Server device: {{server_device}}
33
+ Client device: {{client_device}}
34
+ Mode: {{mode}}
35
+ Protocol: {{protocol}}
36
+ Port: {{port}}
37
+
38
+ ## 0. Discover and assign roles (FIRST)
39
+
40
+ - `list_mikrotik_devices`; resolve {{server_device}}/{{client_device}} — never
41
+ substitute a similar name; ask which is which if omitted.
42
+ - The **server** must be reachable on the chosen `port`/`protocol` (static WAN or
43
+ DDNS). The **client** only needs outbound reach. Confirm roles.
44
+ - Choose `mode`: **ip** for routed site-to-site (recommended default — cleaner,
45
+ faster); **ethernet** only if the user needs a stretched L2 domain (then bridge the
46
+ interface at both ends, with the same STP / single-DHCP warnings as EoIP/VXLAN).
47
+
48
+ ## 1. Facts (read-only, per device)
49
+
50
+ Per side: `get_system_identity`, `list_ip_addresses`, `get_routing_table`,
51
+ `get_ip_cloud`, and on the server `list_certificates`. Record server public
52
+ address/DDNS, LAN subnets (must not overlap for `mode=ip`), and existing certs.
53
+
54
+ ## 2. Certificates
55
+
56
+ OpenVPN needs a server certificate; with `require_client_certificate=true` it also
57
+ needs a client cert (recommended — stronger than username/password alone):
58
+
59
+ - If absent: `create_certificate` a CA → `sign_certificate` (self-signed); then a
60
+ **server** cert (CN=server address) and a **client** cert, each `sign_certificate`
61
+ by the CA.
62
+ - `import_certificate` the CA (and client cert) onto the client. RouterOS OpenVPN
63
+ historically wants explicit certs on both ends — plan for it rather than relying on
64
+ username/password only.
65
+
66
+ ## 3. PPP profile + secret (server side)
67
+
68
+ - `create_ppp_profile` — `local-address`=server tunnel IP, `remote-address`=client
69
+ tunnel IP or pool; optional DNS/routes.
70
+ - `create_ppp_secret` — strong `name`/`password`, `service=ovpn`, `profile`=above.
71
+
72
+ ## 4. Enable the OpenVPN server (server side)
73
+
74
+ `add_ovpn_server` (`device={{server_device}}`) — `name`=`ovpn-srv`, `port`={{port}}
75
+ or (443 for camouflage / 1194 default), `protocol`={{protocol}} or tcp,
76
+ `mode`={{mode}} or ip, `certificate`=<server cert>, `require_client_certificate=true`,
77
+ `auth=sha256`, `cipher=aes256-gcm,aes256-cbc`, `tls_version=only-1.2`,
78
+ `default_profile`=the profile, `enabled` (or `enable_ovpn_server`). Strong cipher +
79
+ TLS 1.2 both hardens and looks like modern HTTPS.
80
+
81
+ ## 5. Client (client side)
82
+
83
+ `create_ovpn_client` (`device={{client_device}}`) — `name`=`ovpn-{{server_device}}`,
84
+ `connect_to`=server public IP/DDNS, `port`={{port}} or match, `protocol`=match,
85
+ `mode`=match, `user`/`password`=the PPP secret, `certificate`=<client cert>,
86
+ `verify_server_certificate=true`, `cipher`/`auth`/`tls_version` matching the server.
87
+ Use `route_nopull=true` if you want to control routing manually (recommended for
88
+ site-to-site), else the server can push routes.
89
+
90
+ ## 6. Route (mode=ip) or bridge (mode=ethernet)
91
+
92
+ - **mode=ip:** transit link is up once connected; `add_route` far LAN on each side
93
+ (server→client-LAN, client→server-LAN) via the tunnel interface / transit IP. Or
94
+ push routes from the server profile.
95
+ - **mode=ethernet:** add the OVPN interface as a **bridge port** on each side's LAN
96
+ bridge (one L2 domain) — enable STP, single DHCP authority, watch MTU.
97
+
98
+ ## 7. Firewall — safely
99
+
100
+ Under Safe Mode per device: server `input` accept `protocol={{protocol}} (tcp)
101
+ dst-port={{port}}` (443/1194) from the client's source (any if dynamic), high in the
102
+ chain; both sides `forward` allow the two LANs.
103
+
104
+ ## 8. MTU / MSS
105
+
106
+ OpenVPN adds notable overhead; TCP mode risks TCP-in-TCP stalls. Set the client
107
+ `max_mtu` conservatively (~1400), clamp MSS on `forward`. UDP mode is faster where
108
+ it isn't blocked; TCP/443 is for reachability.
109
+
110
+ ## 9. Verify
111
+
112
+ - Server: `list_ovpn_servers`/`get_ovpn_server` running; the client appears as a
113
+ connected session. Client: `get_ovpn_client` status `connected`, address assigned.
114
+ - `ping` (`device=server`) client tunnel/LAN (with `src_address`=server-LAN), repeat
115
+ from client. For `mode=ethernet`, prove same-subnet L2 reachability + DHCP. Large-
116
+ payload ping to confirm MTU.
117
+
118
+ ## Bypassing country / DPI restrictions (legitimate circumvention)
119
+
120
+ Lawful privacy/accessibility only; comply with local law and terms. OpenVPN on
121
+ **TCP 443** presents a TLS session on the HTTPS port — a strong native bypass with a
122
+ **different fingerprint from SSTP**, so it's the natural second option if SSTP is
123
+ blocked. Maximize blend-in: `protocol=tcp`, `port=443`, `tls_version=only-1.2`, AES-
124
+ GCM, valid-looking cert. Note: classic OpenVPN has a recognizable TLS handshake that
125
+ sophisticated DPI (active probing / TLS-fingerprint allow-lists) can still flag —
126
+ if that's the adversary, escalate to **container-based obfuscation** (XRay/VLESS+
127
+ Reality, sing-box, Shadowsocks, obfs4) in a RouterOS `/container` or a VPS (not
128
+ native, heaviest, most robust), or run WireGuard _inside_ this OpenVPN link. Compare
129
+ with `setup-sstp-tunnel-between-sites` and pick the transport the local DPI doesn't
130
+ recognize. Never present obfuscation as a guarantee — it's an arms race.
131
+
132
+ ---
133
+
134
+ Report: certs used, PPP profile/secret, server + client settings (mode/protocol/port),
135
+ routing or bridging, firewall added, MTU/MSS, verification results. State which device
136
+ each change ran on. Never apply changes the user hasn't approved.
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: setup-sstp-tunnel-between-sites
3
+ title: Build an SSTP (TLS/443) tunnel between two MikroTik devices
4
+ description: Configure a MikroTik-to-MikroTik SSTP site-to-site link — server certificate, PPP profile + secret, client, routing, firewall — over TCP 443 so it looks like HTTPS. The go-to transport for bypassing VPN blocks / DPI. Verified end to end.
5
+ arguments:
6
+ - name: server_device
7
+ description: The device that will run the SSTP SERVER — the one with a reachable public IP / DDNS and (ideally) a certificate. Config key or label from list_mikrotik_devices.
8
+ required: false
9
+ - name: client_device
10
+ description: The device that will run the SSTP CLIENT (may be behind NAT). Config key or label.
11
+ required: false
12
+ - name: tunnel_subnet
13
+ description: Transit subnet for the PPP link, e.g. 10.255.255.0/30 (server=.1 local, client=.2 remote). Omit to let you pick one that collides with neither LAN.
14
+ required: false
15
+ - name: port
16
+ description: TCP port for SSTP. Default and recommended 443 (looks like HTTPS, survives most DPI). Omit for 443.
17
+ required: false
18
+ ---
19
+
20
+ You are building an **SSTP site-to-site tunnel between two MikroTik routers**. SSTP
21
+ is **PPP inside TLS over TCP (default 443)** — on the wire it is nearly
22
+ indistinguishable from an HTTPS session, which makes it the **best native RouterOS
23
+ choice for bypassing VPN blocks and DPI**. It is client↔server (asymmetric): one
24
+ device is the **server** (needs a reachable endpoint + a TLS certificate), the other
25
+ is the **client** (can be behind NAT). Drive both via the `device` argument. This
26
+ touches certificates, PPP, and the firewall — go carefully and confirm before writing.
27
+
28
+ Server device: {{server_device}}
29
+ Client device: {{client_device}}
30
+ Transit subnet: {{tunnel_subnet}}
31
+ Port: {{port}}
32
+
33
+ ## 0. Discover and assign roles (FIRST)
34
+
35
+ - `list_mikrotik_devices`; resolve {{server_device}}/{{client_device}} — never
36
+ substitute a similar name; ask which is which if omitted.
37
+ - The **server** must be reachable on the chosen TCP `port` (static WAN or DDNS via
38
+ `/ip cloud`). The **client** only needs outbound TCP to that port — NAT-friendly.
39
+ Confirm roles with the user before proceeding.
40
+
41
+ ## 1. Facts (read-only, per device)
42
+
43
+ Per side (`device=<name>`): `get_system_identity`, `list_ip_addresses`,
44
+ `get_routing_table`, `get_ip_cloud`, and on the server `list_certificates`. Record
45
+ the server's public address/DDNS, each LAN subnet (must not overlap), and whether a
46
+ usable server certificate already exists.
47
+
48
+ ## 2. Server certificate (server side)
49
+
50
+ SSTP requires a TLS certificate on the server. If none exists:
51
+
52
+ - `create_certificate` a local CA, then `create_certificate` a server cert (common-
53
+ name = the server's public IP/DDNS the client will connect to), `sign_certificate`
54
+ both (CA self-signed, server signed by the CA). Note the server cert name.
55
+ - The client should trust that CA: either `import_certificate` the CA on the client,
56
+ or set the client's `verify_server_certificate=false` (simpler, but skips
57
+ authenticity — acceptable only if the PSK-like PPP credentials are strong; state
58
+ the trade-off). A publicly-trusted (Let's Encrypt) cert avoids this — see
59
+ `manage-certificates`.
60
+
61
+ ## 3. PPP profile + secret (server side)
62
+
63
+ - `create_ppp_profile` — set `local-address`=server transit IP (e.g. `10.255.255.1`),
64
+ `remote-address`=client transit IP (e.g. `10.255.255.2`) or a small pool. Optionally
65
+ set DNS. This profile defines the tunnel's L3 endpoints.
66
+ - `create_ppp_secret` — `name`/`password` (strong), `service=sstp`, `profile`=the
67
+ profile above. These are the client's login credentials.
68
+
69
+ ## 4. Enable the SSTP server (server side)
70
+
71
+ `set_sstp_server` (`device={{server_device}}`) — `enabled=true`,
72
+ `certificate`=<server cert>, `port`={{port}} or 443, `default_profile`=the profile,
73
+ `authentication=mschap2` (drop weaker methods), `tls_version=only-1.2`, `pfs=true`,
74
+ `force_aes=true`. Strong ciphers + TLS 1.2-only both hardens and makes the flow look
75
+ like modern HTTPS.
76
+
77
+ ## 5. Client (client side)
78
+
79
+ `create_sstp_client` (`device={{client_device}}`) — `name`=`sstp-{{server_device}}`,
80
+ `connect_to`/server address = the server's public IP/DDNS, `port`={{port}} or 443,
81
+ `user`/`password` = the PPP secret from step 3, `verify_server_certificate` per step 2,
82
+ `tls_version=only-1.2`, `pfs=true`, `authentication=mschap2`. The client auto-creates
83
+ the PPP interface and gets the transit `remote-address`.
84
+
85
+ ## 6. Route each far LAN
86
+
87
+ The transit /30 is connected once the PPP link is up. Add routes for the far LANs:
88
+
89
+ - On the server: `add_route` dst=client-LAN gw=the client's transit IP (or the
90
+ dynamic SSTP interface).
91
+ - On the client: `add_route` dst=server-LAN gw=the server's transit IP (or the SSTP
92
+ interface). Or push routes via the PPP profile.
93
+
94
+ ## 7. Firewall — safely
95
+
96
+ Under Safe Mode per device (`enable_safe_mode`→edits→verify→`commit_safe_mode`):
97
+
98
+ - Server `input`: accept `protocol=tcp dst-port={{port}}` (443) from anywhere the
99
+ client may source from (dynamic clients ⇒ from any), placed above any default drop.
100
+ - Both sides `forward`: allow the two LANs both directions.
101
+
102
+ ## 8. MTU / MSS
103
+
104
+ SSTP over TCP/TLS adds overhead and is prone to TCP-in-TCP meltdown on lossy links.
105
+ Set the client `max_mtu`/`max_mru` conservatively (~1400) and clamp MSS on `forward`.
106
+ Prefer this transport for _reachability_, not raw throughput.
107
+
108
+ ## 9. Verify
109
+
110
+ - Server: `get_sstp_server` enabled; check active PPP (the client should appear as a
111
+ connected session). Client: `get_sstp_client` — status `connected`, transit IP
112
+ assigned.
113
+ - `ping` (`device=server`) the client transit IP then a client-LAN host with
114
+ `src_address`=server-LAN IP; repeat from the client. `traceroute` if a path is off.
115
+
116
+ ## Why this is the bypass workhorse (legitimate circumvention)
117
+
118
+ Lawful privacy/accessibility only; comply with local law and terms. SSTP on TCP 443
119
+ **is** the DPI-bypass technique for native RouterOS — it presents as a standard TLS
120
+ session to a common HTTPS port, so it passes most "block VPN protocols" filters that
121
+ stop WireGuard/IKE/GRE. To maximize blend-in: keep `port=443`, `tls_version=only-1.2`,
122
+ strong AES + PFS, and a certificate with a plausible CN. If SSTP itself is
123
+ fingerprinted/blocked (active probing, TLS-fingerprint allow-lists), escalate to:
124
+ **OpenVPN TCP/443** (`setup-openvpn-tunnel-between-sites`) for a different TLS
125
+ signature, or **container-based obfuscation** (XRay/VLESS+Reality, sing-box,
126
+ Shadowsocks, obfs4) run in a RouterOS `/container` or a VPS — not native, heaviest,
127
+ most robust. You can also run WireGuard _inside_ this SSTP link so the WG handshake
128
+ never touches the open internet. Never present obfuscation as a guarantee — it's an
129
+ arms race.
130
+
131
+ ---
132
+
133
+ Report: server cert used, PPP profile/secret, server settings, client status, routes
134
+
135
+ - firewall added, MTU/MSS, verification results. State which device each change ran
136
+ on. Never apply changes the user hasn't approved.
@@ -4,19 +4,29 @@ title: Build a tunnel between two MikroTik devices
4
4
  description: Configure BOTH routers of a site-to-site tunnel from one conversation, then verify it end to end.
5
5
  arguments:
6
6
  - name: device_a
7
- description: Name of the first configured device (see list_mikrotik_devices), e.g. site-a.
8
- required: true
7
+ description: First configured device (config key or label from list_mikrotik_devices), e.g. site-a. Omit to discover and choose.
8
+ required: false
9
9
  - name: device_b
10
- description: Name of the second configured device, e.g. site-b.
11
- required: true
10
+ description: Second configured device, e.g. site-b. Omit to discover and choose.
11
+ required: false
12
12
  - name: technology
13
- description: Tunnel type to use — wireguard, ipsec, gre, eoip, or "recommend" to let you choose.
13
+ description: Tunnel type — wireguard, ipsec, gre, ipip, eoip, vxlan, sstp, ovpn, or "recommend" to let you choose. For a deep, tech-specific walkthrough use setup-wireguard-tunnel-between-sites or setup-gre-tunnel-between-sites.
14
14
  required: false
15
15
  ---
16
16
 
17
17
  You are configuring a **site-to-site tunnel between two MikroTik routers** that
18
18
  this server can both reach. You will drive BOTH devices in one flow by passing
19
- the `device` argument on each tool call.
19
+ the `device` argument on each tool call. This is the general chooser-and-builder;
20
+ for a detailed, tech-specific flow prefer the dedicated per-technology prompts,
21
+ which cover keys/certs, MTU/MSS, and DPI-bypass transports in depth:
22
+ **`setup-wireguard-tunnel-between-sites`** (WireGuard),
23
+ **`setup-gre-tunnel-between-sites`** (GRE + IPsec),
24
+ **`setup-ipip-tunnel-between-sites`** (IP-in-IP),
25
+ **`setup-eoip-tunnel-between-sites`** (L2 bridgeable),
26
+ **`setup-vxlan-tunnel-between-sites`** (L2 overlay / multipoint),
27
+ **`setup-ipsec-site-to-site`** (IKEv2 policy-based),
28
+ **`setup-sstp-tunnel-between-sites`** and
29
+ **`setup-openvpn-tunnel-between-sites`** (TLS/443 — the bypass workhorses).
20
30
 
21
31
  Device A: {{device_a}}
22
32
  Device B: {{device_b}}
@@ -24,6 +34,13 @@ Requested technology: {{technology}}
24
34
 
25
35
  Work in this order, confirming the plan before any change:
26
36
 
37
+ 0. **Discover both endpoints.** Call `list_mikrotik_devices` first and resolve
38
+ {{device_a}} / {{device_b}} against it — never substitute a similar name (these
39
+ are different physical routers). If either was omitted, ask which two devices to
40
+ connect. Note which side (if any) has a reachable public endpoint vs. is behind
41
+ NAT — if **both** are behind NAT with no forward, a direct tunnel can't form
42
+ (use a reachable side or a relay/VPS).
43
+
27
44
  1. **Inventory both ends.** Call `list_mikrotik_devices` first. Then, for each of
28
45
  {{device_a}} and {{device_b}}, gather facts with `device=<name>`:
29
46
  `get_system_identity`, `list_interfaces`, `list_ip_addresses`,
@@ -48,10 +65,40 @@ Work in this order, confirming the plan before any change:
48
65
  (`device=<name>`) per device before firewall edits, verify, then
49
66
  `commit_safe_mode` — Safe Mode is tracked per device, so each router commits
50
67
  independently.
51
- 5. **Verify end to end.** From {{device_a}} run `ping` (`device={{device_a}}`) to
68
+ 5. **MTU / MSS.** Every tunnel shrinks the usable MTU (WireGuard ~60 B, GRE 24 B,
69
+ GRE+IPsec ~70+ B), so small pings pass but large TLS/file flows stall. Set the
70
+ tunnel interface MTU accordingly (WG 1420, GRE 1476, lower on PPPoE / when also
71
+ IPsec-wrapped) and clamp TCP MSS (`clamp-tcp-mss` on the tunnel, or a `forward`
72
+ mangle `change-mss new-mss=clamp-to-pmtu tcp-flags=syn`). Confirm non-overlapping
73
+ LANs before routing — overlap makes the far route ambiguous.
74
+ 6. **Verify end to end.** From {{device_a}} run `ping` (`device={{device_a}}`) to
52
75
  the far tunnel address and a host in B's LAN (set `src_address` to A's LAN IP);
53
76
  repeat from {{device_b}}. For IPsec, check `get_ipsec_active_peers` on both.
54
- Use `traceroute` if a path is wrong.
77
+ Test a large payload (ping size 1400, do-not-fragment) to catch MTU issues. Use
78
+ `traceroute` if a path is wrong.
79
+
80
+ ## Bypassing country / DPI restrictions (legitimate censorship circumvention)
81
+
82
+ For lawful privacy / accessibility on networks you're authorized to use — comply
83
+ with local law and service terms. Escalate only as far as the block requires:
84
+
85
+ - **Port camouflage** — run the encrypted tunnel on a rarely-filtered port (UDP/443
86
+ for WireGuard, UDP 4500 for IPsec NAT-T). Cheapest; hides the port, not the
87
+ handshake.
88
+ - **TLS-looking transport** — where DPI fingerprints WireGuard/IKE, wrap the routed
89
+ tunnel in **SSTP** (PPP-over-TLS, TCP 443 — looks like HTTPS) or **OpenVPN TCP/443**
90
+ (`create_sstp_client` / `create_ovpn_client`) and route the far LANs over that, or
91
+ run WG/GRE inside it. Trades throughput for reachability.
92
+ - **Alternate fingerprint** — if one protocol is specifically blocked, switch: WG↔
93
+ IKEv2↔SSTP present different signatures on the wire.
94
+ - **Container-based obfuscation (advanced)** — the strongest anti-DPI tools
95
+ (XRay/VLESS+Reality, sing-box, Shadowsocks, obfs4) are **not native** to RouterOS;
96
+ run one in a **`/container`** or on a VPS you control and route the site tunnel
97
+ through it. Confirm container support and spare resources first.
98
+
99
+ Recommend the lightest option that works; never present obfuscation as a guarantee.
100
+ The dedicated `setup-wireguard-tunnel-between-sites` and
101
+ `setup-gre-tunnel-between-sites` prompts cover these transports in more depth.
55
102
 
56
103
  Report the tunnel parameters used on each side, the verification results, and any
57
104
  follow-ups (e.g. routes still needed). Never apply changes the user hasn't approved.
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: setup-vxlan-tunnel-between-sites
3
+ title: Build a VXLAN overlay between two (or more) MikroTik devices
4
+ description: Configure a VXLAN L2 overlay across MikroTik routers — VNI, VTEP peering, bridging, MTU — for multi-site / multi-tenant L2. Honest about RouterOS VTEP tooling limits; recommends EoIP for a simple two-site link.
5
+ arguments:
6
+ - name: device_a
7
+ description: First configured device (config key or label from list_mikrotik_devices), e.g. site-a.
8
+ required: false
9
+ - name: device_b
10
+ description: Second configured device, e.g. site-b.
11
+ required: false
12
+ - name: vni
13
+ description: VXLAN Network Identifier (VNI, 1–16777215). MUST match on every VTEP in this overlay. Omit to let you pick one.
14
+ required: false
15
+ - name: port
16
+ description: VXLAN UDP port. Default 8472 (Linux/MikroTik); 4789 is the IANA standard. Pick one that suits the path.
17
+ required: false
18
+ ---
19
+
20
+ You are building a **VXLAN Layer-2 overlay across MikroTik routers** this server can
21
+ reach. VXLAN encapsulates Ethernet in **UDP** and identifies each virtual segment by
22
+ a 24-bit **VNI**, so it scales to millions of segments and — unlike EoIP — is
23
+ naturally **multipoint** (three+ sites on one overlay) and firewall-friendly (it's
24
+ just UDP). Two honest caveats up front, state them to the user:
25
+
26
+ 1. **For a simple TWO-site L2 link, EoIP is usually the better fit** (fewer moving
27
+ parts, built-in keepalive + IPsec option). Use VXLAN when you need **multipoint**
28
+ or many segments. If the user only wants two sites bridged, recommend
29
+ `setup-eoip-tunnel-between-sites` unless they specifically want VXLAN.
30
+ 2. **RouterOS unicast VXLAN needs per-peer VTEP entries** (`/interface vxlan vteps`).
31
+ This MCP's `create_vxlan_tunnel` builds the VXLAN interface and its options but
32
+ does **not** expose a dedicated add-VTEP tool. So for static-unicast peering you
33
+ will add the remote VTEPs with the raw command tool (`run_routeros_command` /
34
+ the raw-command escape hatch) — call this out and get approval, or use a
35
+ **multicast** group for flood/learn if the WAN path carries multicast (rare across
36
+ the internet).
37
+
38
+ Drive each device via the `device` argument. Confirm the plan before any change.
39
+
40
+ Device A: {{device_a}}
41
+ Device B: {{device_b}}
42
+ VNI: {{vni}}
43
+ UDP port: {{port}}
44
+
45
+ ## 0. Discover and confirm (FIRST)
46
+
47
+ - `list_mikrotik_devices`; resolve the endpoints — never substitute a similar name;
48
+ ask which devices if omitted. VXLAN can span more than two, so ask for the full
49
+ VTEP list if it's a multipoint overlay.
50
+ - Because VXLAN is UDP, each VTEP just needs to reach the others' public IP on the
51
+ chosen `port` — NAT-friendly (unlike GRE/EoIP protocol 47). Note each site's
52
+ reachable source IP (the local VTEP address).
53
+ - **L2 safety:** as with EoIP, VXLAN stretches a broadcast domain — decide the single
54
+ DHCP authority, enable STP, and warn about loops before bridging.
55
+
56
+ ## 1. Facts (read-only, per device)
57
+
58
+ Per side (`device=<name>`): `get_system_identity`, `list_interfaces`,
59
+ `list_ip_addresses`, `get_routing_table`, `get_ip_cloud`. Record each VTEP's source
60
+ IP/interface, WAN MTU, target bridge, and the segment to carry.
61
+
62
+ ## 2. Plan
63
+
64
+ Pick `vni`={{vni}} (identical on every VTEP), `port`={{port}} or 8472, and the local
65
+ source address/interface for each VTEP. Confirm interface names (`vxlan<vni>`) and
66
+ the peer VTEP IP list with the user.
67
+
68
+ ## 3. Create the VXLAN interface (each device)
69
+
70
+ On each device: `create_vxlan_tunnel` — `name`=`vxlan{{vni}}`, `vni`={{vni}},
71
+ `port`={{port}}, `local_address`=this site's VTEP source IP (or `interface`=source
72
+ interface), `mtu` per step 6. (`vteps_ip_version` if you're doing IPv6 VTEPs.)
73
+
74
+ ## 4. Peer the VTEPs (the multipoint step)
75
+
76
+ For **static unicast** (internet-friendly): on each device add every OTHER site's
77
+ VTEP as a remote VTEP under this VXLAN interface. Since there's no dedicated tool,
78
+ use the raw-command tool with the user's approval, e.g.
79
+ `/interface vxlan vteps add interface=vxlan{{vni}} remote-ip=<peer VTEP IP>` — repeat
80
+ for each peer, on each device (full mesh). For **multicast** flood/learn instead,
81
+ set the multicast group on the interface (only viable if the path carries multicast).
82
+
83
+ ## 5. Bridge the overlay (L2 step)
84
+
85
+ Add the VXLAN interface as a **bridge port** on the LAN bridge that owns the segment,
86
+ on every site. Enable **STP/RSTP**. Do not put an IP on the VXLAN interface (it's a
87
+ bridge member). One DHCP authority for the stretched segment.
88
+
89
+ ## 6. MTU / MSS (VXLAN eats 50 bytes)
90
+
91
+ VXLAN adds a **50-byte** header (UDP+VXLAN+inner-Ethernet). If the WAN MTU is 1500,
92
+ either raise the underlay MTU/L2MTU to ~1550 (if the path supports jumbo) or lower
93
+ the guests' effective MTU / clamp MSS so encapsulated frames don't fragment. This is
94
+ the #1 VXLAN gotcha — verify with a large-frame test.
95
+
96
+ ## 7. Firewall — safely, per device
97
+
98
+ Per side under Safe Mode: `input` accept `protocol=udp dst-port={{port}}` (or 8472)
99
+ from each peer VTEP IP. Bridged traffic is `forward` (allow if `use-ip-firewall`).
100
+ VXLAN has **no built-in encryption** — if the underlay is untrusted, run VXLAN over
101
+ an IPsec transport policy (protect UDP/{{port}} between the VTEPs) or inside another
102
+ encrypted tunnel; call this out.
103
+
104
+ ## 8. Verify
105
+
106
+ - `get_vxlan_tunnel` each device: interface up, VNI/port correct, VTEP peers present.
107
+ - L2 proof: a host at one site ARP-resolves and `ping`s a host at another **in the
108
+ same subnet**, no router hop; DHCP from the designated server reaches all sites.
109
+ - Large-frame test to confirm MTU (step 6).
110
+
111
+ ## Bypassing country / DPI restrictions (legitimate circumvention)
112
+
113
+ Lawful privacy/accessibility only. VXLAN is plain UDP on a fixed port, so:
114
+
115
+ 1. **Move `port` to a common UDP port** (e.g. 443) so it blends with QUIC-like
116
+ traffic; update every VTEP to match.
117
+ 2. **Encrypt the underlay** (IPsec transport for UDP/{{port}}), both to protect and
118
+ to ride ESP/4500 where raw UDP is inspected.
119
+ 3. If VXLAN itself is blocked, **carry the bridge over OpenVPN-TAP/443** (L2, HTTPS-
120
+ like — see `setup-openvpn-tunnel-between-sites`).
121
+ 4. Advanced obfuscation (XRay/Reality, sing-box, obfs4) via `/container` — not native.
122
+ Never present obfuscation as a guarantee.
123
+
124
+ ---
125
+
126
+ Report per device: VXLAN interface, VNI, port, local VTEP IP, peer VTEP list, bridge
127
+ joined, STP status, MTU/MSS, and verification results — noting any raw-command steps
128
+ used for VTEP peering. State which device each change ran on. Never apply changes the
129
+ user hasn't approved.