iptables "--ttl-inc"が機能しない

iptables

次のエラーが発生します。

$ iptables -t mangle -A PREROUTING -d 224.0.0.251 -j TTL --ttl-inc 1
iptables v1.8.7 (nf_tables): unknown option "--ttl-inc"
Try `iptables -h' or 'iptables --help' for more information.

しかし、定義をman iptables-extensions見るとき。--ttl-incWebで検索しようとしましたが、回答が見つかりませんでした。アドバイスしてください。

$ uname -a    
Linux base 6.2.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 23:39:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux


$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 23.04"
NAME="Ubuntu"
VERSION_ID="23.04"
VERSION="23.04 (Lunar Lobster)"

ベストアンサー1

root以外のユーザーとして再現可能iptablesバージョン 1.8.7:

$ /sbin/iptables -t mangle -A PREROUTING -d 224.0.0.251 -j TTL --ttl-inc 1
iptables v1.8.7 (nf_tables): unknown option "--ttl-inc"
Try `iptables -h' or 'iptables --help' for more information.

iptables拡張機能の使用中に問題が検出され、失敗したが正しく確認されていません。これは、そのケースへのアクセス権がないために発生したと誤解を招くメッセージが表示されました。/sbin/iptables -t mangle -A PREROUTING拡張機能を使用せずに簡単なインポートを使用してくださいiptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Permission denied (you must be root)

この特定の「バグ」は将来のバージョンで修正されました(これはUbuntuの将来のバージョンで利用可能です)。

$ /sbin/iptables -t mangle -A PREROUTING -d 224.0.0.251 -j TTL --ttl-inc 1
iptables v1.8.9 (nf_tables): Could not fetch rule set generation id: Permission denied (you must be root)

人々はそのような管理コマンドをrootユーザーとして実行する必要があることに注意してください。 Moroverはiptablesシステムコマンドパス(/sbin/usr/sbin...)にあるため、デフォルトでは見つかりません(OPはコマンド全体を/sbin/iptablesコピー/貼り付けていない/usr/sbin/iptablesか、PATH環境変数を変更しました)。質問のヒントは、$ 信頼できる価値がなくても、まだルートではないことを意味します。

ルート(使用または許可)として、sudoコマンドはもちろん期待どおりに機能しますsuunshare -Urn

おすすめ記事