change network scripts

This commit is contained in:
primardj 2024-02-13 23:04:11 +00:00
parent ad2995ed87
commit ae29e8c584
3 changed files with 43 additions and 1 deletions

View file

@ -0,0 +1,33 @@
#!/bin/bash
add_bridge() {
echo "add bridge interface ${bridge}"
ip link add ${bridge} type bridge
# authorise qemu to use as interface ${bridge} as bridge
if cat /etc/qemu/bridge.conf | grep -q "${bridge}"
then
echo "bridge already authorised by qemu"
else
echo "allow ${bridge}" | tee -a /etc/qemu/bridge.conf
echo "entry added to /etc/qemu/bridge.conf"
fi
echo "activate bridge ${bridge}"
ip link set dev ${bridge} up
}
ip link add br0 type bridge
ip link set dev tap0 master br0
ip address delete 10.0.2.100/24 dev tap0
ip address add 10.0.2.100/24 dev br0
ip link set dev br0 up
ip route add default via 10.0.2.0 dev br0
bridge="br1"
add_bridge
bridge="br2"
add_bridge

View file

@ -0,0 +1,8 @@
#!/bin/bash
#
#echo $$ > /tmp/pid
#unshare --user --map-root-user --net --mount
#slirp4netns
rootlesskit --net=slirp4netns --copy-up=/etc bash

View file

@ -50,7 +50,8 @@ then
fi
OPTION="-display gtk \
-usbdevice tablet"
-usbdevice tablet \
-daemonize"
# other options choices
#