Enabling two network interfaces

I'm trying to use two network interfaces in my Linux machine. At this point i'v already setup both interfaces. But i have 2 problems:
1) The eth1 is not initialized when the machine boot. I'v to enable it manually.

2) When both interfaces are connected (i mean phisycal connection) i can ping or telnet to any of the interfaces. But if i unplugged the eth0 then i lost any communication with the network. I have to set down eth0 and then i can ping or telnet to eth1 again. What can be wrong? My network is 132.147.160.0, eth0=132.147.160.18, and eth1=132.147.160.19

Thanks very much,
Pitagoras
pitagorasAsked:
Who is Participating?
 
BlackDiamondConnect With a Mentor Commented:
I'll assume that you are using RedHat.  If not, let me know (this is pretty similar in any case).

1.
  copy /etc/sysconfig/network-scripts/ifcfg-eth0 to /etc/sysconfig/network-scripts/ifcfg-eth1 ...  The edit the ifcfg-eth1 file and change the DEVICE to "eth1" and the IPADDR to "132.147.160.19"

2.
  This sounds like you set the 2nd ip address for a virtual instead of a physical interface.  The above should solve that problem for you.  If in fact it is set as a virtual interface, and you run "ifconfig" you would see interfaces like "eth0", "eth0:1", and "lo".  If it is actually defined as a physical interface, you would see "eth0", "eth1", and "lo".

Let us know what ifconfig looks like, but I think #1 will solve your problems.

Cheers,
BD
0
 
jlevieCommented:
What are you trying to accomplish with two NIC's configured to be on the same network?

If you expect to double the bandwidth you'll be sorely disappointed as Linux networking doesn't work that way. And the way it works is why network connectivity is lost when you unplug eth0. When you have two NIC's in a system configured for two different IP's on the same network Linux will use the first NIC to for all traffic. Even if a a packet is received on the second interface the reply will be sent back out the first interface. So when you disconnect eth0 the network is down as far as the OS is concerned. Then when you ifconfig eth0 down, the system notices that and sees that eth1 is available and uses it.
0
 
BlackDiamondCommented:
Yikes, I didn't even notice that. :->  Nice catch jlevie.  You would have to use a virtual interface for this to work...
0
 
pitagorasAuthor Commented:
OK jlevie, now is clear for me, Thanks. I'm not expecting to double my bandwidth, but learning about Linux networking. I want to setup my Linux as a gateway but before go into subnets and all that stuff i'd just want to test both interfaces in the same network. Thank you again.

BD, your answer works and now both interfaces are initializaed at boot. Thank you.

Regards.
Pitagoras
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.