diff --git a/ethernet_restreint/config_interface.sh b/ethernet_restreint/config_interface.sh new file mode 100755 index 0000000..0bf5133 --- /dev/null +++ b/ethernet_restreint/config_interface.sh @@ -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 + diff --git a/ethernet_restreint/enter_ethernet_restreint.sh b/ethernet_restreint/enter_ethernet_restreint.sh new file mode 100755 index 0000000..e84c446 --- /dev/null +++ b/ethernet_restreint/enter_ethernet_restreint.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# + +#echo $$ > /tmp/pid +#unshare --user --map-root-user --net --mount +#slirp4netns + +rootlesskit --net=slirp4netns --copy-up=/etc bash diff --git a/vm-start.sh b/vm-start.sh index 88fa138..6219da9 100755 --- a/vm-start.sh +++ b/vm-start.sh @@ -50,7 +50,8 @@ then fi OPTION="-display gtk \ - -usbdevice tablet" + -usbdevice tablet \ + -daemonize" # other options choices #