mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-09 01:47:32 +08:00
Auto detect macvlan
This commit is contained in:
parent
c116b1b372
commit
4befd3a621
@ -129,20 +129,26 @@ fi
|
||||
|
||||
if [ "$DEBUG" = "Y" ]; then
|
||||
|
||||
GATEWAY=$(ip r | grep default | awk '{print $3}')
|
||||
IP=$(ip address show dev eth0 | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
||||
|
||||
echo && ifconfig
|
||||
echo && ip route && echo
|
||||
echo "IP: ${IP} GATEWAY: ${GATEWAY}" && echo
|
||||
echo "Container IP: ${IP}" && echo
|
||||
|
||||
fi
|
||||
|
||||
update-alternatives --set iptables /usr/sbin/iptables-legacy > /dev/null
|
||||
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy > /dev/null
|
||||
|
||||
#configureNatNetwork
|
||||
configureMacVlan
|
||||
GATEWAY=$(ip r | grep default | awk '{print $3}')
|
||||
|
||||
if [[ "$GATEWAY" == "172."* ]]; then
|
||||
# Configuration for bridge network
|
||||
configureNatNetwork
|
||||
else
|
||||
# Configuration for macvlan network
|
||||
configureMacVlan
|
||||
fi
|
||||
|
||||
# Hack for guest VMs complaining about "bad udp checksums in 5 packets"
|
||||
iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill
|
||||
|
Loading…
x
Reference in New Issue
Block a user