WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: DHCP with eth0 & eth1 / empty resolve.conf  (Read 7450 times)

Offline aheissenberger

  • Newbie
  • *
  • Posts: 3
DHCP with eth0 & eth1 / empty resolve.conf
« 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

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: DHCP with eth0 & eth1 / empty resolve.conf
« Reply #1 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.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: DHCP with eth0 & eth1 / empty resolve.conf
« Reply #2 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.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline aheissenberger

  • Newbie
  • *
  • Posts: 3
Re: DHCP with eth0 & eth1 / empty resolve.conf
« Reply #3 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
--
« Last Edit: January 11, 2014, 05:34:01 AM by aheissenberger »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: DHCP with eth0 & eth1 / empty resolve.conf
« Reply #4 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.
The only barriers that can stop you are the ones you create yourself.