Solved

Enable Two network cards on CentOS 6.3

Posted on 2013-05-29
7
589 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
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

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
Is your computer hacked? learn how to detect and delete malware in your PC
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

760 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

17 Experts available now in Live!

Get 1:1 Help Now