• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“iscsiadm” Discovery TimeOut With Two Or More Network Interfaces in CentOS/RHEL

by admin

The Problem

iscsiadm discovery times out when both the interfaces are up, but it works fine with single interface up.

# iscsiadm -m discovery -t st -p x.x.x.x
iscsiadm: connect to x.x.x.x timed out
iscsiadm: connect to x.x.x.x timed out

The Solution

This issue could occur when two or more Ethernet interfaces are connected to the same subnet or when iSCSI connection is configured to use any specific interface. In such cases when packets are delivered to the wrong interface then the OS will think it is sent to closed port or wrong destination and times out. In order to resolve this issue, we need to configure to accept asymmetrically routed packets on both interfaces of iSCSI client on which we are getting this error message:

1. Set sysctl’s net.ipv4.conf.all.arp_ignore to 1 to force each interface to only answer ARP requests for its own addresses. Or set net.ipv4.conf.[INTERFACE].arp_ignore to 1 for each interface that is a path to the iscsi storage.

For example, in /etc/sysctl.conf:

# vi /etc/sysctl.conf
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.all.arp_ignore=1
net.ipv4.conf.all.arp_announce=2

Or, to only set it for the relevant interfaces (assuming they are eth0 and eth1):

# vi /etc/sysctl.conf
net.ipv4.conf.eth0.rp_filter=0
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.eth0.arp_announce=2
net.ipv4.conf.eth1.rp_filter=0
net.ipv4.conf.eth1.arp_ignore = 1
net.ipv4.conf.eth1.arp_announce=2

2. Apply the setting using the below command:

# sysctl -p /etc/sysctl.conf

3. Check if the new settings applied successfully running:

# sysctl -a

4. Now, remove old files from /var/lib/iscsi/ifaces:

# rm -rf /var/lib/iscsi/ifaces

This should resolve iscsi discovery timeout when two interfaces are configured.

For CentOS/RHEL 7

Note that if the system is having CentOS/RHEL 7 installed, then please enter above sysctl parameters in /etc/sysctl.d/99-sysctl.conf file and then run below command to reread the settings from configuration file:

# sysctl --system

Notes

This problem can occur if an iSCSI connection is configured to use a specific network interface. If iscsi packets are delivered to the wrong interface, Linux will respond as if the data was sent to a closed port and send an RST packet. As long as the received data is coming in the wrong interface, the connection will remain broken and cannot be restored.

This can occur when multiple adapters are connected to the same subnet. By default, Linux will answer all ARP requests for any of the system’s IP addresses regardless of which interface the ARP request came from. If a different interface answers the ARP request for the iscsi connection’s IP address, traffic will be routed to the wrong interface and the connection will fail. Turning on arp_ignore forces a network interface to only answer ARP requests for its own addresses. This prevents the ARP answer from the wrong interface and keeps the iscsi connection functioning.

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. namcap: command not found
  2. Slow SSH login due to unreachable rsyslog server
  3. openvpn3 Command Examples
  4. pvremove Command Examples in Linux
  5. How to Configure Multiple MySQL Servers On One System Using mysqld_multi
  6. mkfs.fat Command Examples in Linux
  7. Installing CentOS / RHEL 7 (step by step with screen shots)
  8. Ubuntu: Changing the stripe size of a striped LVM volume
  9. mate-screenshot Command Examples in Linux
  10. Beginners Guide to Automounting File Systems in CentOS / RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright