Solved

Enable Two network cards on CentOS 6.3

Posted on 2013-05-29
7
622 Views
Last Modified: 2013-07-14
I have a server running on CentOS 6.3 which have two network cards. I gave network ID to first network card -

10.10.28.181
255.255.255.0
10.10.28.1

Second network card -

172.164.1.181
255.255.255.0
172.164.1.100

First network card is used for accessing internet on server and Second network card is used for my INTRA-NET environment which i use for my internal LAN.

Problem is that only one network card is active at a time. When i want to surf internet i have to make active first  network card and when i want to work on my local LAN i have to make active second network card.

I want to make both cards active so that computers on my local LAN can access my server even when i am surfing the internet on server.

Thanx in advance.
0
Comment
Question by:edreamers
  • 4
  • 2
7 Comments
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 167 total points
ID: 39205632
You can only have 1 default gateway in every server, most likely you would need to remove 172.164.1.100 on the second network card.
0
 
LVL 23

Accepted Solution

by:
savone earned 333 total points
ID: 39205788
You can absolutely have both cards on at the same time, and they both can have gateway, but only one will work.

Can you post the output of the following commands:

cat /etc/sysconfig/network-scripts/ifcfg-eth*
0
 

Author Comment

by:edreamers
ID: 39212565
I attached the output of the above command Savone.
Untitled-1.doc
0
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:edreamers
ID: 39212567
As suggested by Mazdajai i removed 172.164.1.100 from the second network card. but now it shows 0.0.0.0 in gateway address.
0
 

Author Comment

by:edreamers
ID: 39212568
I worked on many Windows Server before, but windows server allows to add two different gateways and both network cards works simultaneously on two different networks. But in Linux I don't know who to achieve this.
0
 
LVL 23

Assisted Solution

by:savone
savone earned 333 total points
ID: 39212866
Ok so you have both gateways configured.  Here is the issue I think you are having.

The default gateway is the way out onto the network for the system.  You can ONLY have one DEFAULT on any computer that I know of.  Think about your default settings for any program.  Would it make sense to have two default settings?  How would it know which one to "default" to?  The word itself implies there will be only one or one set.

So here is what I am thinking, please correct me if I am wrong.

You surf the internet from the server on the 172. address.  When people connect from the  10. network they do not receive a response because the Linux server sends the information out on the "default gateway" which is to the wrong network.

What you need is called "source routing".  This means if traffic comes in on the 10. network it will go back out to the 10. network.  If it comes in from the 172. network, it will go out to the 172. network.

I hope I explained this effectively.

You can find an easy explanation on how to set this up here (look at the first answer):

http://unix.stackexchange.com/questions/22770/two-interfaces-two-addresses-two-gateways


You can read more about it here:

http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html
0
 

Author Comment

by:edreamers
ID: 39324313
I tried a lot but not able to succeed. So I am migrating to Windows Platform. Thanx everyone for their support.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Transparency shows that a company is the kind of business that it wants people to think it is.
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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