Solved

Enable Two network cards on CentOS 6.3

Posted on 2013-05-29
7
630 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RHEL7 - Error installing docker compose 2 217
Apache LDAP Authentication 20 72
NTPD Client Port Usage 12 94
database connection error mysql stops 7 82
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Is your computer hacked? learn how to detect and delete malware in your PC
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

738 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