.\" .\" (C) Copyright 2016-2017, Arturo Borrero Gonzalez .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .TH XTABLES-NFT 8 "" "iptables 1.8.11" "iptables 1.8.11" .SH "نام (NAME)" xtables-nft \- ابزارهای مبتنی بر چارچوب nftables در iptables .SH "توضیحات (DESCRIPTION)" ابزارهای \fBxtables-nft\fP نسخه‌هایی از iptables هستند که از API مربوط به nftables استفاده می‌کنند. این مجموعه ابزارها برای کمک به مدیر سیستم جهت مهاجرت مجموعه قوانین از \fBiptables(8)\fP، \fBip6tables(8)\fP، \fBarptables(8)\fP و \fBebtables(8)\fP به \fBnftables(8)\fP طراحی شده است. مجموعه \fBxtables-nft\fP از چند دستور تشکیل شده است: .IP \[bu] 2 iptables\-nft .IP \[bu] iptables\-nft\-save .IP \[bu] iptables\-nft\-restore .IP \[bu] ip6tables\-nft .IP \[bu] ip6tables\-nft\-save .IP \[bu] ip6tables\-nft\-restore .IP \[bu] arptables\-nft .IP \[bu] ebtables\-nft این ابزارها از افزونه‌های چارچوب libxtables استفاده کرده و با بهره‌گیری از ماژول \fBnft_compat\fP به زیرسیستم هسته nf_tables متصل می‌شوند. .SH "کاربرد (USAGE)" ابزارهای xtables-nft به شما امکان می‌دهند تا با استفاده از نحو بومی و اصلی \fBiptables(8)\fP، \fBip6tables(8)\fP، \fBarptables(8)\fP و \fBebtables(8)\fP، بک‌اند nf_tables را مدیریت کنید. شما باید از ابزارهای xtables-nft دقیقاً به همان شکلی استفاده کنید که از ابزارهای متناظر و اصلی آن‌ها استفاده می‌کردید. افزودن یک قاعده منجر به افزوده شدن آن قاعده به زیرسیستم هسته nf_tables می‌شود. فهرست کردن مجموعه قوانین نیز به همین ترتیب از بک‌اند nf_tables استفاده خواهد کرد. هنگام طراحی این ابزارها، ایده اصلی این بود که هر فایل اجرایی سنتی (legacy) با یک پیوند نمادین (symlink) به برنامه xtables-nft جایگزین شود؛ برای نمونه: .nf /sbin/iptables -> /usr/sbin/iptables\-nft\-multi /sbin/ip6tables -> /usr/sbin/ip6tables\-nft\-multi /sbin/arptables -> /usr/sbin/arptables\-nft\-multi /sbin/ebtables -> /usr/sbin/ebtables\-nft\-multi .fi رشته نسخه iptables نشان می‌دهد که آیا API سنتی (get/setsockopt) استفاده شده است یا API جدید nf_tables: .nf iptables \-V iptables v1.7 (nf_tables) .fi .SH "تفاوتها با نسخه سنتی (DIFFERENCES WITH LEGACY UTILITIES)" به دلیل اینکه ابزارهای xtables-nft از API هسته nf_tables استفاده می‌کنند، عملیات افزودن و حذف قوانین همواره اتمیک (یکپارچه و تجزیه‌ناپذیر) است. برخلاف iptables-legacy، در .B iptables\-nft \-A .. نیازی به دریافت مجموعه قوانین فعلی از هسته، تغییر آن، و بارگذاری مجدد مجموعه قوانین تغییریافته نخواهد بود. در عوض، .B iptables\-nft به هسته اعلام می‌کند تا یک قاعده را اضافه کند. به همین دلیل، گزینه .B \-\-wait مربوط به iptables-legacy در .B iptables\-nft هیچ اثری ندارد (no-op است). استفاده از ابزارهای xtables-nft امکان نظارت بر تغییرات مجموعه قوانین را با استفاده از دستور .B xtables\-monitor(8) فراهم می‌سازد. هنگام استفاده از .B \-j TRACE برای اشکال‌زدایی پیمایش بسته در مجموعه قوانین، توجه داشته باشید که برای به دست آوردن رویدادهای ردیابی نظارتی، باید از .B xtables\-monitor(8) در حالت .B \-\-trace استفاده کنید. .SH "مثال‌ها (EXAMPLES)" یک مثال پایه، ایجاد ساختار اولیه مجموعه قوانین در nf_tables از طریق ابزارهای xtables-nft بر روی یک سیستم تازه است: .nf root@machine:\(ti# iptables\-nft \-L [...] root@machine:\(ti# ip6tables\-nft \-L [...] root@machine:\(ti# arptables\-nft \-L [...] root@machine:\(ti# ebtables\-nft \-L [...] root@machine:\(ti# nft list ruleset table ip filter { chain INPUT { type filter hook input priority 0; policy accept; } chain FORWARD { type filter hook forward priority 0; policy accept; } chain OUTPUT { type filter hook output priority 0; policy accept; } } table ip6 filter { chain INPUT { type filter hook input priority 0; policy accept; } chain FORWARD { type filter hook forward priority 0; policy accept; } chain OUTPUT { type filter hook output priority 0; policy accept; } } table bridge filter { chain INPUT { type filter hook input priority \-200; policy accept; } chain FORWARD { type filter hook forward priority \-200; policy accept; } chain OUTPUT { type filter hook output priority \-200; policy accept; } } table arp filter { chain INPUT { type filter hook input priority 0; policy accept; } chain FORWARD { type filter hook forward priority 0; policy accept; } chain OUTPUT { type filter hook output priority 0; policy accept; } } .fi (لطفاً توجه داشته باشید که در سیستم‌های تازه، فهرست کردن مجموعه قوانین برای نخستین بار باعث ایجاد تمام جدول‌ها و زنجیره‌ها می‌شود). برای مهاجرت کامل مجموعه قوانین filter، در مورد .BR iptables(8) ، می‌توانید از دستورات زیر استفاده کنید: .nf root@machine:\(ti# iptables\-legacy\-save > myruleset # reads from x_tables root@machine:\(ti# iptables\-nft\-restore myruleset # writes to nf_tables .fi یا .nf root@machine:\(ti# iptables\-legacy\-save | iptables\-translate\-restore | less .fi تا ببینید قوانین در نحو \fBnft(8)\fP چگونه خواهند بود. .SH "محدودیت‌ها (LIMITATIONS)" شما باید از \fBLinux kernel >= 4.17\fP استفاده کنید. هدف CLUSTERIP پشتیبانی نمی‌شود. برای دریافت اطلاعات به‌روز در این رابطه، لطفاً به نشانی زیر مراجعه کنید: .br \fBhttps://wiki.nftables.org\fP .SH "همچنین ببینید (SEE ALSO)" \fBnft(8)\fP, \fBxtables\-translate(8)\fP, \fBxtables\-monitor(8)\fP .SH "نویسندگان (AUTHORS)" چارچوب nftables توسط پروژه Netfilter (https://www.netfilter.org) نوشته شده است. این صفحه راهنما توسط Arturo Borrero Gonzalez برای پروژه دبیان نوشته شده است، اما می‌تواند توسط دیگران نیز استفاده شود. این مستندات تحت شرایط مجوز GPLv2+ آزاد/رایگان است.