change usage jaaj vm-start.sh and add possibility to add address to a new bridge

This commit is contained in:
primardj 2024-02-01 15:41:55 +00:00
parent f4133a0457
commit 798d475e98
2 changed files with 8 additions and 2 deletions

View file

@ -19,7 +19,7 @@ PARAMETTER available
OPTION available OPTION available
--add-br-id=<bridge-id> Set the name for the new bridge interface, usually it is br0, br1, etc --add-br-id=<bridge-id> Set the name for the new bridge interface, usually it is br0, br1, etc
--rm-br-id=<bridge-id> Remove a bridge interface. Be carefull, it do no verification wheither bridge-id is a real interface or a bridge interface. --rm-br-id=<bridge-id> Remove a bridge interface. Be carefull, it do no verification wheither bridge-id is a real interface or a bridge interface.
--addr=<address> Set an external address on the bridge. The external is the one accessible from the host. #TODO --addr=<address> Set an external address on the bridge. The external is the one accessible from the host.
--replace=<interface> In case you want to replace the main connexion of your computer so that only the vm will be able to reach the external network, replace interface by the interface you want to replace, and make sure that the --addr is set to one of the ip on the interace. Please not that it will be possible for your host to lost all connection to the external internet with this parametter. --replace=<interface> In case you want to replace the main connexion of your computer so that only the vm will be able to reach the external network, replace interface by the interface you want to replace, and make sure that the --addr is set to one of the ip on the interace. Please not that it will be possible for your host to lost all connection to the external internet with this parametter.
" "
Version="1.0" Version="1.0"
@ -99,6 +99,7 @@ for i in $@; do
bridge="${i#*=}" bridge="${i#*=}"
echo "${bridge}" echo "${bridge}"
rm_bridge rm_bridge
exit 0
;; ;;
"--addr") "--addr")
address="${i#*=}" address="${i#*=}"
@ -121,6 +122,11 @@ then
exit exit
fi fi
if [ ! "${address}" == "" ]
then
${rooter} ip a add dev ${bridge} ${address}
fi

View file

@ -30,7 +30,7 @@ COMMAND available
OPTION available OPTION available
--nproc=<nb proc> Def the number of proc of the vm --nproc=<nb proc> Def the number of proc of the vm
--memory=<mem> Def the qty of memory allocated to the vm --memory=<mem> Def the qty of memory allocated to the vm
--size=<size> Def the size that should be allocated by create #TODO --size=<size> Def the size that will be allocated by create. Have no effect on other commands.
--uefi Select if there will be an UEFI by default. --uefi Select if there will be an UEFI by default.
can be either set or unset. By default is unset. can be either set or unset. By default is unset.
--options=<option> additinal options to give to qemu. By default is --options=<option> additinal options to give to qemu. By default is