← 返回命令列表

Linux command

arptables 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

List

sudo arptables -L

Drop

sudo arptables -A INPUT -s 192.168.0.1 -j DROP

Delete

sudo arptables -D INPUT rule_number

Flush

sudo arptables -F

Example

sudo arptables -P OUTPUT ACCEPT

Save

sudo arptables-save > path/to/file

说明

arptables manages ARP (Address Resolution Protocol) packet filtering rules. It is similar to iptables but operates at the ARP level, allowing control over which ARP requests and replies are accepted or dropped.

参数

-L, --list
List all rules in selected chain or all chains
-A, --append
Append rule to the end of chain
-D, --delete
Delete matching rule or rule by number
-F, --flush
Flush all rules
-P, --policy
Set default policy for a chain
-s, --source-ip _address_
Match source IP address
-d, --destination-ip _address_
Match destination IP address
-j, --jump _target_
Target for rule (ACCEPT, DROP, etc.)

FAQ

What is the arptables command used for?

arptables manages ARP (Address Resolution Protocol) packet filtering rules. It is similar to iptables but operates at the ARP level, allowing control over which ARP requests and replies are accepted or dropped.

How do I run a basic arptables example?

Run `sudo arptables -L` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -L, --list do in arptables?

List all rules in selected chain or all chains