Community discussions

MikroTik App
 
User avatar
mpuria
just joined
Topic Author
Posts: 13
Joined: Sun Dec 06, 2020 12:56 am
Location: Philippines
Contact:

Changing TTL for incoming packets from client

Fri Jan 15, 2021 6:28 pm

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.
 
User avatar
mpuria
just joined
Topic Author
Posts: 13
Joined: Sun Dec 06, 2020 12:56 am
Location: Philippines
Contact:

Re: Changing TTL for incoming packets from client

Tue Jan 19, 2021 5:22 pm

bump.... hope someone could give an insight
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: Changing TTL for incoming packets from client

Tue Jan 19, 2021 5:57 pm

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.
 
User avatar
mpuria
just joined
Topic Author
Posts: 13
Joined: Sun Dec 06, 2020 12:56 am
Location: Philippines
Contact:

Re: Changing TTL for incoming packets from client

Wed Jan 20, 2021 3:45 am

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.
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: Changing TTL for incoming packets from client

Wed Jan 20, 2021 3:48 pm

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.