fix #382. change interface description to use delimiter not used in guest names

This commit is contained in:
Matt Churchyard
2021-01-05 09:47:58 +00:00
parent 3b7560cba6
commit 52a504e409
6 changed files with 8 additions and 8 deletions

View File

@@ -25,7 +25,7 @@
# POSSIBILITY OF SUCH DAMAGE.
VERSION=1.5-devel
VERSION_INT=105011
VERSION_INT=105012
VERSION_BSD=$(uname -K)
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

View File

@@ -145,7 +145,7 @@ info::switch_ports(){
local _port _guest
for _port in ${_port_list}; do
_guest=$(ifconfig "${_port}" |grep 'description: vmnet-' |awk '{print $2}' |cut -d'-' -f2)
_guest=$(ifconfig "${_port}" |grep 'description: vmnet' |awk '{print $2}' |cut -d'/' -f2)
echo ""
echo "${_INDENT}virtual-port"

View File

@@ -574,7 +574,7 @@ vm::bhyve_device_networking(){
if [ -n "${_tap}" ]; then
util::log "guest" "${_name}" "initialising network device ${_tap}"
ifconfig "${_tap}" descr "vmnet-${_name}-${_num}-${_switch:-custom}" group vm-port >/dev/null 2>&1
ifconfig "${_tap}" descr "vmnet/${_name}/${_num}/${_switch:-custom}" group vm-port >/dev/null 2>&1
if [ -n "${_switch}" ]; then
switch::id "_sid" "${_switch}"

View File

@@ -40,7 +40,7 @@ switch::manual::init(){
fi
# don't rename custom bridges. user can set this in rc.conf or just stick with bridgeX
ifconfig "${_bridge}" descr "vm-${_name}" group vm-switch up >/dev/null 2>&1
ifconfig "${_bridge}" descr "vm/${_name}" group vm-switch up >/dev/null 2>&1
switch::set_viid "${_name}" "${_bridge}"
}

View File

@@ -43,7 +43,7 @@ switch::standard::init(){
if [ ${_len} -le 12 ]; then
_ifconf="name vm-${_name}"
else
_ifconf="descr vm-${_name}"
_ifconf="descr vm/${_name}"
fi
# create a bridge for this switch
@@ -293,7 +293,7 @@ switch::standard::__configure_port(){
# use our id as the interface name here.
# it should always be a valid name and interface.vlan-id is much easier to understand in ifconfig
# than a bunch of vlanX interfaces
_viface=$(ifconfig vlan create vlandev "${_port}" vlan "${_vlan}" descr "vm-vlan-${_switch}-${_vname}" name "${_vname}" group vm-vlan up 2>/dev/null)
_viface=$(ifconfig vlan create vlandev "${_port}" vlan "${_vlan}" descr "vm-vlan/${_switch}/${_vname}" name "${_vname}" group vm-vlan up 2>/dev/null)
[ $? -eq 0 ] || util::err "failed to create vlan interface for port ${_port} on switch ${_switch}"
fi

View File

@@ -50,7 +50,7 @@ switch::vxlan::init(){
# create the vxlan interface
ifconfig "vxlan${_vlan}" create vxlanid "${_vlan}" vxlanlocal "${_local}" vxlangroup "${_maddr}" \
vxlandev "${_if}" descr "vm-vxlan-${_switch}" group vm-vlan up >/dev/null 2>&1
vxlandev "${_if}" descr "vm-vxlan/${_switch}" group vm-vlan up >/dev/null 2>&1
[ $? -eq 0 ] || return 1
# get the length of the switch name
@@ -61,7 +61,7 @@ switch::vxlan::init(){
if [ ${_len} -le 12 ]; then
_ifconf="name vm-${_name}"
else
_ifconf="descr vm-${_name}"
_ifconf="descr vm/${_name}"
fi
# create a bridge for this switch