Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions docs/bridge-networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ sudo sysctl -p /etc/sysctl.d/99-dstack-bridge.conf
sudo apt install -y dnsmasq
```

Install the DHCP notification script (notifies VMM when a VM gets an IP so port forwarding can be established):

```bash
sudo cp dstack/scripts/dhcp-notify.sh /usr/local/bin/dhcp-notify.sh
sudo chmod +x /usr/local/bin/dhcp-notify.sh
```

Create dnsmasq config:

```ini
Expand All @@ -106,11 +99,8 @@ bind-interfaces
dhcp-range=10.0.100.10,10.0.100.254,255.255.255.0,12h
dhcp-option=option:router,10.0.100.1
dhcp-option=option:dns-server,8.8.8.8,1.1.1.1
dhcp-script=/usr/local/bin/dhcp-notify.sh
```

The `dhcp-script` option tells dnsmasq to call the notification script on every lease event. The script sends the MAC and IP to VMM's `ReportDhcpLease` RPC, which triggers automatic port forwarding for the VM.

```bash
sudo systemctl restart dnsmasq
```
Expand Down Expand Up @@ -172,8 +162,7 @@ sudo chmod u+s /usr/lib/qemu/qemu-bridge-helper
- VMM passes `-netdev bridge,id=net0,br=<bridge>` to QEMU
- QEMU's bridge helper (setuid) creates a TAP device and attaches it to the bridge
- Guest MAC address is derived from SHA256 of the VM ID, with an optional configurable prefix (stable across restarts for DHCP IP consistency)
- The host DHCP server (dnsmasq) assigns an IP and calls `dhcp-notify.sh`, which notifies VMM via the `ReportDhcpLease` RPC
- VMM matches the MAC address to identify the VM and establishes port forwarding rules
- The host DHCP server (dnsmasq) assigns an IP to the VM
- When QEMU exits, the TAP device is automatically destroyed
- VMM does not need root or `CAP_NET_ADMIN`

Expand Down
14 changes: 0 additions & 14 deletions dstack/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions dstack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ members = [
"dstack-mr/cli",
"verifier",
"size-parser",
"port-forward",
"crates/dstack-cli-core",
"crates/dstack-cli",
"crates/dstackup",
Expand All @@ -78,7 +77,6 @@ dstack-kms-rpc = { path = "kms/rpc" }
dstack-guest-agent-rpc = { path = "guest-agent/rpc" }
dstack-vmm-rpc = { path = "vmm/rpc" }
dstack-cli-core = { path = "crates/dstack-cli-core" }
dstack-port-forward = { path = "port-forward" }
cc-eventlog = { path = "cc-eventlog" }
supervisor = { path = "supervisor" }
supervisor-client = { path = "supervisor/client" }
Expand Down
1 change: 0 additions & 1 deletion dstack/crates/dstack-cli-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ mode = "user"
net = "10.0.2.0/24"
dhcp_start = "10.0.2.10"
restrict = false
forward_service_enabled = false

[cvm.port_mapping]
enabled = true
Expand Down
18 changes: 0 additions & 18 deletions dstack/port-forward/Cargo.toml

This file was deleted.

137 changes: 0 additions & 137 deletions dstack/port-forward/src/lib.rs

This file was deleted.

Loading
Loading