# Dual NIC configuration question

## Judg3

Hello gang,

 I'm sure this has been asked before, but I haven't been able to find the 'right' answer for me. What I have is 2 NICs, one has an external IP, the other a 192.168.1.x internal IP. I can ping anything externally fine, but if I attempt to ping something that's 192.168 I get "Destination Host Unreachable". 

Now I know the eth1 settings below aren't correct, and I've searched around and tried several things, but those also didn't work, so I've set it back to what it was and will present that to you all. 

ifconfig -a, showing the 2 network cards:

 *Quote:*   

> eth0      Link encap:Ethernet  HWaddr 00:12:3f:b8:c7:a4
> 
>           inet addr:173.8.xxx.xxx  Bcast:173.8.xxx.xxx  Mask:255.255.255.248
> 
>           inet6 addr: fe80::212:3fff:feb8:c7a4/64 Scope:Link
> ...

 

Contents of /etc/conf.d/net:

 *Quote:*   

> 
> 
> config_eth0=( "173.8.xxx.xxx/29" )
> 
> routes_eth0=( "default via 173.8.xxx.xxx" )
> ...

 

Current routing table (using 'route'):

 *Quote:*   

> 
> 
> Kernel IP routing table
> 
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> ...

 

Example output, ping of Google.com, and then a machine on my network:

 *Quote:*   

> 
> 
> raven ~ # ping google.com
> 
> PING google.com (74.125.225.1 56(84) bytes of data.
> ...

 

So, from all of my searching, I figure I need to use route to add routes to the table and/or adjust conf.d/net to make this work. I know it shows 2 default gateways, which isn't correct. But I just can't figure out just what is the correct settings and could use some help. 

To sum up, this is the issue and what I'm trying to accomplish:

 I have 2 interfaces configured. One has an external IP, the other an internal IP.

 I want all external traffic (Such as a ping of google.com) to go through eth0

 I want all internal traffic (Such as a ping or snmpwalk of 192.168.1.101) to go through eth1

 Currently, I can access external sites fine

 Currently, I can not access any internal resources, receiving a Destination Host Unreachable error.

If anyone can help, I'd greatly appreciate it.

Thanks.

----------

## chiefbag

Try replacing your config for eth1 with the following.

```
config_eth1=( "192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" )
```

This should allow you to connect to anything on the 192.168.1.xx subnet and assign your ip to 192.168.1.1  :Wink: 

----------

## NeddySeagoon

Judg3,

Your net file is incorrect on several counts

```
routes_eth1=( "default via 192.168.1.1" ) 
```

First, you are only allowed a single default route.  If you have another subnet that you read via a router at 192.168.1.1, you would give that here.

Like my 

```
config_eth0="192.168.100.20/24 brd 192.168.100.255"

routes_eth0="default via 192.168.100.1

             192.168.10.0/24 via 192.168.100.1"
```

In your case, to reach hosts on the 192.168.1.100/24 subnet, no route is statement is required as you get 192.168.1.0 * 255.255.255.0 U 0 0 0 eth1 for free.

The extra default route in default 192.168.1.1 0.0.0.0 UG 1 0 0 eth1 is never used. Rules are applied for the top of the routing table down and the first match is applied. Thus it should work despite the error.

How is the system at 192.168.1.101 configured?

Note that when you do get this working the setup will not allow you to use raven as an internet gateway for hosts on 192.168.1.0/24

----------

## Judg3

So should my net file be:

 *Quote:*   

> 
> 
> config_eth0=( "173.8.xxx.xxx/29" )
> 
> routes_eth0=( "default via 173.8.xxx.xxx"
> ...

 

?

That's not working either - I can't even ping the gateway.

Machine at 101 is WeatherGoose environmental monitor. The whole reason for doing this thing is so I can snmpwalk the stuff on the intranet side of my lan.

----------

## chiefbag

Is this the product you are using? If so have you changed the default settings on it otherwise you will not be able to connect with the config you have for eth1.

```
config_eth1=( "192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255" ) 
```

WEATHERGOOSE-II USER MANUAL

Page 4

As shipped from the factory, the WeatherGoose-II is configured with the following default network settings:

IP ADDRESS:

192.168.123.123

SUBNET MASK:

255.255.255.0

DEFAULT GATEWAY:

192.168.123.1

If you have not changed the default settings on the WeatherGoose then set your eth1 config to the following.

```
config_eth1=( "192.168.123.100 netmask 255.255.255.0 broadcast 192.168.123.255" ) 
```

Then try connecting to 192.168.123.123.

Also if you are connecting directly to the WeatherGoose from your ethernet card you will need to use a crossover cable or else use second router that is not used to connect to your eth0 card or setup a VLAN if you have a managed switch.  :Wink: 

----------

## Judg3

Hey Chief, thats the device, but it's been configured correctly, I can access it's web page fine and all that.

So are you saying what I have set now should work? Because if so, then I bet its my network. It consists of a few routers, and I'm thinking things are mixed up a bit. So if it's supposed to work with the settings I have now, I'll go ahead and troubleshoot that bit if it  :Smile: 

Though I will admit I'm impressed with how you went above and beyond the norm to help me troubleshoot this. Is there a favorite charity you like?

----------

## chiefbag

@Judg3

All donations are graciously accepted  :Very Happy: 

----------

## NeddySeagoon

Judg3,

Setting 

```
config_eth1=( "192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255" ) 
```

allows you to talk to everything in the 192.168.1.0/24 network without a gateway, so you don't need a routes setting for that network.

```
routes_eth0=( "default via 173.8.xxx.xxx"

"192.168.1.0/24 via 192.168.1.1" ) 
```

will have confused the kernel as you gave eth1 an address in the 192.168.1.0/24 network but added a route to 192.168.1.0/24 on eth0.  I suspect that sent your 192.168.1.0/24 packets out of eth0.

----------

