Page 1 of 1

Changing TTL for incoming packets from client

Posted: Fri Jan 15, 2021 6:28 pm
by mpuria
Hi everyone!

This is our network setup:
Client Device -> Router -> Mikrotik RB750gr3 -> ISP(WAN)
/ip firewall mangle
add action=change-ttl chain=postrouting new-ttl=set:2 out-interface=all-ppp passthrough=yes
I have currently set up a mangle rule so that any incoming packets from ISP would change TTL to 2. This is to make sure that the packets that would be going to clients would be TTL=1 after their router.
But in this setup the problem is that if a client connects another router instead of a device, the routers that they have automatically increase(yes, increase instead of -1) if the is TTL=1 to TTL=128.
To solve this I am trying to implement instead that if the incoming packets to my Mikrotik from the client having TTL<=62, the packets would be dropped automatically.
This is the command I'm using but its not working.
/ip firewall filter
add action=drop chain=prerouting ttl=less-than:63
I tried also to mark the connections with TTL less than 63 and then block those in /ip firewall filter but to no effect.
I hope someone could help me on this.

Re: Changing TTL for incoming packets from client

Posted: Tue Jan 19, 2021 5:22 pm
by mpuria
bump.... hope someone could give an insight

Re: Changing TTL for incoming packets from client

Posted: Tue Jan 19, 2021 5:57 pm
by Sob
You're wasting your time, client can change TTL as easily as you can, so whatever you do, they will do the opposite and avoid your blocking.

Re: Changing TTL for incoming packets from client

Posted: Wed Jan 20, 2021 3:45 am
by mpuria
You're wasting your time, client can change TTL as easily as you can, so whatever you do, they will do the opposite and avoid your blocking.
That is correct, that is why I am looking into blocking the incoming packets from client side which TTL are less than or equal to 62. All my clients are Linux based(all expected TTLs=64) that's why I need to block all those TTL<=62.

Re: Changing TTL for incoming packets from client

Posted: Wed Jan 20, 2021 3:48 pm
by Sob
You can use you command, just change incorrect chain=prerouting to chain=forward and add in-interface=<where client is connected>. But you're wasting your time with incoming packets too, client can change TTL for both incoming and outgoing packets.