# Two ethernet adapters, services won't work with both

## Darexius

I have a web/file server set up on my network. The server has two NICs, one attached to our local network (eth0) for samba usage, and the other attached to a switch, which is attached to our modem and set on a static IP within our IP block (eth1). Both reach out to the internet just fine.

When eth0 is up, I can't reach any services via the server's static IP. When eth0 is down, I can reach everything fine.

I can't seem to figure out why. It's not just apache, either. UnrealIRCd, pureFTPd, etc, don't work on the static IP when eth0 is up.

Is there any particular reason? I'll post any configs necessary. I figure this one will be helpful

/etc/conf.d/net

```
config_eth1=("97.x.x.178 netmask 255.255.255.248")

routes_eth1=("default via 97.x.x.177")

dns_servers_eth1=("24.x.x.38 24.x.x.18")
```

----------

## Inodoro_Pereyra

While eth0 is up, post the output of:

```
route
```

Cheers!

----------

## Darexius

 *Inodoro_Pereyra wrote:*   

> While eth0 is up, post the output of:
> 
> ```
> route
> ```
> ...

 

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

97-xx-xx-176.st *               255.255.255.248 U     0      0        0 eth1

192.168.1.0     *               255.255.255.0   U     1      0        0 eth0

loopback        *               255.0.0.0       U     0      0        0 lo

default         97-xx-xx-177.st 0.0.0.0         UG    0      0        0 eth1

default         192.168.1.1     0.0.0.0         UG    1      0        0 eth0

```

For whatever reason right this second it works. I don't understand why it would right now but never before. Any thoughts?

----------

## Mad Merlin

You have two default routes, which is rarely what you actually want. The kernel picks the first working default route it can find and uses it (starting with the lowest metric, IIRC). Just set one default route and you'll likely have more success.

----------

## cach0rr0

 *Mad Merlin wrote:*   

> You have two default routes, which is rarely what you actually want. The kernel picks the first working default route it can find and uses it (starting with the lowest metric, IIRC). Just set one default route and you'll likely have more success.

 

++ this

let your ISP's gateway be your default route

configure 192.168.1.1 as a static route for 192.168.0.0/16 only

----------

