Solved

routing question for second NIC

Posted on 2006-10-31
9
284 Views
Last Modified: 2010-03-18
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.
0
Comment
Question by:kennmurrah
9 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 17842896
#/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)?
0
 

Author Comment

by:kennmurrah
ID: 17843011
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 ...
0
 

Author Comment

by:kennmurrah
ID: 17843072
i mistyped ... the external IP of the router is 66.162.xxx.241  (not that that's relevent)
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17843483
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?
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:kennmurrah
ID: 17843650
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.

0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17843832
> 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?
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 17847233
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.
0
 
LVL 1

Accepted Solution

by:
scstanton1337 earned 500 total points
ID: 17850488
kennmurrah,

  There are two ways to look at the issue - one is routing from your Linux box, and the other is from the physical network layout.

  First, the assumption is that you have connected your linux eth1 to the physical segment (switch or hub) that also connects to the Internet side of your LAN router.  If you have a cable/dsl modem, then you'd need the ethernet output from the cable/dsl modem to go into a switch/hub.  This would be connected to your LAN router, and your eth1 interface would also connect here.  This puts your eth1 interface directly on the 66.162.x.x segment (which physically resides between your ISP device and your LAN router.)  Now, on the inside interface of your LAN router is your 192.168.x.x network, and that's where your eth0 should be connected.

  Assuming that the network is connected the way I described, by using the default gateway configuration mentioned by ravenpl above will allow your Linux box to be reachable from the Internet.  Keep in mind you should be running a firewall on the Linux system since your LAN router no longer protects it on the eth1 interface, so you'll need to open up inbound access to ping, ssh, etc. for whatever you want to do.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Multicast - Linux 4 22
Fail2ban says an IP is banned, but not 12 107
Linux DNS problems 23 255
centos7 firewalld udp ports 33 57
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now