Difference between revisions of "Lxd network config"
From Jay's Cafe' Wiki
Jayctheriot (talk | contribs) (Created page with "<pre> lxc network show br0 name: br0 description: "" type: bridge managed: false status: "" config: {} used_by: </pre> <pre> lxc profile show default name: default description: Default LXD profile config: security.secureboot: "false" devices: eth0: name: eth0 nictype: bridged parent: br0 type: nic root: path: / pool: default type: disk used_by: </pre>") |
Jayctheriot (talk | contribs) m |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
< | Objective: Configure a bridged network allowing containers access to the LAN. | ||
Install netplan.io, systemd-resolved, incus and bridge-utils<syntaxhighlight lang="bash"> | |||
apt-get install netplan.io systemd-resolved incus incus-extra bridge-utils | |||
</syntaxhighlight> | |||
Configure a network external to lxd/incus using bridge-utils and the following netplan config:<syntaxhighlight lang="yaml"> | |||
network: | |||
ethernets: | |||
eno1: | |||
addresses: | |||
- 192.168.0.31/17 | |||
gateway4: 192.168.0.1 | |||
nameservers: | |||
addresses: | |||
- 192.168.0.1 | |||
search: | |||
- attlocal.net | |||
eno2: | |||
dhcp4: yes | |||
dhcp6: no | |||
bridges: | |||
br0: | |||
interfaces: [eno2] | |||
parameters: | |||
stp: true | |||
forward-delay: 4 | |||
dhcp4: yes | |||
dhcp6: no | |||
renderer: networkd | |||
version: 2 | |||
</syntaxhighlight>Configure network br0 internal to lxd (you may not be able to change anything).<syntaxhighlight lang="yaml"> | |||
lxc network show br0 | lxc network show br0 | ||
name: br0 | name: br0 | ||
description: "" | description: "" | ||
type: bridge | type: bridge | ||
managed: false | managed: false | ||
status: "" | status: "" | ||
config: {} | config: {} | ||
used_by: | used_by: | ||
</ | </syntaxhighlight> | ||
< | Edit the default profile to match below.<syntaxhighlight lang="yaml"> | ||
lxc profile show default | lxc profile show default | ||
name: default | name: default | ||
| Line 26: | Line 57: | ||
type: disk | type: disk | ||
used_by: | used_by: | ||
</ | </syntaxhighlight> | ||
Latest revision as of 04:56, 30 April 2025
Objective: Configure a bridged network allowing containers access to the LAN.
Install netplan.io, systemd-resolved, incus and bridge-utils
apt-get install netplan.io systemd-resolved incus incus-extra bridge-utils
Configure a network external to lxd/incus using bridge-utils and the following netplan config:
network:
ethernets:
eno1:
addresses:
- 192.168.0.31/17
gateway4: 192.168.0.1
nameservers:
addresses:
- 192.168.0.1
search:
- attlocal.net
eno2:
dhcp4: yes
dhcp6: no
bridges:
br0:
interfaces: [eno2]
parameters:
stp: true
forward-delay: 4
dhcp4: yes
dhcp6: no
renderer: networkd
version: 2
Configure network br0 internal to lxd (you may not be able to change anything).
lxc network show br0
name: br0
description: ""
type: bridge
managed: false
status: ""
config: {}
used_by:
Edit the default profile to match below.
lxc profile show default
name: default
description: Default LXD profile
config:
security.secureboot: "false"
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
root:
path: /
pool: default
type: disk
used_by: