From 7478cc7c80e78be50f78169bfab6f7926512f697 Mon Sep 17 00:00:00 2001 From: David Scott Date: Sat, 16 Apr 2016 19:31:32 +0100 Subject: [PATCH 1/2] Configure a second possible NIC (eth1) This makes it possible to have one NIC controlled by vmnet and another controlled by slirp. If eth1 doesn't exist then a harmless message is generated during bootup: (with no appreciable delay) * Starting networking ... * lo ... [ ok ] * eth0 ... [ ok ] * eth1 ...ip: ioctl 0x8913 failed: No such device [ !! ] Signed-off-by: David Scott --- alpine/etc/network/interfaces | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alpine/etc/network/interfaces b/alpine/etc/network/interfaces index 22229ad74..79c0fa716 100644 --- a/alpine/etc/network/interfaces +++ b/alpine/etc/network/interfaces @@ -4,3 +4,7 @@ iface lo inet loopback auto eth0 iface eth0 inet dhcp udhcpc_opts -T 1 -A 3 + +auto eth1 +iface eth1 inet dhcp + udhcpc_opts -T 1 -A 3 From 67205f62d9802d0e2add0482a8331cfd71ac45fb Mon Sep 17 00:00:00 2001 From: David Scott Date: Sat, 16 Apr 2016 19:35:18 +0100 Subject: [PATCH 2/2] mdnstool: add support for a "hybrid" network mode Normally we advertise $(hostname).local. by MDNS on eth0. If the new "hybrid" networking mode is configured, we will use 2 NICs and eth1 will be connected via vmnet, and so we should run MDNS on it. Signed-off-by: David Scott --- alpine/packages/mdnstool/etc/init.d/mdnstool | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/alpine/packages/mdnstool/etc/init.d/mdnstool b/alpine/packages/mdnstool/etc/init.d/mdnstool index 8de55f952..031324973 100755 --- a/alpine/packages/mdnstool/etc/init.d/mdnstool +++ b/alpine/packages/mdnstool/etc/init.d/mdnstool @@ -17,11 +17,16 @@ start() hostname -F /etc/hostname export HOSTNAME=$(hostname -s).local. + INTF=eth0 + if [ "$(mobyconfig get network)" = "hybrid" ]; then + INTF=eth1 + fi + start-stop-daemon --start --quiet \ --background \ --exec /sbin/mdnstool \ --make-pidfile --pidfile ${PIDFILE} \ - -- -if eth0 -hostname ${HOSTNAME} + -- -if ${INTF} -hostname ${HOSTNAME} eend $? "Failed to start mDNS server" }