Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dual NIC configuration question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Judg3
n00b
n00b


Joined: 22 Feb 2005
Posts: 6

PostPosted: Wed Feb 23, 2011 8:47 pm    Post subject: Dual NIC configuration question Reply with quote

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
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4732 errors:0 dropped:0 overruns:0 frame:0
TX packets:2671 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:781498 (763.1 KiB) TX bytes:355416 (347.0 KiB)
Interrupt:16

eth1 Link encap:Ethernet HWaddr 00:1c:f0:d5:72:11
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21c:f0ff:fed5:7211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:940032486 errors:0 dropped:0 overruns:0 frame:0
TX packets:261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:56514274938 (52.6 GiB) TX bytes:16514 (16.1 KiB)
Interrupt:16 Base address:0xdc00



Contents of /etc/conf.d/net:
Quote:

config_eth0=( "173.8.xxx.xxx/29" )
routes_eth0=( "default via 173.8.xxx.xxx" )
config_eth1=( "192.168.1.100/24" )
routes_eth1=( "default via 192.168.1.1" )


Current routing table (using 'route'):
Quote:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
173-8-xxx-xxx-Mi * 255.255.255.248 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
loopback * 255.0.0.0 U 0 0 0 lo
default 173-8-xxx-xxx-Mi 0.0.0.0 UG 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 1 0 0 eth1



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

raven ~ # ping google.com
PING google.com (74.125.225.18) 56(84) bytes of data.
64 bytes from 74.125.225.18: icmp_req=1 ttl=55 time=20.7 ms
64 bytes from 74.125.225.18: icmp_req=2 ttl=55 time=18.9 ms
64 bytes from 74.125.225.18: icmp_req=3 ttl=55 time=17.8 ms
64 bytes from 74.125.225.18: icmp_req=4 ttl=55 time=19.5 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3011ms
rtt min/avg/max/mdev = 17.876/19.281/20.718/1.040 ms
raven ~ # ping 192.168.1.101
PING 192.168.1.101 (192.168.1.101) 56(84) bytes of data.
From 192.168.1.100 icmp_seq=1 Destination Host Unreachable
From 192.168.1.100 icmp_seq=2 Destination Host Unreachable
From 192.168.1.100 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.1.101 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4053ms



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.
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Wed Feb 23, 2011 8:59 pm    Post subject: Reply with quote

Try replacing your config for eth1 with the following.

Code:
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:
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46339
Location: 56N 3W

PostPosted: Wed Feb 23, 2011 9:03 pm    Post subject: Reply with quote

Judg3,

Your net file is incorrect on several counts
Code:
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
Code:
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
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Judg3
n00b
n00b


Joined: 22 Feb 2005
Posts: 6

PostPosted: Thu Feb 24, 2011 1:35 am    Post subject: Reply with quote

So should my net file be:

Quote:

config_eth0=( "173.8.xxx.xxx/29" )
routes_eth0=( "default via 173.8.xxx.xxx"
"192.168.1.0/24 via 192.168.1.1" )
config_eth1=( "192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255" )


?
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.
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Thu Feb 24, 2011 9:23 am    Post subject: Reply with quote

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.

Code:
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.

Code:
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:
Back to top
View user's profile Send private message
Judg3
n00b
n00b


Joined: 22 Feb 2005
Posts: 6

PostPosted: Thu Feb 24, 2011 4:23 pm    Post subject: Reply with quote

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 :)

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?
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Thu Feb 24, 2011 4:58 pm    Post subject: Reply with quote

@Judg3

All donations are graciously accepted :D
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46339
Location: 56N 3W

PostPosted: Thu Feb 24, 2011 8:02 pm    Post subject: Reply with quote

Judg3,

Setting
Code:
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.

Code:
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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum