# LAN dhcpd server on eth0 stops internet on eth1 [Solved]

## feynman

I have been following the diskless node and home router guides, and the eth0 server works just fine. However I cannot connect to the internet from eth1 (it is as though the ethernet cable is not connected.) Here is an odd clue:

I can get internet on eth1 if I bring eth0 down and up again. 

I have:

interface eth1 (along with the defaults) in my dhcpcd.conf file

In my dhcpd.conf file

192.168.1.1 as my router and domain-name-server

"cluster" as my domain name

and ddns-update-style is none

My subnet is 192.168.1.0 and netmask is 255.255.255.0

DHCPD_IFACE="eth0" in my dhcpd file

my net file looks like this:

config_eth0="192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0" )

routes_eth0="default via 192.168.1.1"

dns_domain_eth0="cluster"

config_eth1="dhcp"

I have net.eth1 and net.eth0 loaded in default during boot. So it seems that if I made sure eth1 went up before eth0 everything would be fine. That still seems strange, and I think I must be missing some setting. If nothing else, I would like to know why this is necessary.

ThanksLast edited by feynman on Wed Nov 30, 2011 8:18 pm; edited 1 time in total

----------

## gentoo_ram

Take out the "default via 192.168.1.1" route.  Just remove the whole line.  It isn't correct.  That says "for any IP address I don't have a direct route to, send it out via 192.168.1.1".  That isn't what you want, you want "default" to go out the Internet interface that's handled by dhcpcd.  It will set the default route.

----------

## feynman

Ok, I will give that a try when I get back home. If the line:

routes_eth0="default via 192.168.1.1" 

It seems odd to me that a setting for "_eth0" influences eth1. How does that work? How is routes_eth0="stuff" different from routes_eth1="stuff"? Also, if I do set routes_ethN="stuff", does that always mean that setting config_ethM="dhcp" will not do anything?

I figure that as long as my desktop is inaccessible, I might as well take some time to better understand my setup.

----------

## gentoo_ram

Because normally you should have exactly one 'default' route on your machine.  But your configuration made 2 default routes: the one the DHCP client will set up on eth1 and the incorrect one you hard-coded for eth0.  Depending on the order that the interfaces come up, your outgoing Internet packets will either go down the incorrect default route on eth0 or the correct route on eth1.  By cycling eth0 you potentially change the order of the 2 default routes and your network appears to work again.

If all you want is 192.168.1.0/24 traffic to do down eth0 (which is what I'm guessing you want), then you don't need to add any routes_eth0 entry to the config file.  The correct route will get added automatically.

I predict the next issue you will face has to do with domain name resolution...

----------

## feynman

Thank you. That worked just fine. I get internet and my client computer gets dhcp.

 *Quote:*   

> I predict the next issue you will face has to do with domain name resolution...

 

Ok, I will bite--what else am I doing wrong?

----------

