mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-03 01:44:55 +00:00
convert bridge creation to service
update to systemd config files so that the bridge will be up when systemd-networkd is started. Signed-off-by: Tan Shen Joon <shen.joon.tan@intel.com> Reviewed-by: Jack Ren <jack.ren@intel.com>
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Instructions to create systemd-networkd configuration files:
|
||||
|
||||
if [ ! -e /etc/systemd/network ]; then
|
||||
mkdir -p /etc/systemd/network
|
||||
|
||||
# /etc/systemd/network/acrn.network
|
||||
cat <<EOF>/etc/systemd/network/acrn.network
|
||||
[Match]
|
||||
Name=e*
|
||||
|
||||
[Network]
|
||||
Bridge=acrn-br0
|
||||
EOF
|
||||
|
||||
|
||||
# /etc/systemd/network/acrn.netdev
|
||||
cat <<EOF>/etc/systemd/network/acrn.netdev
|
||||
[NetDev]
|
||||
Name=acrn-br0
|
||||
Kind=bridge
|
||||
EOF
|
||||
|
||||
# /etc/systemd/network/eth.network
|
||||
cat <<EOF>/etc/systemd/network/eth.network
|
||||
[Match]
|
||||
Name=acrn-br0
|
||||
|
||||
[Network]
|
||||
DHCP=ipv4
|
||||
EOF
|
||||
|
||||
# need to mask 80-dhcp.network and 80-virtual.network
|
||||
ln -s /dev/null /etc/systemd/network/80-dhcp.network
|
||||
ln -s /dev/null /etc/systemd/network/80-virtual.network
|
||||
|
||||
# should get specifc list of taps
|
||||
# /etc/systemd/network/acrn_tap0.netdev
|
||||
cat <<EOF>/etc/systemd/network/acrn_tap0.netdev
|
||||
[NetDev]
|
||||
Name=acrn_tap0
|
||||
Kind=tap
|
||||
EOF
|
||||
|
||||
# restart systemd-network to create the devices
|
||||
# and bind network address to the bridge
|
||||
systemctl restart systemd-networkd
|
||||
fi
|
||||
|
||||
# add tap device under the bridge
|
||||
ifconfig acrn_tap0 up
|
||||
brctl addif acrn-br0 acrn_tap0
|
Reference in New Issue
Block a user