change network scripts
This commit is contained in:
parent
ad2995ed87
commit
ae29e8c584
3 changed files with 43 additions and 1 deletions
33
ethernet_restreint/config_interface.sh
Executable file
33
ethernet_restreint/config_interface.sh
Executable 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
|
||||||
|
|
8
ethernet_restreint/enter_ethernet_restreint.sh
Executable file
8
ethernet_restreint/enter_ethernet_restreint.sh
Executable 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
|
|
@ -50,7 +50,8 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OPTION="-display gtk \
|
OPTION="-display gtk \
|
||||||
-usbdevice tablet"
|
-usbdevice tablet \
|
||||||
|
-daemonize"
|
||||||
|
|
||||||
# other options choices
|
# other options choices
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue