Issue with ethernet interface

hello,
I have a Linux server with two interfaces eth0 and eth1. I configured two IP addresses from two different networks on 2 interfaces, and I connected both interfaces on two different switches.
the IP address of eth0 is responding without problem to ping from equipment of its home network, unfortunately this is not the case for the IP address of eth1. a moment I thought the problem was on the switch, but when I try to connect another device on the same switch port, this device can communicate with others on the same network. LEDs are lit, but impoosible to ping the IP address of eth1.
suddenly I thought to myself that maybe the problem come from the IP configuration on the interface eth1, or within the system that I do not control too.
well, I have to ask you for help to solve this problem.

thank you in advance for any contribution

Can you post the output of iproute2 for both NICs? (or ifconfig)

please find below:

# ifconfig
eth0      Link encap:Ethernet  HWaddr BC:30:5B:DD:74:85  
          inet addr:10.10.136.10  Bcast:10.10.136.63  Mask:255.255.255.192
          inet6 addr: fe80::be30:5bff:fedd:7485/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:958930034 errors:0 dropped:0 overruns:0 frame:0
          TX packets:908460231 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3502945506 (3.2 GiB)  TX bytes:1823145506 (1.6 GiB)
          Interrupt:122 Memory:d6000000-d6012800 

eth2      Link encap:Ethernet  HWaddr BC:30:5B:DD:74:89  
          inet addr:10.6.0.50  Bcast:10.6.0.63  Mask:255.255.255.192
          inet6 addr: fe80::be30:5bff:fedd:7489/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:41045618 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43175495 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1277189174 (1.1 GiB)  TX bytes:3964630437 (3.6 GiB)
          Interrupt:138 Memory:da000000-da012800 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:305799777 errors:0 dropped:0 overruns:0 frame:0
          TX packets:305799777 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1118219267 (1.0 GiB)  TX bytes:1118219267 (1.0 GiB)

w1g1      Link encap:Point-to-Point Protocol  
          UP POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:2403556724 errors:0 dropped:0 overruns:360 frame:360
          TX packets:361120954 errors:0 dropped:0 overruns:941 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:3423030701 (3.1 GiB)  TX bytes:1559940032 (1.4 GiB)
          Interrupt:177 Memory:f90c0000-f90c1fff 
# 

Well, there is no eth1. All the other NICs have traffic shown for RX and TX. If you are talking about eth2, have you checked the routing settings or do you ping from the same network?

yes it's eth2, and I ping from the same network (10.6.0.0)

What is the IP of the system you are pinging the server with?

Very basic but missing information: have you correctly set their hostnames in /etc/hosts , that must be different if you dont want serious issues and each interface should have their correct GW set also... or were you just testing using IP which would not change the fact that each Network should have its correct default gateway...

i'm pinging with the address 10.6.0.33

---------- Post updated at 11:38 AM ---------- Previous update was at 11:26 AM ----------

hi vbe,
sorry but i'm not understanding well what are you saying.
do you think that there is some configurations to do in the file /etc/hosts ? here is the current content of this file:

#cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
10.10.136.10    sigserv01
10.6.0.50          sigsrv01
# 

also, as the server is in the same network that the machine from which i'm pinging it, is it necessary to check the GW ?

Can you show us the output from:-

netstat -rn

Thanks,
Robin

Since you are using the IP only there is no need to modify /etc/hosts... Each interface should normally have a default gateway set...

please find the netstat ouput:

