Merge pull request #546 from rneugeba/if-clean

Clean up network interface
This commit is contained in:
Justin Cormack 2016-09-23 10:41:15 +01:00 committed by GitHub
commit 041da8cf1b
5 changed files with 17 additions and 34 deletions

View File

@ -20,6 +20,7 @@ RUN \
rc-update add vsudd boot && \ rc-update add vsudd boot && \
rc-update add sysklogd boot && \ rc-update add sysklogd boot && \
rc-update add hwclock boot && \ rc-update add hwclock boot && \
rc-update add tap-vsockd boot && \
rc-update add networking boot && \ rc-update add networking boot && \
rc-update add acpid default && \ rc-update add acpid default && \
rc-update add chronyd default && \ rc-update add chronyd default && \

View File

@ -4,10 +4,3 @@ iface lo inet loopback
auto eth0 auto eth0
iface eth0 inet dhcp iface eth0 inet dhcp
udhcpc_opts -T 3 -A 3 -t 20 -O search udhcpc_opts -T 3 -A 3 -t 20 -O search
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

View File

@ -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

View File

@ -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
mobyconfig exists net/config && NETCONFIG=`mobyconfig get net/config` # We have two network interfaces. The Hyper-V interface
if [ "${NETCONFIG}" = "static" ]; then # comes up as eth0. Rename and configure it.
# assume that the other configsDB entries exist ip link set eth0 down
IP=`mobyconfig get net/address` ip link set eth0 name hvint0
MASK=`mobyconfig get net/netmask`
GW=`mobyconfig get net/gateway`
cp /etc/network/interfaces.template /etc/network/interfaces mobyconfig exists net/config && NETCONFIG=`mobyconfig get net/config`
echo >> /etc/network/interfaces if [ "${NETCONFIG}" = "static" ]; then
echo "auto eth0" >> /etc/network/interfaces # assume that the other configsDB entries exist
echo "iface eth0 inet static" >> /etc/network/interfaces IP=`mobyconfig get net/address`
echo " address ${IP}" >> /etc/network/interfaces MASK=`mobyconfig get net/netmask`
echo " netmask ${MASK}" >> /etc/network/interfaces ip addr add ${IP}/${MASK} dev hvint0
echo " gateway ${GW}" >> /etc/network/interfaces ip link set hvint0 up
echo " metric 200" >> /etc/network/interfaces fi
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

View File

@ -23,6 +23,7 @@ start()
--background \ --background \
--pidfile ${PIDFILE} \ --pidfile ${PIDFILE} \
-- \ -- \
--tap eth0 \
--pidfile "${PIDFILE}" \ --pidfile "${PIDFILE}" \
--listen --listen