@@ -62,6 +62,7 @@ admin@infix:/config/interface/veth0a/> end
6262admin@infix:/config/ > edit interface veth0b
6363admin@infix:/config/interface/veth0b/ > set ipv4 address 192.168.0.2 prefix-length 30
6464admin@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
6566admin@infix:/config/interface/veth0b/ > leave
6667```
6768
@@ -75,6 +76,7 @@ admin@infix:/config/container/system/> set image docker://ghcr.io/kernelkit/curi
7576admin@infix:/config/container/system/ > set hostname sys101
7677admin@infix:/config/container/system/ > set privileged true
7778admin@infix:/config/container/system/ > set network interface veth0b
79+ admin@infix:/config/container/system/ > set network dns 192.168.0.1
7880admin@infix:/config/container/system/ > set volume etc target /etc
7981admin@infix:/config/container/system/ > set volume var target /var
8082admin@infix:/config/container/system/ > leave
@@ -101,8 +103,8 @@ admin@infix:/config/interface/veth0b/> leave
101103
102104Next, a [ zone-based firewall] [ 8 ] to protect the WAN port and let the
103105container 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
108110admin@infix:/ > configure
@@ -112,7 +114,7 @@ admin@infix:/config/firewall/> set zone public action reject
112114admin@infix:/config/firewall/ > set zone public interface e1
113115admin@infix:/config/firewall/ > set zone public service ssh
114116admin@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
116118admin@infix:/config/firewall/ > set policy container-access ingress containers
117119admin@infix:/config/firewall/ > set policy container-access egress public
118120admin@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
131133admin@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
136144We should now have a running container.
0 commit comments