LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   2 NIC configuration (https://www.linuxquestions.org/questions/linux-server-73/2-nic-configuration-923565/)

sekarlinux 01-13-2012 04:26 AM

2 NIC configuration
 
Hi I have 2 NIC in my linux box. I have assigned to 10.0.0.10 for eth0 and 10.0.0.11 to eth1
and the gateway for both NIC's is 10.0.0.1

But i after adding the route for second NIC's , i could ping from another machine to 10.0.0.11 . But i could not ping the first IP 10.0.0.10

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 10.0.0.1 255.255.255.0 UG 0 0 0 eth1
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0

Thanks in advance,

acid_kewpie 01-13-2012 07:32 AM

do NOT put two nics on the same subnet, that is wrong wrong wrong wrong wrong. it is possible to join two nics on the same subnet using a bridge interface, but just unaware of each other, bad idea.

Maybe you'd like to back up and explain WHY you want to do this? If it's just to put two IP's on there, you can easily alias a single interface.

TenTenths 01-13-2012 07:48 AM

Can also use bonding to provide active/passive resilliance or if you have suitable switches you can use active/active for increased throughput.

acid_kewpie 01-13-2012 08:04 AM

Quote:

Originally Posted by TenTenths (Post 4573569)
Can also use bonding to provide active/passive resilliance or if you have suitable switches you can use active/active for increased throughput.

oh, yes. good pint. Do NOT confuse bridging and bonding, they are NOT interchangeable! Either might be right in this scenario, but it will depend on the network there as to which is right and which is wrong!

sscn 01-16-2012 09:33 AM

Is my setting OK?
 
Quote:

Originally Posted by acid_kewpie (Post 4573563)
do NOT put two nics on the same subnet, that is wrong wrong wrong wrong wrong. it is possible to join two nics on the same subnet using a bridge interface, but just unaware of each other, bad idea.

Maybe you'd like to back up and explain WHY you want to do this? If it's just to put two IP's on there, you can easily alias a single interface.

Hi, I also have one NIC Puzzle but don't know whether it is the same reason with the originator. There are 2 NIC in my PC and I configure their IP as 128.1.8.2 and another 10.5.2.11. The first IP is in office network but the second IP is in one local static network with a switch. I would like to log in the PC from my laptop with IP 128.1.8.3. However, I notice that it would be very slow via ssh like putty if the second NIC 10.5.2.11 is active. Once I disable it by ifconfig eth2 down, putty can log in the PC very fast.

2 NIC gateway are different but use the same submask as 255.255.255.0.

What the issue might be?

Thanks a lot in advance.

acid_kewpie 01-16-2012 12:07 PM

please start a new thread if you have your own questions.

GetLinux 01-16-2012 04:14 PM

Not a huge problem with this, but ideally you set the routing table to treat both interfaces as a gateway to 10.0.0.1 and 10.0.0.0/24

Also if you're playing with VLANS they have to be on the same VLAN.


If you're looking for redundant interfaces you can do port channels, see your switch documentation to see if it's supported. Otherwise if your router supports it, you can do two subnets on the same interface with Cisco that's the secondary ip command. So you can have 10.0.0.0/24 and 10.0.1.0/24 and assign an ip between those two subnets.

acid_kewpie 01-17-2012 02:58 AM

Quote:

Originally Posted by GetLinux (Post 4576245)
Not a huge problem with this, but ideally you set the routing table to treat both interfaces as a gateway to 10.0.0.1 and 10.0.0.0/24

Also if you're playing with VLANS they have to be on the same VLAN.


If you're looking for redundant interfaces you can do port channels, see your switch documentation to see if it's supported. Otherwise if your router supports it, you can do two subnets on the same interface with Cisco that's the secondary ip command. So you can have 10.0.0.0/24 and 10.0.1.0/24 and assign an ip between those two subnets.

the bonding module (port channeling) supports plenty of modes outside of 802.3ad, so there's no *need* to have a capable switch to have HA. I would never see the need to consider multiple subnets for any HA related reason.


All times are GMT -5. The time now is 09:17 PM.