> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/andoid-shou-ji/pomoxve/jian-li-dnat.md).

# 建立DNAT

## 建立虛擬的Bridge網路，讓lxc系統使用此網段，預設不對外連線

![](/files/-Lxcx4wujdULM7M9YUoM)

![](/files/-Lxcy8N8o9TxBhI_fLEe)

讓此虛擬網路區段，可以使用SNAT連線網際網路

```
auto vmbr0
iface vmbr0 inet static
	address 10.99.0.254
	netmask 255.255.255.0
	bridge_ports none
	bridge_stp off
	bridge_fd 0
	post-up echo 1 > /proc/sys/net/ipv4/ip_forward
	post-up iptables -t nat -A POSTROUTING -s '10.99.0.0/24' -j MASQUERADE
	post-down iptables -t nat -D POSTROUTING -s '10.99.0.0/24' -j MASQUERADE
```

## 將此LXC的的docker samba服務對外曝露

iptables -t nat -A PREROUTING -p tcp -d 172.16.10.13 --dport 445 -j DNAT --to 10.99.0.1


---

# 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://kawsing.gitbook.io/opensystem/andoid-shou-ji/pomoxve/jian-li-dnat.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.
