Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: aheissenberger on January 10, 2014, 05:45:06 PM

Title: DHCP with eth0 & eth1 / empty resolve.conf
Post by: aheissenberger on January 10, 2014, 05:45:06 PM
Situation:
eth0 DHCP valid DNS entries
eth1 DHCP no DNS entries

the empty DNS config from eth1 replaces valid DNS config from eth0

On debian the existing /etc/resolve.conf does not get replaced by an empty DNS config

How can I fix this without just changing the order of the eth adapters?

thanks
Andreas
Title: Re: DHCP with eth0 & eth1 / empty resolve.conf
Post by: gerald_clark on January 10, 2014, 06:59:42 PM
This isn't Debian. It isn't even a boot and run distro.
It is a tool kit and you will have to script your own multiple NIC ethernet configuration.
Title: Re: DHCP with eth0 & eth1 / empty resolve.conf
Post by: tinypoodle on January 10, 2014, 09:59:05 PM
Using the search function of this forum before starting a new thread could often be fruitful:

http://forum.tinycorelinux.net/index.php/topic,8019

While above should solve exactly what you asked for, be aware that running a dhcp client for more than one interface could be a bad idea if you don't know exactly what you're doing, e.g. besides from dns issues you might encounter routing issues.
Title: Re: DHCP with eth0 & eth1 / empty resolve.conf
Post by: aheissenberger on January 11, 2014, 05:26:39 AM
This behavior is different to the behavior of the DHCP Client under
debian/ubuntu where an empty DNS entry will not delete the existing
/etc/resolv.conf

example:
udhcpc -i eth0
udhcpc (v1.20.2) started
Sending discover...
Sending select for 10.0.2.15...
Lease of 10.0.2.15 obtained, lease time 86400
deleting routers
route: SIOCDELRT: No such process
adding dns 10.0.2.2

sets /etc/resolv.conf:
search me
nameserver 10.0.2.2

udhcpc -i eth1
udhcpc (v1.20.2) started
Sending discover...
Sending select for 192.168.56.105...
Lease of 192.168.56.105 obtained, lease time 1200

sets /etc/resolv.conf (empty):

I suggest to only reset /resov.conf in case of an existing nameserver entry:

/usr/share/udhcpc/default.script
@@ -28,7 +28,9 @@ case "$1" in
             done
         fi

-        echo -n > $RESOLV_CONF
+        if [ -n "$dns" ] ; then
+            echo -n > $RESOLV_CONF
+        fi
         [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
         for i in $dns ; do
             echo adding dns $i
--
Title: Re: DHCP with eth0 & eth1 / empty resolve.conf
Post by: curaga on January 11, 2014, 06:39:12 AM
As the others say, you shouldn't run DHCP on multiple interfaces, as it can break more than just DNS.