Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 NICs

Status
Not open for further replies.

nguy101

Technical User
Jan 4, 2009
4
CA
Hi everyone,

I have looked at the other threads for my answer but I think my situation is a bit different.

One NIC to be connected to one switch(subnet) and the other NIC to another switch(subnet).

Both subnets are in our internal network and can send packets outside of our network, but hosts on one subnet cannot directly communicate with hosts on another subnet. Each subnet is on its own ISP as you may have guessed.

Basically, apache web server will be used alongside a monitoring system. I want to be able to access the webserver(network monitoring web interface) in one subnet and have the monitoring system monitor the other subnet.

Any suggestions or pointers? I know roughly what to do (setting one NIC card as dynamic IP and the other as static and use the "route" command to bridge the two NICs) but if anyone has done this before I would really appreciate it if you could give me approximate configuration directions.

Thanks for any help!
 
1) Be sure which ever is NOT going to the internet, (the staic IP) has no default gateway.
2) I have never had to use a route command

I tried to remain child-like, all I acheived was childish.
 
Thanks a lot for your quick reply.

More detailed explanation: (don't have to read this just go down to "Simplified explanation")

(Both subnets can ping to the internet, both have default gateways. The only difference is that one subnet is used for specific applications + internet access, the other is just internet access. (ie: two ISP's) Reason for two is simply bandwidth availability.

NIC 1 connects to the 10 dot network. Any packets destined to the 10 dot network from NIC 2 (where the monitoring system is on) should be routed through NIC 1. This NIC can have static IP configuration or dynamic IP configuration. The switch ports are already pre-configured with static IP's so I'll use one of those.

NIC 2 would simply be used for the internet on the 192 network. But also, in addition to also be able to connect to the Networking monitoring system (which runs over Apache2) through the web interface thus NIC 2 should have static IP config.)

ISP 1-R1----- switch 1 (10 dot) ------ NIC 1 (eth0)

ISP 2-R2 ----- switch 2 (192 dot) ------ NIC 2 (eth1)

Simplified explanation:

192 network is used to connect to the internet as well as to the "web server" (which runs on top of the network monitoring system) (NIC 2) using static IP configuration and can be only accessed through the internal network (thus no port forwarding is needed here).

To be able to monitor the 10 dot network packets destined to 10 dot network from NIC 2 (where monitoring system is on) should be forwarded out NIC 1 to monitor internal as well as external hosts.


Any help would be appreciated. In this case I really did think that you'd have to "bridge" the NIC's.

Thanks again in advance!

 
(here is the setup I'm going for)

internet access internal HOSTS
| | | |
ISP 1-R1----- switch 1 (10 dot) ------ NIC 1 (eth0)
|
|
internet access |
| |
ISP 2-R2 ----- switch 2 (192 dot) ------ NIC 2 (eth1)
| | |
internal HOSTS + Monitoring system (apache)

*packets destined to the 10 dot network from NIC 2 should be forwarded to NIC 1 for monitoring. External hosts with public IPs can be "checked" with NIC 2 (it doesn't really matter for external hosts since packets get sent outside the network either way)

Hope this visual example will help in explaining my situation.

 
Actually, I figured it out. My problem was that I made it more complicated then it really is. All was needed was 2 IP static configurations on each NIC, one with no DG (like jimbopalmer said). Basically needed to configure /etc/network/interfaces.

Now when packets are destined to the 10 dot subnet they will simply be forwarded out the correct interface, all other packets will go to the other NIC and which if the destination is not in the subnet it will be passed to the default gateway...I guess the kernel does the work as usual.

No static routes or routing protocol needed, no "route" commands none of that.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top