Skip to content

Instantly share code, notes, and snippets.

@rajeshrah22
Last active July 13, 2025 21:14
Show Gist options
  • Select an option

  • Save rajeshrah22/b3a80c34586b5d661a200b43f8c68c5d to your computer and use it in GitHub Desktop.

Select an option

Save rajeshrah22/b3a80c34586b5d661a200b43f8c68c5d to your computer and use it in GitHub Desktop.
Reproduces error on a particular issue I was working on -- replicating a CI test case that was failing because Linux bridge 'linux-br0' was not found.
read -r -d '' LINUX_BRIDGE <<EOF
interfaces:
- name: eth1
type: veth
state: up
- name: linux-br0
type: linux-bridge
state: up
bridge:
port:
- name: eth1
EOF
read -r -d '' LINUX_BRIDGE_ABSENT <<EOF
interfaces:
- name: eth1
type: veth
state: absent
- name: linux-br0
type: linux-bridge
state: absent
EOF
create_eth1() {
sudo ip link add eth1 type veth peer eth1_p
}
delete_eth1() {
sudo ip link delete eth1
}
delete_bridge() {
sudo ip link delete linux-br0
}
main() {
sudo systemctl stop NetworkManager
delete_bridge
delete_eth1
create_eth1
if ! (echo "$LINUX_BRIDGE" | sudo ./rust/target/debug/nmstatectl apply -k -); then
echo "apply failed"
fi
echo "sleeping 3 ..."
sleep 3
echo "$LINUX_BRIDGE_ABSENT" | sudo ./rust/target/debug/nmstatectl apply -k -
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment