Solved

Enable Two network cards on CentOS 6.3

Posted on 2013-05-29
7
601 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
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…
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.:

895 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

14 Experts available now in Live!

Get 1:1 Help Now