Skip to content

Commit

Permalink
Add bridges networking to all existing bridges in the system
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Jan 12, 2025
1 parent c8cacef commit 1e2b2b2
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions tools/modules/software/module_cockpit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ function module_cockpit() {
pkg_update
pkg_install cockpit cockpit-ws cockpit-system cockpit-storaged cockpit-machines samba dnsmasq virtinst qemu-kvm qemu-utils
# add bridged networking
cat <<- EOF > /etc/libvirt/kvm-hostbridge.xml
<network>
<name>hostbridge</name>
<forward mode="bridge"/>
<bridge name="br0"/>
</network>
EOF
virsh net-define /etc/libvirt/kvm-hostbridge.xml
virsh net-start hostbridge
virsh net-autostart hostbridge

for f in /sys/class/net/*; do
intf=$(basename $f)
if [[ $intf =~ ^br[0-9] ]]; then
cat <<- EOF > /etc/libvirt/kvm-hostbridge-${intf}.xml
<network>
<name>hostbridge-${intf}</name>
<forward mode="bridge"/>
<bridge name="${intf}"/>
</network>
EOF
virsh net-define /etc/libvirt/kvm-hostbridge-${intf}.xml
virsh net-start hostbridge-${intf}
virsh net-autostart hostbridge-${intf}
done
echo "Cockpit installed successfully."
;;
"${commands[2]}")
Expand Down

0 comments on commit 1e2b2b2

Please sign in to comment.