Manual network bridge setup
- Create a script that creates a vm-bridge /opt/mono-vm/vm-bridge.sh [755]
#!/bin/bash
ip link add name vm-bridge type bridge
ip link set dev vm-bridge up
ip link add name hostside type veth peer name bridgeside
ip addr add 10.100.100.2/24 dev hostside
ip link set hostside up
ip link set bridgeside up
ip link set bridgeside master vm-bridge
- Create service that will run bridge setup script every time system boots up
/etc/systemd/system/vm-bridge.service [644]
[Unit]
Description=Initializing vm-bridge
Before=network-pre.target
Wants=network-pre.target
[Service]
Type=oneshot
ExecStart=/opt/mono-vm/vm-bridge.sh
ExecReload=true
ExecStop=true
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
- Reload systemctl and enable the service
# systemctl daemon-reload
# systemctl enable --now vm-bridge.service