Skip to content

Commit 926a6fa

Browse files
committed
Bug fixes to container post
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 852783c commit 926a6fa

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

_posts/2024-10-15-basic-container.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ admin@infix:/config/interface/veth0a/> end
6262
admin@infix:/config/> edit interface veth0b
6363
admin@infix:/config/interface/veth0b/> set ipv4 address 192.168.0.2 prefix-length 30
6464
admin@infix:/config/interface/veth0b/> set container-network
65+
admin@infix:/config/interface/veth0b/> set container-network route 0.0.0.0/0 gateway 192.168.0.1
6566
admin@infix:/config/interface/veth0b/> leave
6667
```
6768

@@ -75,6 +76,7 @@ admin@infix:/config/container/system/> set image docker://ghcr.io/kernelkit/curi
7576
admin@infix:/config/container/system/> set hostname sys101
7677
admin@infix:/config/container/system/> set privileged true
7778
admin@infix:/config/container/system/> set network interface veth0b
79+
admin@infix:/config/container/system/> set network dns 192.168.0.1
7880
admin@infix:/config/container/system/> set volume etc target /etc
7981
admin@infix:/config/container/system/> set volume var target /var
8082
admin@infix:/config/container/system/> leave
@@ -101,8 +103,8 @@ admin@infix:/config/interface/veth0b/> leave
101103

102104
Next, a [zone-based firewall][8] to protect the WAN port and let the
103105
container reach the Internet via masquerade (NAT). The `containers`
104-
zone covers `veth0a`the host end of the pair — and the policy routes
105-
traffic from there out through the `public` zone on `e1`:
106+
zone covers the VETH subnet and the policy routes traffic from there out
107+
through the `public` zone on `e1`:
106108

107109
```console
108110
admin@infix:/> configure
@@ -112,7 +114,7 @@ admin@infix:/config/firewall/> set zone public action reject
112114
admin@infix:/config/firewall/> set zone public interface e1
113115
admin@infix:/config/firewall/> set zone public service ssh
114116
admin@infix:/config/firewall/> set zone containers action accept
115-
admin@infix:/config/firewall/> set zone containers interface veth0a
117+
admin@infix:/config/firewall/> set zone containers network 192.168.0.0/30
116118
admin@infix:/config/firewall/> set policy container-access ingress containers
117119
admin@infix:/config/firewall/> set policy container-access egress public
118120
admin@infix:/config/firewall/> set policy container-access action accept
@@ -131,6 +133,12 @@ admin@infix:/config/firewall/> set zone public port-forward 8080 proto tcp to ad
131133
admin@infix:/config/firewall/> leave
132134
```
133135

136+
> Port forwarding only works when the destination zone is defined using
137+
> `network`, not `interface`. If the `containers` zone were set with
138+
> `set zone containers interface veth0a` instead, forwarded packets
139+
> would be dropped silently.
140+
{: .prompt-warning }
141+
134142
## The Result
135143

136144
We should now have a running container.

0 commit comments

Comments
 (0)