Why hide routers from traceroute?
If you run a WISP’s or an ISP’s network, a traceroute from a client’s PC draws your backbone: address after address, every router between them and the internet. It’s not a vulnerability in itself, but it’s a map handed out for free: whoever wants to try a brute force or a DoS already knows which ports to knock on.
How does the TTL trick work?
Every IP packet has a counter, the TTL. Every router that forwards it lowers it by one; when it reaches zero, the router drops the packet and replies to the sender with a “time exceeded”. Traceroute exploits exactly this: it sends packets with TTL 1, 2, 3… and notes who replies at each round.
The trick: if the router raises the TTL by one as soon as the packet comes in, the forwarding decrement brings it back to the starting value. The TTL never reaches zero on that router, which therefore never replies: as far as traceroute is concerned, it doesn’t exist.

Step 1: what does the network look like from the client?
Before hiding anything, look at what you see today. From a client’s PC:
tracert 8.8.8.8 (Windows)
traceroute 8.8.8.8 (Linux and macOS)
In the lab I ran the same test with ping -t 1, ping -t 2 and so on from a Linux PC: it’s a traceroute done by hand, one hop at a time. Before the change:
From 192.168.88.1 icmp_seq=1 Time to live exceeded
From 192.168.250.1 icmp_seq=1 Time to live exceeded
From 10.0.0.1 icmp_seq=1 Time to live exceeded
From 10.255.255.216 icmp_seq=1 Time to live exceeded
The first hop, 192.168.88.1, is the MikroTik router we want to make disappear.
Step 2: which are the client interfaces?
The rule must be applied only to the traffic coming from clients, not to everything (in step 6 we see why). Let’s gather the client interfaces in a list:
/interface list add name=CLIENTI
/interface list member add list=CLIENTI interface=vlan100-clienti
Replace vlan100-clienti with your ports, VLANs or bridges toward the clients. If the clients come in over PPPoE, their interfaces are born and die at every connection: instead of adding them by hand, have every session join the list from the PPP profile they use:
/ppp profile set [find name=default] interface-list=CLIENTI
Use the name of your clients’ profile if it isn’t default.
Step 3: how do I add the rule?
A single mangle rule, in prerouting, limited to the client list:
/ip firewall mangle add chain=prerouting in-interface-list=CLIENTI \
action=change-ttl new-ttl=increment:1 passthrough=yes \
comment="Hides this router from client traceroute"
It must be repeated on every router you want to hide: each one compensates only its own decrement. The other mangle actions, change-ttl included, are in the MikroTik manual: Mangle.
Step 4: how do I check it works?
Run the traceroute from the client again. In the lab, same test as step 1, after the rule:
From 192.168.250.1 icmp_seq=1 Time to live exceeded
From 10.0.0.1 icmp_seq=1 Time to live exceeded
From 10.255.255.216 icmp_seq=1 Time to live exceeded
From 172.29.0.9 icmp_seq=1 Time to live exceeded
192.168.88.1 is gone: the first to reply now is the next router. Everything else works as before.
I also tried it with fasttrack active, as in the factory configuration: the router stays hidden. From the router you can check the rule is working by looking at the counters:
/ip firewall mangle print stats where comment~"traceroute"
Step 5: and for IPv6?
Same principle, but in IPv6 the counter is called hop limit:
/ipv6 firewall mangle add chain=prerouting in-interface-list=CLIENTI \
action=change-hop-limit new-hop-limit=increment:1 passthrough=yes \
comment="Hides this router from client IPv6 traceroute"
Step 6: why not on every interface?
For two reasons.
- Troubleshooting: you too will use traceroute to find a fault. If the rule applies everywhere, your routers disappear for you as well. Limiting it to clients, from the NOC you still see them.
- Routing loops: the TTL exists precisely to kill off packets going around in circles. If two routers in a loop raise each other’s TTL, a packet never expires and burns bandwidth until the loop is resolved. With the rule only inbound from clients, the packet is incremented just once, at the edge, and the TTL goes back to doing its job in the backbone.
⚠️ Warning: hiding the routers doesn’t protect them. Whoever already knows their addresses reaches them anyway: the real protection is the input firewall, which you’ll find in the Basic hardening of a MikroTik router. Do it before putting the router into production, then add this rule.
Tested in the lab on PNETLab with a CHR running RouterOS 7.24.5 (stable) and a Linux client: TTL of the hops before and after the rule, with and without fasttrack, IPv6 rule, and interface list from the PPP profile.
Frequently asked questions
How do you hide a MikroTik router from traceroute?
With a mangle firewall rule in prerouting with action=change-ttl new-ttl=increment:1: the incremented TTL compensates the forwarding decrement and the router doesn’t show up among the traceroute hops.
Does the rule slow the router down?
Not appreciably: it’s a change to one field of the IP header. On routers with a lot of traffic it’s still better to limit it to the client interfaces, which is also the safer choice.
Can I still run traceroute myself from my network?
Yes, if the rule is limited with in-interface-list to the client interfaces: traffic starting from the NOC or the backbone isn’t modified and the routers stay visible.
How do I put PPPoE clients in the interface list?
From the PPP profile: with interface-list=CLIENTI in the profile used by the clients, every PPPoE session joins the list on its own when it connects.
Is it a real security measure?
It’s a confidentiality measure: it hides the network topology from curious clients. It doesn’t replace the input firewall on the routers, which remains the real protection against access and attacks.
This howto brings up to RouterOS 7 a 2015 article from my old blog wirelessguru.it, now offline.



