{"id":3764,"date":"2022-12-20T17:20:00","date_gmt":"2022-12-20T20:20:00","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/arptables-man8\/"},"modified":"2022-12-20T17:20:00","modified_gmt":"2022-12-20T20:20:00","slug":"arptables-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/arptables-man8\/","title":{"rendered":"ARPTABLES (man8)"},"content":{"rendered":"<h1 align=\"center\">ARPTABLES<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#ARPTABLES COMMAND LINE ARGUMENTS\">ARPTABLES COMMAND LINE ARGUMENTS<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#MAILINGLISTS\">MAILINGLISTS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">arptables \u2212 ARP table administration (nft-based)<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>arptables<\/b> [<b>-t table<\/b>] <b>&#8211;<\/b>[<b>AD<\/b>] <b>chain rule-specification<\/b> [<b>options<\/b>] <b><br \/> arptables<\/b> [<b>-t table<\/b>] <b>&#8211;<\/b>[<b>RI<\/b>] <b>chain rulenum rule-specification<\/b> [<b>options<\/b>] <b><br \/> arptables<\/b> [<b>-t table<\/b>] <b>-D chain rulenum<\/b> [<b>options<\/b>] <b><br \/> arptables<\/b> [<b>-t table<\/b>] <b>&#8211;<\/b>[<b>LFZ<\/b>] [<b>chain<\/b>] [<b>options<\/b>] <b><br \/> arptables<\/b> [<b>-t table<\/b>] <b>&#8211;<\/b>[<b>NX<\/b>] <b>chain <br \/> arptables<\/b> [<b>-t table<\/b>] <b>-E old-chain-name new-chain-name <br \/> arptables<\/b> [<b>-t table<\/b>] <b>-P chain target<\/b> [<b>options<\/b>]<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>arptables<\/b> is a user space tool, it is used to set up and maintain the tables of ARP rules in the Linux kernel. These rules inspect the ARP frames which they see. <b>arptables<\/b> is analogous to the <b>iptables<\/b> user space tool, but <b>arptables<\/b> is less complicated.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>CHAINS<\/b> <br \/> The kernel table is used to divide functionality into different sets of rules. Each set of rules is called a chain. Each chain is an ordered list of rules that can match ARP frames. If a rule matches an ARP frame, then a processing specification tells what to do with that matching frame. The processing specification is called a \u2019target\u2019. However, if the frame does not match the current rule in the chain, then the next rule in the chain is examined and so forth. The user can create new (user-defined) chains which can be used as the \u2019target\u2019 of a rule.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>TARGETS<\/b> <br \/> A firewall rule specifies criteria for an ARP frame and a frame processing specification called a target. When a frame matches a rule, then the next action performed by the kernel is specified by the target. The target can be one of these values: <i>ACCEPT<\/i>, <i>DROP<\/i>, <i>CONTINUE<\/i>, <i>RETURN<\/i>, an \u2019extension\u2019 (see below) or a user-defined chain.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>ACCEPT<\/i> means to let the frame through. <i>DROP<\/i> means the frame has to be dropped. <i>CONTINUE<\/i> means the next rule has to be checked. This can be handy to know how many frames pass a certain point in the chain or to log those frames. <i>RETURN<\/i> means stop traversing this chain and resume at the next rule in the previous (calling) chain. For the extension targets please see the <b>TARGET EXTENSIONS<\/b> section of this man page.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>TABLES<\/b> <br \/> There is only one ARP table in the Linux kernel. The table is <b>filter.<\/b> You can drop the \u2019-t filter\u2019 argument to the arptables command. The -t argument must be the first argument on the arptables command line, if used. <b><br \/> -t, &#8211;table<\/b><\/p>\n<p style=\"margin-left:22%;\"><b>filter<\/b>, is the only table and contains two built-in chains: <b>INPUT<\/b> (for frames destined for the host) and <b>OUTPUT<\/b> (for locally-generated frames).<\/p>\n<h2>ARPTABLES COMMAND LINE ARGUMENTS <a name=\"ARPTABLES COMMAND LINE ARGUMENTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">After the initial arptables command line argument, the remaining arguments can be divided into several different groups. These groups are commands, miscellaneous commands, rule-specifications, match-extensions, and watcher-extensions.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>COMMANDS<\/b> <br \/> The arptables command arguments specify the actions to perform on the table defined with the -t argument. If you do not use the -t argument to name a table, the commands apply to the default filter table. With the exception of the <b>-Z<\/b> command, only one command may be used on the command line at a time. <b><br \/> -A, &#8211;append<\/b><\/p>\n<p style=\"margin-left:22%;\">Append a rule to the end of the selected chain.<\/p>\n<p style=\"margin-left:11%;\"><b>-D, &#8211;delete<\/b><\/p>\n<p style=\"margin-left:22%;\">Delete the specified rule from the selected chain. There are two ways to use this command. The first is by specifying an interval of rule numbers to delete, syntax: start_nr[:end_nr]. Using negative numbers is allowed, for more details about using negative numbers, see the -I command. The second usage is by specifying the complete rule as it would have been specified when it was added.<\/p>\n<p style=\"margin-left:11%;\"><b>-I, &#8211;insert<\/b><\/p>\n<p style=\"margin-left:22%;\">Insert the specified rule into the selected chain at the specified rule number. If the current number of rules equals N, then the specified number can be between -N and N+1. For a positive number i, it holds that i and i-N-1 specify the same place in the chain where the rule should be inserted. The number 0 specifies the place past the last rule in the chain and using this number is therefore equivalent with using the -A command.<\/p>\n<p style=\"margin-left:11%;\"><b>-R, &#8211;replace<\/b><\/p>\n<p style=\"margin-left:22%;\">Replaces the specified rule into the selected chain at the specified rule number. If the current number of rules equals N, then the specified number can be between 1 and N. i specifies the place in the chain where the rule should be replaced.<\/p>\n<p style=\"margin-left:11%;\"><b>-P, &#8211;policy<\/b><\/p>\n<p style=\"margin-left:22%;\">Set the policy for the chain to the given target. The policy can be <b>ACCEPT<\/b>, <b>DROP<\/b> or <b>RETURN<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>-F, &#8211;flush<\/b><\/p>\n<p style=\"margin-left:22%;\">Flush the selected chain. If no chain is selected, then every chain will be flushed. Flushing the chain does not change the policy of the chain, however.<\/p>\n<p style=\"margin-left:11%;\"><b>-Z, &#8211;zero<\/b><\/p>\n<p style=\"margin-left:22%;\">Set the counters of the selected chain to zero. If no chain is selected, all the counters are set to zero. The <b>-Z<\/b> command can be used in conjunction with the <b>-L<\/b> command. When both the <b>-Z<\/b> and <b>-L<\/b> commands are used together in this way, the rule counters are printed on the screen before they are set to zero.<\/p>\n<p style=\"margin-left:11%;\"><b>-L, &#8211;list<\/b><\/p>\n<p style=\"margin-left:22%;\">List all rules in the selected chain. If no chain is selected, all chains are listed.<\/p>\n<p style=\"margin-left:11%;\"><b>-N, &#8211;new-chain<\/b><\/p>\n<p style=\"margin-left:22%;\">Create a new user-defined chain with the given name. The number of user-defined chains is unlimited. A user-defined chain name has maximum length of 31 characters.<\/p>\n<p style=\"margin-left:11%;\"><b>-X, &#8211;delete-chain<\/b><\/p>\n<p style=\"margin-left:22%;\">Delete the specified user-defined chain. There must be no remaining references to the specified chain, otherwise <b>arptables<\/b> will refuse to delete it. If no chain is specified, all user-defined chains that aren\u2019t referenced will be removed.<\/p>\n<p style=\"margin-left:11%;\"><b>-E, &#8211;rename-chain<\/b><\/p>\n<p style=\"margin-left:22%;\">Rename the specified chain to a new name. Besides renaming a user-defined chain, you may rename a standard chain name to a name that suits your taste. For example, if you like PREBRIDGING more than PREROUTING, then you can use the -E command to rename the PREROUTING chain. If you do rename one of the standard <b>arptables<\/b> chain names, please be sure to mention this fact should you post a question on the <b>arptables<\/b> mailing lists. It would be wise to use the standard name in your post. Renaming a standard <b>arptables<\/b> chain in this fashion has no effect on the structure or function of the <b>arptables<\/b> kernel table.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>MISCELLANOUS COMMANDS <br \/> -V, &#8211;version<\/b><\/p>\n<p style=\"margin-left:22%;\">Show the version of the arptables userspace program.<\/p>\n<p style=\"margin-left:11%;\"><b>-h, &#8211;help<\/b><\/p>\n<p style=\"margin-left:22%;\">Give a brief description of the command syntax.<\/p>\n<p style=\"margin-left:11%;\"><b>-j, &#8211;jump<\/b> <i>target<\/i><\/p>\n<p style=\"margin-left:22%;\">The target of the rule. This is one of the following values: <b>ACCEPT<\/b>, <b>DROP<\/b>, <b>CONTINUE<\/b>, <b>RETURN<\/b>, a target extension (see <b>TARGET EXTENSIONS<\/b>) or a user-defined chain name.<\/p>\n<p style=\"margin-left:11%;\"><b>-c, &#8211;set-counters<\/b> <i>PKTS BYTES<\/i><\/p>\n<p style=\"margin-left:22%;\">This enables the administrator to initialize the packet and byte counters of a rule (during <b>INSERT, APPEND, REPLACE<\/b> operations).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>RULE-SPECIFICATIONS<\/b> <br \/> The following command line arguments make up a rule specification (as used in the add and delete commands). A &#8220;!&#8221; option before the specification inverts the test for that specification. Apart from these standard rule specifications there are some other command line arguments of interest. <b><br \/> -s, &#8211;source-ip<\/b> [!] <i>address<\/i>[\/<i>mask]<\/i><\/p>\n<p style=\"margin-left:22%;\">The Source IP specification.<\/p>\n<p style=\"margin-left:11%;\"><b>-d, &#8211;destination-ip<\/b> [!] <i>address<\/i>[\/<i>mask]<\/i><\/p>\n<p style=\"margin-left:22%;\">The Destination IP specification.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;source-mac<\/b> [!] <i>address<\/i>[\/<i>mask<\/i>]<\/p>\n<p style=\"margin-left:22%;\">The source mac address. Both mask and address are written as 6 hexadecimal numbers separated by colons.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;destination-mac<\/b> [!] <i>address<\/i>[\/<i>mask<\/i>]<\/p>\n<p style=\"margin-left:22%;\">The destination mac address. Both mask and address are written as 6 hexadecimal numbers separated by colons.<\/p>\n<p style=\"margin-left:11%;\"><b>-i, &#8211;in-interface<\/b> [!] <i>name<\/i><\/p>\n<p style=\"margin-left:22%;\">The interface via which a frame is received (for the <b>INPUT<\/b> chain). The flag <b>&#8211;in-if<\/b> is an alias for this option.<\/p>\n<p style=\"margin-left:11%;\"><b>-o, &#8211;out-interface<\/b> [!] <i>name<\/i><\/p>\n<p style=\"margin-left:22%;\">The interface via which a frame is going to be sent (for the <b>OUTPUT<\/b> chain). The flag <b>&#8211;out-if<\/b> is an alias for this option.<\/p>\n<p style=\"margin-left:11%;\"><b>-l, &#8211;h-length<\/b> <i>length<\/i>[\/<i>mask<\/i>]<\/p>\n<p style=\"margin-left:22%;\">The hardware length (nr of bytes)<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;opcode<\/b> <i>code<\/i>[\/<i>mask<\/i>]<\/p>\n<p style=\"margin-left:22%;\">The operation code (2 bytes). Available values are: <b>1<\/b>=<b>Request 2<\/b>=<b>Reply 3<\/b>=<b>Request_Reverse 4<\/b>=<b>Reply_Reverse 5<\/b>=<b>DRARP_Request 6<\/b>=<b>DRARP_Reply 7<\/b>=<b>DRARP_Error 8<\/b>=<b>InARP_Request 9<\/b>=<b>ARP_NAK<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;h-type<\/b> <i>type<\/i>[\/<i>mask<\/i>]<\/p>\n<p style=\"margin-left:22%;\">The hardware type (2 bytes, hexadecimal). Available values are: <b>1<\/b>=<b>Ethernet<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;proto-type<\/b> <i>type<\/i>[\/<i>mask<\/i>]<\/p>\n<p style=\"margin-left:22%;\">The protocol type (2 bytes). Available values are: <b>0x800<\/b>=<b>IPv4<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>TARGET-EXTENSIONS <br \/> arptables<\/b> extensions are precompiled into the userspace tool. So there is no need to explicitly load them with a -m option like in <b>iptables<\/b>. However, these extensions deal with functionality supported by supplemental kernel modules.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>mangle <br \/> &#8211;mangle-ip-s IP address<\/b><\/p>\n<p style=\"margin-left:22%;\">Mangles Source IP Address to given value.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;mangle-ip-d IP address<\/b><\/p>\n<p style=\"margin-left:22%;\">Mangles Destination IP Address to given value.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;mangle-mac-s MAC address<\/b><\/p>\n<p style=\"margin-left:22%;\">Mangles Source MAC Address to given value.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;mangle-mac-d MAC address<\/b><\/p>\n<p style=\"margin-left:22%;\">Mangles Destination MAC Address to given value.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;mangle-target target<\/b><\/p>\n<p style=\"margin-left:22%;\">Target of ARP mangle operation (<b>DROP<\/b>, <b>CONTINUE<\/b> or <b>ACCEPT<\/b> &#8212; default is <b>ACCEPT<\/b>).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>CLASSIFY<\/b> <br \/> This module allows you to set the skb->priority value (and thus clas- sify the packet into a specific CBQ class). <b><br \/> &#8211;set-class major:minor<\/b><\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">Set the major and minor class value. The values are always interpreted as hexadecimal even if no 0x prefix is given.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>MARK<\/b> <br \/> This module allows you to set the skb->mark value (and thus classify the packet by the mark in u32) <b><br \/> &#8211;set-mark mark<\/b><\/p>\n<p style=\"margin-left:22%;\">Set the mark value. The values are always interpreted as hexadecimal even if no 0x prefix is given<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;and-mark mark<\/b><\/p>\n<p style=\"margin-left:22%;\">Binary AND the mark with bits.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;or-mark mark<\/b><\/p>\n<p style=\"margin-left:22%;\">Binary OR the mark with bits.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">In this nft-based version of <b>arptables<\/b>, support for <b>FORWARD<\/b> chain has not been implemented. Since ARP packets are &#8220;forwarded&#8221; only by Linux bridges, the same may be achieved using <b>FORWARD<\/b> chain in <b>ebtables<\/b>.<\/p>\n<h2>MAILINGLISTS <a name=\"MAILINGLISTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">See <b>http:\/\/netfilter.org\/mailinglists.html<\/b><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xtables-nft<\/b>(8), <b>iptables<\/b>(8), <b>ebtables<\/b>(8), <b>ip<\/b>(8)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See <b>https:\/\/wiki.nftables.org<\/b><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  arptables \u2212 ARP table administration (nft-based) <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,867,4],"class_list":["post-3764","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-arptables-nft","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3764"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3764\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}