> For the complete documentation index, see [llms.txt](https://mcreadme.gitbook.io/mc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mcreadme.gitbook.io/mc/base/control.md).

# 访问控制

{% hint style="info" %}

* 本功能通过iptables实现设备黑白名单，优先级高于内核访问控制规则
  {% endhint %}

<figure><img src="/files/9BBCorhx7j3ZooQh8pUW" alt=""><figcaption></figcaption></figure>

#### 访问控制匹配方法：

* <mark style="color:orange;">**IP+MAC匹配**</mark>**：**&#x5339;配到设备IP或者MAC既遵循访问控制设置
* <mark style="color:orange;">**仅IP匹配**</mark>**：**&#x5339;配到设备IPv4地址既遵循访问控制设置
* <mark style="color:orange;">**仅MAC匹配**</mark>**：**&#x5339;配到设备MAC地址既遵循访问控制设置

{% hint style="info" %}

* **不通过代理：**&#x8BBE;定的设备流量不经过MC，直接访问互联网
* **通过Clash：**&#x8BBE;定的设备流量经过MC访问互联网，经过Clash的YAML配置设定分流
* **支持自定义端口号**（只支持<mark style="color:blue;">通过Clash</mark>）**：**&#x5148;点<mark style="color:blue;">加号</mark>添加，然后点击 <mark style="color:blue;">all</mark>/<mark style="color:blue;">端口号</mark> 修改
* **多端口格式：**&#x38;0,443  代表80和443端口          666:777   代表666到777端口
* **IP地址支持CIDR格式：**&#x5982;：192.168.50.0/24
  {% endhint %}

{% hint style="warning" %}

* IP地址匹配仅支持IPv4，无法控制设备的IPv6流量
* 使用MAC地址匹配时，请关闭iPhone等设备的随机MAC地址功能
* 设置完成后，需要重启MC应用设置
  {% endhint %}
