ARPTABLES(8)
β¨ ARPTABLES(8) β¨
okay bestie, so this is the manual page for arptables β ARP table administration (legacy) π
it's giving system manager's manual energy, and we're about to read the whole thing together, no skimming, no skipping π«Ά
πΈ SYNOPSIS πΈ
arptables [-t table] -[AD] chain rule-specification [options]
arptables [-t table] -[RI] chain rulenum rule-specification [options]
arptables [-t table] -D chain rulenum [options]
arptables [-t table] -[LFZ] [chain] [options]
arptables [-t table] -[NX] chain
arptables [-t table] -E old-chain-name new-chain-name
arptables [-t table] -P chain target [options]
π°οΈ LEGACY π°οΈ
so listen. this tool uses the old xtables/setsockopt framework, and it is literally a legacy version of arptables. what that means is: there's a new, more modern tool that does the exact same thing but with the nf_tables framework, and you are encouraged to migrate now. like, now now. π«Ά
the new binaries (which used to be called -compat) use the same syntax and semantics as this legacy one, so migrating is not the glow-up struggle you think it is.
you can still use this legacy tool. you should probably get some specific info from your Linux distribution or vendor. more docs live at https://wiki.nftables.org β¨
π DESCRIPTION π
arptables is a user space tool, and its whole job is to set up and maintain the tables of ARP rules in the Linux kernel. these rules inspect the ARP frames which they see. arptables is analogous to the iptables user space tool, but arptables is less complicated. periodt. π
π CHAINS π
the kernel table is what divides 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. that processing specification is called a 'target'. but if the frame does not match the current rule in the chain, then the next rule in the chain gets examined, and so on and so forth. the user can create new (user-defined) chains, which can be used as the 'target' of a rule. π¦
π― TARGETS π―
a firewall rule specifies criteria for an ARP frame plus a frame processing specification called a target. when a frame matches a rule, the next action performed by the kernel is specified by the target. the target can be one of these values: ACCEPT, DROP, CONTINUE, RETURN, an 'extension' (see below), or a user-defined chain.
ACCEPTmeans to let the frame through. πDROPmeans the frame has to be dropped. πCONTINUEmeans 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.RETURNmeans stop traversing this chain and resume at the next rule in the previous (calling) chain.
for the extension targets, please see the TARGET EXTENSIONS section of this man page π
ποΈ TABLES ποΈ
there is only one ARP table in the Linux kernel. the table is filter. you can drop the -t filter argument to the arptables command. the -t argument must be the first argument on the arptables command line, if used.
-t,--tableβfilteris the only table and it contains two (Linux kernels 2.4.X) or three (Linux kernels 2.6.0 and later) built-in chains:INPUT(for frames destined for the host),OUTPUT(for locally-generated frames) andFORWARD(for frames being forwarded by the bridge code). theFORWARDchain doesn't exist in Linux 2.4.X kernels. π
π ARPTABLES COMMAND LINE ARGUMENTS π
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.
π COMMANDS π
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 -Z command, only one command may be used on the command line at a time.
-A,--appendβ append a rule to the end of the selected chain.-D,--deleteβ 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-Icommand. the second usage is by specifying the complete rule as it would have been specified when it was added.-I,--insertβ insert the specified rule into the selected chain at the specified rule number. if the current number of rules equalsN, then the specified number can be between-NandN+1. for a positive numberi, it holds thatiandi-N-1specify the same place in the chain where the rule should be inserted. the number0specifies the place past the last rule in the chain, and using this number is therefore equivalent with using the-Acommand.-R,--replaceβ replaces the specified rule into the selected chain at the specified rule number. if the current number of rules equalsN, then the specified number can be between1andN.ispecifies the place in the chain where the rule should be replaced.-P,--policyβ set the policy for the chain to the given target. the policy can beACCEPT,DROPorRETURN.-F,--flushβ 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. π§Ή-Z,--zeroβ set the counters of the selected chain to zero. if no chain is selected, all the counters are set to zero. the-Zcommand can be used in conjunction with the-Lcommand. when both the-Zand-Lcommands are used together in this way, the rule counters are printed on the screen before they are set to zero.-L,--listβ list all rules in the selected chain. if no chain is selected, all chains are listed. π-N,--new-chainβ create a new user-defined chain with the given name. the number of user-defined chains is unlimited. a user-defined chain name has a maximum length of 31 characters.-X,--delete-chainβ delete the specified user-defined chain. there must be no remaining references to the specified chain, otherwisearptableswill refuse to delete it. if no chain is specified, all user-defined chains that aren't referenced will be removed.-E,--rename-chainβ 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 likePREBRIDGINGmore thanPREROUTING, then you can use the-Ecommand to rename thePREROUTINGchain. if you do rename one of the standardarptableschain names, please be sure to mention this fact should you post a question on thearptablesmailing lists. it would be wise to use the standard name in your post. renaming a standardarptableschain in this fashion has no effect on the structure or function of thearptableskernel table.
π MISCELLANOUS COMMANDS π
-V,--versionβ show the version of thearptablesuserspace program.-h,--helpβ give a brief description of the command syntax.-j,--jump targetβ the target of the rule. this is one of the following values:ACCEPT,DROP,CONTINUE,RETURN, a target extension (see TARGET EXTENSIONS) or a user-defined chain name.-c,--set-counters PKTS BYTESβ this enables the administrator to initialize the packet and byte counters of a rule (duringINSERT,APPEND,REPLACEoperations).
π RULE-SPECIFICATIONS π
the following command line arguments make up a rule specification (as used in the add and delete commands). a "!" 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.
-s,--source-ip [!] address[/mask]β the Source IP specification.-d,--destination-ip [!] address[/mask]β the Destination IP specification.--source-mac [!] address[/mask]β the source mac address. both mask and address are written as 6 hexadecimal numbers separated by colons.--destination-mac [!] address[/mask]β the destination mac address. both mask and address are written as 6 hexadecimal numbers separated by colons.-i,--in-interface [!] nameβ the interface via which a frame is received (for theINPUTandFORWARDchains). the flag--in-ifis an alias for this option.-o,--out-interface [!] nameβ the interface via which a frame is going to be sent (for theOUTPUTandFORWARDchains). the flag--out-ifis an alias for this option.-l,--h-length length[/mask]β the hardware length (nr of bytes)--opcode code[/mask]β the operation code (2 bytes). available values are:1=Request2=Reply3=Request_Reverse4=Reply_Reverse5=DRARP_Request6=DRARP_Reply7=DRARP_Error8=InARP_Request9=ARP_NAK.--h-type type[/mask]β the hardware type (2 bytes, hexadecimal). available values are:1=Ethernet.--proto-type type[/mask]β the protocol type (2 bytes). available values are:0x800=IPv4.
π₯ TARGET-EXTENSIONS π₯
arptables extensions are precompiled into the userspace tool. so there is no need to explicitly load them with a -m option like in iptables. however, these extensions deal with functionality supported by supplemental kernel modules. iykyk π
π§ mangle π§
--mangle-ip-s IP addressβ mangles Source IP Address to given value.--mangle-ip-d IP addressβ mangles Destination IP Address to given value.--mangle-mac-s MAC addressβ mangles Source MAC Address to given value.--mangle-mac-d MAC addressβ mangles Destination MAC Address to given value.--mangle-target targetβ target of ARP mangle operation (DROP,CONTINUEorACCEPT-- default isACCEPT).
π CLASSIFY π
this module allows you to set the skb->priority value (and thus classify the packet into a specific CBQ class).
--set-class major:minorβ set the major and minor class value. the values are always interpreted as hexadecimal even if no0xprefix is given.
β MARK β
this module allows you to set the skb->mark value (and thus classify the packet by the mark in u32)
--set-mark markβ set the mark value. the values are always interpreted as hexadecimal even if no0xprefix is given--and-mark markβ binary AND the mark with bits.--or-mark markβ binary OR the mark with bits.
π MAILINGLISTS
okay so if you wanna vibe with the nerds who actually build this stuff, bestie, the mailing lists live right here:
http://netfilter.org/mailinglists.html
that's it, that's the link. go be iconic in someone's inbox π«Ά
π SEE ALSO
like, go read these too, fr fr:
iptables(8)ebtables(8)arp(8)rarp(8)ifconfig(8)route(8)
and also, if you're feeling extra:
iykyk β one link leads to another and suddenly it's 3am and you're deep in netfilter docs. we've all been there. no regrets. π
and that's a wrap on ARPTABLES(8)! π
this page is from June 2018, so yeah, she's been around a minute β but she still ate. go forth, filter your ARP tables, and stay slaying. periodt. πβ¨π¦
π¦ where this page comes from
- debian bookworm: arptables 0.0.5-3.1 Β· GPL-2.0-only
- fedora 43: arptables-legacy 0.0.5-18.fc43 Β· GPL-2.0-or-later
- fedora 43: arptables-legacy 0.0.5-18.fc43.1 Β· GPL-2.0-or-later
- fedora 44: arptables-legacy 0.0.5-20.fc44 Β· GPL-2.0-or-later
- fedora 44: arptables-legacy 0.0.5-20.fc44.1 Β· GPL-2.0-or-later
- ubuntu jammy: arptables 0.0.5-3 Β· GPL-2.0-only
- ubuntu noble: arptables 0.0.5-3.1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms