mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-08 01:18:32 +08:00
Make vlan optional
This commit is contained in:
parent
f4a2a77314
commit
659b59e9b1
@ -29,9 +29,11 @@ configureDHCP() {
|
||||
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge 2> /dev/null ; rc=$?; } || :
|
||||
|
||||
if (( rc != 0 )); then
|
||||
echo -n "ERROR: Capability NET_ADMIN has not been set ($rc/1). Please add the "
|
||||
echo "following docker setting to your container: --cap-add NET_ADMIN" && exit 15
|
||||
fi
|
||||
|
||||
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge ; } || :
|
||||
echo -n "INFO: Could not create macvlan, skipping..."
|
||||
|
||||
else
|
||||
|
||||
ip address add "${IP}" dev "${VM_NET_VLAN}"
|
||||
ip link set dev "${VM_NET_VLAN}" up
|
||||
@ -42,6 +44,8 @@ configureDHCP() {
|
||||
ip route add "${NETWORK}" dev "${VM_NET_VLAN}" metric 0
|
||||
ip route add default via "${GATEWAY}"
|
||||
|
||||
fi
|
||||
|
||||
{ ip link add link "${VM_NET_DEV}" name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge 2> /dev/null ; rc=$?; } || :
|
||||
|
||||
if (( rc != 0 )); then
|
||||
|
Loading…
x
Reference in New Issue
Block a user