LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-11-2007, 08:46 AM   #1
tiger.woods
Member
 
Registered: Mar 2006
Posts: 122

Rep: Reputation: 15
Adding 2nd NIC diff subnet - looking for how to?


I'm trying to get a second NIC going in my Ubuntu server. I had installed the card and set the IP, etc. unfortunately I must have done it incorrectly. Even though both cards were enabled I was only able to use either or but not both at the same time.

Hopefully someone can help with the following questions:
1) What is the correct way to install multiple NIC's for different subnets in a single Linux machine? I realize this is all encompasing but I'm not sure how to break it up into smaller pieces.
2) If you create a virtual IP on a Linux Machine as opposed to a second NIC I'm assuming it can only listen on the subnet in which the actual non-virtual IP is established?
3) How do you deal with DNS, gateway and host entry's and the like? Does someone have an example of what those items would look like?
TIA for any information you can provide.

PHP Code:
<>
           +-------------------------------+
           |                               |
           |        
I N T E R N E T        |
           |                               |
           +-------------------------------+
                            |
                            |
Internet
                            
|staticIP
                      
+-----------+               +-----------+
                      |  
Router1  |               | Linux     |
                      |   
NAT1    |               | server    |
                      +-----------+      
private1 |           |
        
private1_IP      |    |          staticIP eth0      |
        +----------------+    +------------------ | 
www       |
        |                                         | 
ssl       |
        
v                                         dns       |
 +-------------+                                  |           |
 |   
Router2   |                                  |           |
 |    
NAT2     |                                  |           |
 |    
DHCP     |                                  |           |
 +-------------+                         
private2 |           |
  |  |  |  |  |                          
staticIP eth1      |
  |  |  |  |  +---------------------------------- |           |
  |  |  |  |                                      |           |
  |  |  |  |                                      |           |
  |  |  |  |                                      +-----------+
  
V  V  V  V                                 
  internal LAN 
TW,

Last edited by tiger.woods; 04-11-2007 at 10:08 AM.
 
Old 04-11-2007, 11:05 AM   #2
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
I will give kind of a simple answer.

Yes you can have 2 nics and 2 subnets no problem. Remember you can only have 1 gateway and you need to add some routes to get it to do what you want. If you want both networks to talk to eachother, then you can enable ip forwarding and then it should work.

At home I have a little network. I have a 192.168.1.0 and a 10.10.1.0 network. I am able to go from either side to the other side just by adding routes and ip forwarding. I also block some stuff from going from network to network also for security purposes. it's pretty easy once you get the hang of it
 
Old 04-11-2007, 02:55 PM   #3
tiger.woods
Member
 
Registered: Mar 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Thanks for the reply.

So, what's the norm with a setup such as this? Do people just ssh or use VNC into the Server?

Quote:
Remember you can only have 1 gateway...
So you would just not enter Gateway info for one card correct... basically the local LAN card would be my guess. I assume that is because they are on 2 different subnets?

I'm not familiar with setting up routes, do you have an example or some reference I could use.

Thanks,
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding 2nd NIC for LAN EgoX Linux - Networking 8 02-13-2006 08:45 PM
Adding 2nd NIC to FC4 Machine lucktsm Linux - Networking 3 01-07-2006 08:12 PM
Linux to Win share; diff. subnet; thru firewall - not quite there KDoc Linux - Networking 0 08-10-2005 01:59 AM
Installed 2nd BCM5700 NIC, when Pinging on this subnet receive destination host unrea timhe Linux - Networking 2 05-12-2004 09:52 AM
Problem with adding a 2nd NIC to RH 7.0 IHawk Linux - Networking 0 02-18-2001 09:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration