From: gaaimen1997 <gaaimen1997@protonmail.com>
To: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Translating iptables rules with TTL, HL and physdev to nftables
Date: Sat, 04 Mar 2023 07:46:10 +0000 [thread overview]
Message-ID: <hqPvtHzm3I0cxzrsj43wW11hd31Sxw36pN25SObh8dvW-0HotwJyND64l-aj9I4hR-yZyxxAnQabaueZNKo2haeejKFSI8AkB4Jgh0UG8i8=@protonmail.com> (raw)
Hi,
I am translating iptables and ip6tables rules to nftables rules to set up my portable router. However, the following commands did not translate correctly when I used iptables-translate (ip6tables-translate)
iptables -t mangle -A POSTROUTING -o eth0 -j TTL --ttl-inc 1
ip6tables -t mangle -A POSTROUTING -o eth0 -j HL --hl-inc 1
iptables -t mangle -I POSTROUTING -m physdev --physdev-out usb0 -j TTL --ttl-inc 1
ip6tables -t mangle -I POSTROUTING -m physdev --physdev-out usb0 -j HL --hl-inc 1
For the ttl and hl modules, I tried "ip ttl set 88" and "ip6 hoplimit set 99" on my own, and they worked fine. However, I am unable to increase or decrease ttl (or hoplimit) as --ttl-inc or --ttl-dec.
The first two rules and the last two rules operate under different conditions and they won't work simultaneously.
System: Debian 11, nftables v0.9.8 (E.D.S.)
Can you help me with the correct nftables rules?
Thank you in advance!
next reply other threads:[~2023-03-04 7:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-04 7:46 gaaimen1997 [this message]
2023-04-29 8:55 ` Translating iptables rules with TTL, HL and physdev to nftables Kerin Millar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='hqPvtHzm3I0cxzrsj43wW11hd31Sxw36pN25SObh8dvW-0HotwJyND64l-aj9I4hR-yZyxxAnQabaueZNKo2haeejKFSI8AkB4Jgh0UG8i8=@protonmail.com' \
--to=gaaimen1997@protonmail.com \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).