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

# 快速設定指南

下面是一個跟 Docker 網路相關的命令列表。

其中有些命令選項只有在 Docker 服務啟動的時候才能設定，而且不能馬上生效。

* `-b BRIDGE or --bridge=BRIDGE` --指定容器掛載的橋接器
* `--bip=CIDR` --定制 docker0 的遮罩
* `-H SOCKET... or --host=SOCKET...` --Docker 服務端接收命令的通道
* `--icc=true|false` --是否支援容器之間進行通訊
* `--ip-forward=true|false` --請看下文容器之間的通訊
* `--iptables=true|false` --禁止 Docker 新增 iptables 規則
* `--mtu=BYTES` --容器網路中的 MTU

下面2個命令選項既可以在啟動服務時指定，也可以 Docker 容器啟動（`docker run`）時候指定。在 Docker 服務啟動的時候指定則會成為預設值，後面執行 `docker run` 時可以覆蓋設定的預設值。

* `--dns=IP_ADDRESS...` --使用指定的DNS伺服器
* `--dns-search=DOMAIN...` --指定DNS搜尋域

最後這些選項只有在 `docker run` 執行時使用，因為它是針對容器的特性內容。

* `-h HOSTNAME or --hostname=HOSTNAME` --設定容器主機名
* `--link=CONTAINER_NAME:ALIAS` --新增到另一個容器的連線
* `--net=bridge|none|container:NAME_or_ID|host` --設定容器的橋接模式
* `-p SPEC or --publish=SPEC` --映射容器連接埠到宿主主機
* `-P or --publish-all=true|false` --映射容器所有連接埠到宿主主機


---

# 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://philipzheng.gitbook.io/docker_practice/advanced_network/quick_guide.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.
