mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Provide info about ipvlan
Provide info about ipvlan
This commit is contained in:
commit
c649fe3d82
@ -30,7 +30,10 @@ configureDHCP() {
|
|||||||
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
||||||
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge ; rc=$?; } || :
|
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge ; rc=$?; } || :
|
||||||
|
|
||||||
if (( rc == 0 )); then
|
if (( rc != 0 )); then
|
||||||
|
echo -n "ERROR: Cannot create macvlan interface. Please make sure the network type is 'macvlan' and not 'ipvlan'."
|
||||||
|
echo " And that the NET_ADMIN capability has been added to the container config: --cap-add NET_ADMIN" && exit 15
|
||||||
|
fi
|
||||||
|
|
||||||
ip address add "${IP}" dev "${VM_NET_VLAN}"
|
ip address add "${IP}" dev "${VM_NET_VLAN}"
|
||||||
ip link set dev "${VM_NET_VLAN}" up
|
ip link set dev "${VM_NET_VLAN}" up
|
||||||
@ -41,12 +44,6 @@ configureDHCP() {
|
|||||||
ip route add "${NETWORK}" dev "${VM_NET_VLAN}" metric 0
|
ip route add "${NETWORK}" dev "${VM_NET_VLAN}" metric 0
|
||||||
ip route add default via "${GATEWAY}"
|
ip route add default via "${GATEWAY}"
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
echo "INFO: Could not create ${VM_NET_VLAN} on ${VM_NET_DEV}, skipping..."
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
{ ip link add link "${VM_NET_DEV}" name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge ; rc=$?; } || :
|
{ ip link add link "${VM_NET_DEV}" name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge ; rc=$?; } || :
|
||||||
|
|
||||||
if (( rc != 0 )); then
|
if (( rc != 0 )); then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user