Link to home
Start Free TrialLog in
Avatar of kennmurrah
kennmurrahFlag for United States of America

asked on

routing question for second NIC

Greetings ....

I accepted the answer below prematurely ... it appeared to work when on the network (I can ping 66.162.219.248) but cannot reach it from the outside world when I got home last night ...

Anyway, in essence, my question is now this:  I can't get reach the second NIC when it's defined as 66.162.xxx.248 .... I've made the gateway suggestion below, but that didn't help ... is it a routing issue?  If so, how do I resolve it?

Thanks in advance.

HERE'S THE ORIGINAL QUESTION/ANSWER:

Greetings.

When I Debian Linux, it gave me an option of eth0 or eth1, so I know it could see both NICs ... I chose to use eth0 for my internal network, using 192.168.100.43 ...now need to use the second NIC for an external IP of 66.162.xxx.248 .... I've modified /etc/network/interfaces as shown below, but of course, it still doesn't work ... what else do I need to do?

Thanks in advance for the help.

here's /etc/network/interfaces:


auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.100.43
        netmask 255.255.255.0
        network 192.168.100.0
        broadcast 192.168.100.255
        gateway 192.168.100.42
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 206.124.64.253 206.124.65.253
        dns-search usseryprinting.com

auto eth1
iface eth1 inet static
        address 66.162.xxx.248
        netmask 255.255.255.0

Send to a Friend    Printer Friendly       
See Solution
            
      
Accepted Answer from pablouruguay
Date: 10/30/2006 01:21PM PST
Grade: A
      Accepted Answer       

you need the gateway
 gateway 66.162.xxx.1 for example

and dns if you want.
Avatar of ravenpl
ravenpl
Flag of Poland image

#/etc/network/interfaces propsed content
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.100.43
        netmask 255.255.255.0
        network 192.168.100.0
        broadcast 192.168.100.255
        # gateway 192.168.100.42 # no default gateway on local network, the default gw is rather on external ip ?
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 206.124.64.253 206.124.65.253
        dns-search usseryprinting.com

auto eth1
iface eth1 inet static
        address 66.162.xxx.248
        netmask 255.255.255.0 # surely whole 256 IP network? Usually it's smaller like 4ips.
        gateway 66.162.xxx.24? # what the ISP told You?

Or You need multi-route host(ie.on the LAN there is another box 192.168.100.42 which also has two NICs - one with external IP)?
Avatar of kennmurrah

ASKER

Ravenpl:

The gateway 192.168.100.42 is the internal address of the router

The 66.162.xxx.248 is one of the IPs provided to me by my ISP ...

The gateway 66.162.219.248 is the external IP of the router ...

Until yesterday, I did not have a gateway on eth1 ... I added that at the suggstion of someone, and it seemed to work, but I was wrong.

In a nutshell:  I have one eth0 with an address on my network and eth1 with a real-world address ... not sure what the netmask should be -- i have all the IPs between 66.162.219.xxx.241 and 66.162.219.xxx.252 ...
i mistyped ... the external IP of the router is 66.162.xxx.241  (not that that's relevent)
I need to understand the network layout. So your net is like
internet --switch1-- [66.x.x.241]router[192.168.100.42] --switch2-- LAN
and Your box is is placed in LAN? Where ae plugged Your eth0 and eth1? Why(what for) Your box have two NICs?
internet --[66.x.x.241]router[192.168.100.42] --switch-- LAN ... that is, internet to router to switch ....

linux box is in LAN .. has two NICs eth0 (192.168.100.43) and eth1 (66.xxx.xxx.248) ... was hoping to gain performance by using two NICs but not sure that will be the result ... open to all suggestions, obviously.

> linux box is in LAN
so both cards are plugged in same switch? If so - You can't assign external IP to internal NIC (no matter eth0 or eth1 - both are internal)
> was hoping to gain performance
Maybe You wanted bound those two eth0/eth1 into one logical device bumping the network speed twice?
If so http://www.google.com/search?q=linux+bonding+howto&lr=
but note, that to run bonding in balance-rr mode(doubles speed on single connection) You need switch support for links aggregation.

Maybe You wanted to be able to reach the box from internet directly? Not possible.
But on the router You may configure some port forwarding from outside IP:port to inside IP:port - hence it has to be done on the router. No need for two NIC cards.

So the question is: why You need two NICs?
Avatar of Kerem ERSOY
Kerem ERSOY

Hi,

First of all it is comon to have a Default Gateway. The default gateway is the interface where you forward packets to reach any host outside of your network. So if you don't have default gateway you caan only ping up to the your gateways external interface LAN segment. Because beyond this point your linux box will have no idea how to send your packets.

To see what is wong lets go step by step.

- First try to ping internal interface of your linux box from any host attached to your internal LAN.
  (when it works we will know that your LAN is operationa art least between these two nodes). Because I am not sure your 2 interface combination works.As per ravenpl's notes there might be problems with your conenction.
- Then try to ping external interface of your Linux box from a system in your LAN. That is 66.x.x.241
  (If it works it will show that routing is enabled in your linux box.)

Alos will you post your:
netstat -rn
output.
ASKER CERTIFIED SOLUTION
Avatar of scstanton1337
scstanton1337

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial