mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-27 04:28:20 +00:00
net: rename Hyper-V internal network to hvint0 and configure it
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
340f37d93c
commit
b5e38ce811
@ -1,9 +0,0 @@
|
|||||||
auto lo
|
|
||||||
iface lo inet loopback
|
|
||||||
|
|
||||||
auto eth1
|
|
||||||
iface eth1 inet dhcp
|
|
||||||
udhcpc_opts -T 1 -A 3
|
|
||||||
metric 199
|
|
||||||
pre-up service tap-vsockd start
|
|
||||||
post-down service tap-vsockd stop
|
|
@ -13,25 +13,22 @@ start() {
|
|||||||
mobyconfig exists etc/sysfs.conf && mobyconfig get etc/sysfs.conf > /etc/sysfs.conf
|
mobyconfig exists etc/sysfs.conf && mobyconfig get etc/sysfs.conf > /etc/sysfs.conf
|
||||||
mobyconfig exists etc/resolv.conf && mobyconfig get etc/resolv.conf > /etc/resolv.conf
|
mobyconfig exists etc/resolv.conf && mobyconfig get etc/resolv.conf > /etc/resolv.conf
|
||||||
mobyconfig exists random-seed && mobyconfig get random-seed > /dev/urandom
|
mobyconfig exists random-seed && mobyconfig get random-seed > /dev/urandom
|
||||||
|
|
||||||
mobyconfig exists etc/hosts && mobyconfig get etc/hosts >> /etc/hosts
|
mobyconfig exists etc/hosts && mobyconfig get etc/hosts >> /etc/hosts
|
||||||
|
|
||||||
# handle static network config if configured
|
if [ "$(mobyplatform)" = "windows" ]; then
|
||||||
|
# We have two network interfaces. The Hyper-V interface
|
||||||
|
# comes up as eth0. Rename and configure it.
|
||||||
|
ip link set eth0 down
|
||||||
|
ip link set eth0 name hvint0
|
||||||
|
|
||||||
mobyconfig exists net/config && NETCONFIG=`mobyconfig get net/config`
|
mobyconfig exists net/config && NETCONFIG=`mobyconfig get net/config`
|
||||||
if [ "${NETCONFIG}" = "static" ]; then
|
if [ "${NETCONFIG}" = "static" ]; then
|
||||||
# assume that the other configsDB entries exist
|
# assume that the other configsDB entries exist
|
||||||
IP=`mobyconfig get net/address`
|
IP=`mobyconfig get net/address`
|
||||||
MASK=`mobyconfig get net/netmask`
|
MASK=`mobyconfig get net/netmask`
|
||||||
GW=`mobyconfig get net/gateway`
|
ip addr add ${IP}/${MASK} dev hvint0
|
||||||
|
ip link set hvint0 up
|
||||||
cp /etc/network/interfaces.template /etc/network/interfaces
|
fi
|
||||||
echo >> /etc/network/interfaces
|
|
||||||
echo "auto eth0" >> /etc/network/interfaces
|
|
||||||
echo "iface eth0 inet static" >> /etc/network/interfaces
|
|
||||||
echo " address ${IP}" >> /etc/network/interfaces
|
|
||||||
echo " netmask ${MASK}" >> /etc/network/interfaces
|
|
||||||
echo " gateway ${GW}" >> /etc/network/interfaces
|
|
||||||
echo " metric 200" >> /etc/network/interfaces
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mobyconfig exists etc/ssl/certs/ca-certificates.crt && mobyconfig get etc/ssl/certs/ca-certificates.crt >> /etc/ssl/certs/ca-certificates.crt
|
mobyconfig exists etc/ssl/certs/ca-certificates.crt && mobyconfig get etc/ssl/certs/ca-certificates.crt >> /etc/ssl/certs/ca-certificates.crt
|
||||||
|
Loading…
Reference in New Issue
Block a user