mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
macvlan
This commit is contained in:
parent
20fc841516
commit
d5fc608f7d
@ -29,7 +29,7 @@ configureDHCP() {
|
|||||||
echo "docker variable to your container: --device=/dev/vhost-net" && exit 85
|
echo "docker variable to your container: --device=/dev/vhost-net" && exit 85
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VM_NET_TAP="_VmMacvtap"
|
VM_NET_TAP="dsm"
|
||||||
echo "Info: Retrieving IP via DHCP using MAC ${VM_NET_MAC}..."
|
echo "Info: Retrieving IP via DHCP using MAC ${VM_NET_MAC}..."
|
||||||
|
|
||||||
ip l add link eth0 name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge || true
|
ip l add link eth0 name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge || true
|
||||||
@ -54,7 +54,7 @@ configureDHCP() {
|
|||||||
TAP_PATH="/dev/tap$(</sys/class/net/${VM_NET_TAP}/ifindex)"
|
TAP_PATH="/dev/tap$(</sys/class/net/${VM_NET_TAP}/ifindex)"
|
||||||
|
|
||||||
# create dev file (there is no udev in container: need to be done manually)
|
# create dev file (there is no udev in container: need to be done manually)
|
||||||
IFS=: read -r MAJOR MINOR < <(cat "/sys/devices/virtual/net/${VM_NET_TAP}/tap*/dev")
|
IFS=: read -r MAJOR MINOR < <(cat /sys/devices/virtual/net/"${VM_NET_TAP}"/tap*/dev)
|
||||||
|
|
||||||
if (( MAJOR < 1)); then
|
if (( MAJOR < 1)); then
|
||||||
echo "ERROR: Cannot find: sys/devices/virtual/net/${VM_NET_TAP}" && exit 18
|
echo "ERROR: Cannot find: sys/devices/virtual/net/${VM_NET_TAP}" && exit 18
|
||||||
|
Loading…
x
Reference in New Issue
Block a user