> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man4/lo.4.md).

# lo.4

`lo` — 软件环回网络接口

## 名称

`lo`

## 概要

`device loop`

## 描述

`loop` 接口是一种软件环回机制，可用于性能分析、软件测试和/或本地通信。与其他网络接口一样，环回接口必须为每个要使用的地址族分配网络地址。这些地址可通过相应地址族的适当 ioctl(2) 命令设置。环回接口应最后配置，因为协议可能将配置顺序作为优先级的指示。除非不存在硬件接口，否则环回接口*绝不*应首先配置。

如果在环回接口上启用了发送校验和卸载功能，IP、UDP、TCP 或 SCTP 不会为在该接口上发送的数据包生成校验和。默认情况下，此功能处于启用状态，以避免在数据损坏可能性较低的本地通信中产生校验和开销。

如果在环回接口上禁用了接收校验和卸载功能，则先前设置的指示有效校验和的标志将被清除。默认情况下，此功能处于启用状态，以避免在已验证后再次进行校验和验证。

## 诊断

* lo%d: can't handle af%d。接口收到一个地址格式不适用于当前地址族的消息；该数据包被丢弃。

## 参见

[inet(4)](/man/man4/inet.4.md), [intro(4)](/man/man4/intro.4.md)

## 历史

`loop` 设备出现于 4.2BSD。当前的校验和生成与验证回避策略出现于 FreeBSD 8.0。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man4/lo.4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