[root@sigsrv01 ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.10.128.49    10.10.136.1     255.255.255.255 UGH       0 0          0 eth0
10.10.135.10    10.10.136.1     255.255.255.255 UGH       0 0          0 eth0
10.6.0.0        0.0.0.0         255.255.255.192 U         0 0          0 eth2
10.10.136.0     0.0.0.0         255.255.255.192 U         0 0          0 eth0
0.0.0.0         10.10.136.2     0.0.0.0         UG        0 0          0 eth0
[root@sigsrv01 ~]# 

You have a mask of 255.255.255.255 on the top two rows, which seems a little odd to me.

So are your subnets:-

  • 10.10.126.0-63 routing via 10.10.136.2 on eth0
  • 10.6.0.0-63.......no routing from eth2

It would suggest that if you should be able to ping addresses 10.6.0.0-63 from your server but not beyond. Is there a route via 10.10.136.2 back across to 10.6..x.x? If not then your eth2 does not know how to respond.

I'm on RHEL 6.3 (you don't say, or I've missed it) but have a look in /etc/sysconfig/network-scripts/ifcfg-eth0 and eth1 if you have them.

Be careful if you make backup copies in the same directory as the process to set them up at boot time will read all files called ifcfg-* We found this out by 'experience', i.e. a big mess that took us a while to work out. :o

Robin

hi rbatte1,
if there is an error in my routing table, could you please tell me how can I configure it, so that my server be able to communicate with the other equipments in the same network 10.6.x.x via eth2 ?

PFB

[root@sigsrv01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth2
BOOTPROTO=none
HWADDR=BC:30:5B : DD:74:89
ONBOOT=yes
HOTPLUG=no
TYPE=Ethernet
NETMASK=255.255.255.192
IPADDR=10.6.0.50
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@sigsrv01 ~]# 

Do you know the gateway address for the 10.6.0.x range? It will have to be between zero and 63 with that netmask.

Have a look at the file ifcfg-eth0 or ifcfg-eth1 and you will see the difference. When you do, add a line in ifcfg-eth2 like this:-

GATEWAY=10.6.0.gw

.... and restart the ethernet card:-

ifdown eth2
ifup eth2

As you will notice, this will cut access whilst you do it. Make sure you are connected to either the console, or the other network card.

Robin

hi rbatte1,
once again thank you for your support.
what I do not understand in fact, it is the fact that I need to add a gateway for the network 10.6.0.0/26. As eth2 (10.6.0.50), is in the network 10.6.0.0 and the other equipment (10.6.0.33), is also in the same network, then what is the reason to add a gateway between them to communicate? I'm sorry but I still do not understand why the gateway is necessary in this case. if you can provide me more clarifications, it will help me a lot.
please find below ifcfg for eth0 and eth2:

cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=none
HWADDR=BC:30:5B:DD:74:85
ONBOOT=yes
NETMASK=255.255.255.192
IPADDR=10.10.136.10
GATEWAY=10.10.136.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

[root@sigsrv01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth2
BOOTPROTO=none
HWADDR=BC:30:5B:DD:74:89
ONBOOT=yes
HOTPLUG=no
TYPE=Ethernet
NETMASK=255.255.255.192
IPADDR=10.6.0.50
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@sigsrv01 ~]#

I notify that there is a gateway in the network 10.10.136.0 to permit my server to comunicate with the other network differents of the network 10.6.0.0 and network 10.10.136.0

regards

Because as I already told you each interface unless they are on same network need their default getaway�
If its too difficult for you to understand, then do this: Give the correct GW to your Eth2 and remove the GW from Eth0, now you tell us what is working
What do you conclude?

We have a terminology problem here. There must be (in general) one gateway per interface. However, there should only be a single default gateway. If there is only one interface and therefore only one gateway it will be the default gateway. If you have several interfaces with several gateways, you must anoint one as the default gateway by putting it in /etc/sysconfig/network. Meanwhile every interface must have its own gateway defined in the interface script.

cerco, suppose that you got your system to work with a single gateway. And assume that from some distant IP address I ping your box on the IP address on eth2. How do you respond? You can't send a packet out eth2, it doesn't know how to reach me (no gateway). Do you send the packet out eth0 to the only gateway you know? What to use for the source IP address? Do I ping one IP address and get and response from a different IP?

**edit**
I have some more time after all... my meeting just got canceled :slight_smile:

So if you try to reach some distant IP address, with your setup, the default gateway will tell you which interface to use. But if you have decided to use the second interface, you need some gateway for it. If there are just a few hosts that you talk to on the second interface and they are all on the same subnet as your interface you should be ok with no gateway. But that does not seem like what you have.

If the system is using dynamic routing which means that gated is running you can dynamically switch default gateways. This allows the router (which is what your system would be at this point) to adapt to network outages and exploit redunant routes.

ok i'll be very simple. my situation is exactly like this:
I have 3 hosts with below configs:
Host A:
eth0: 10.10.136.10 255.255.255.192 gw 10.10.136.1
eth2: 10.6.0.50 255.255.255.192 no gateway

Host B:
eth0: 10.9.3.2 255.255.255.248 gw 10.9.3.1
eth2: 10.6.0.40 255.255.255.192 no gateway

Host C :
eth0: 10.6.0.33 255.255.255.192 no gateway

the interfaces eth2 (host A), eth2 (host B) and eth0 (host C), are connected on the same switch (network 10.6.0.0/26)

B is communicating with C without problem (pings are working fine), but it's impossible for A to communicate with C (pings are not working), and with B.

so my problem is, how to do so that A be able to ping B and C.
do you think that in this case it's necessary to configure a gateway from A to permit him to ping B and C? if yes, what IP must I configure for this gateway, as the 3 interfaces (A-eth2, B-eth2 and C-eth0), are already on the same network 10.6.0.0

hope my explanations are clearer this time, so that you can help me easly.

Based on what you just posted, those 10.6.0.0/26 adresses should be able to communicate with each other without using a gateway. If they aren't it must be either the routing tables or the configuration of the switch. Are the 10.6.0.0/26 ports all on the same vlan? Try switching the cables between hosta and hostb.

Are you pinging 10.6.0.0/26 IP addreses rather than hostnames? Try traceroute to be sure the working system is working the way you think it is.

all ports on the switch are in the same vlan and these ports are working fine. when I try to deconnect hostA from switch and replace it by hostB on the same port, hostB can communicate with hostC (pings are working fine). so i think that the issue come from hostA network config.
I'm pinging IP address and not hostnames

below is the traceroute from A to C:

[root@sigsrv01 ~]# traceroute 10.6.0.33
traceroute to 10.6.0.33 (10.6.0.33), 30 hops max, 40 byte packets
 1  sigsrv01 (10.6.0.50)  3002.150 ms !H  3002.143 ms !H  3002.133 ms !H
[root@sigsrv01 ~]#