11 Replies Latest reply: Mar 15, 2013 2:33 PM by 946717 RSS

    can not ssh to the system via one of two interfaces

    946717
      I have two interfaces eth1 and eth2 on this oracle linux 6.3 server.

      I can ssh to eth2, but not eth1. got "ssh: connect to host 10.100.200.81 port 22: Connection refused" error. However, i can ssh to eth1 from the system itself without a problem. I can ping eth1 from outside.

      I tried following:
      ssh ipaddress
      ssh from another system
      restarted sshd

      Thanks for your help!
        • 1. Re: can not ssh to the system via one of two interfaces
          Billy~Verreynne
          What is the result of "+iptables --list+" - is that port/interface perhaps not firewalled?

          Does sshd bind a listener port (22/tcp) to all interfaces? One can configure a listening endpoint to only exist on a specific IP (e.g. loopback) and not on any other IPs on that platform.
          • 2. Re: can not ssh to the system via one of two interfaces
            946717
            there is no firewall in between and I also tried to stop iptables service.
            22 port is not binding to any IP/PORT, i check it by using netstat -ln | grep 22
            • 3. Re: can not ssh to the system via one of two interfaces
              Dude!
              On the server, what is the result of:
              lsof -i TCP:22
              grep -i ListenAddress /etc/ssh/sshd_config
              What you you receive on the client side using:
              ssh -vv user@remote_host
              • 4. Re: can not ssh to the system via one of two interfaces
                946717
                # lsof -i TCP:22
                COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
                sshd 3342 root 3u IPv4 18766 0t0 TCP *:ssh (LISTEN)
                sshd 3342 root 4u IPv6 18768 0t0 TCP *:ssh (LISTEN)
                sshd 4039 root 3r IPv4 23466 0t0 TCP servernameoneth2:ssh->10.100.221.48:49886 (ESTABLISHED)


                # grep -i ListenAddress /etc/ssh/sshd_config
                #ListenAddress 0.0.0.0
                #ListenAddress ::


                # ssh -vv eth1_ip
                OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
                debug1: Reading configuration data /etc/ssh/ssh_config
                debug1: Applying options for *
                debug2: ssh_connect: needpriv 0
                debug1: Connecting to eth1_ip [eth1_ip] port 22.
                debug1: connect to address eth1_ip port 22: Connection refused
                ssh: connect to host eth1_ip port 22: Connection refused


                Thanks!
                • 5. Re: can not ssh to the system via one of two interfaces
                  Dude!
                  Looks very much like a firewall issue.

                  Are you using any kind of virtualization ?
                  Does it work after you restart the sshd server using "service sshd restart" ?
                  Anything in /var/log/messages and /var/log/secure ?

                  f the above does not give any clues, you might want to try is the following on the server
                  tcpdump -nnxX -i eth1 port 22
                  Then connect from a client and see if you get any traffic. Note that you must use the tcpdump command on the local server console, or at least use a different Ethernet device than the one you are trying to monitor.

                  Edited by: Dude on Mar 14, 2013 3:37 PM
                  • 6. Re: can not ssh to the system via one of two interfaces
                    Billy~Verreynne
                    Dude wrote:
                    Looks very much like a firewall issue.
                    Or perhaps a network issue?

                    @OP:
                    Please post the output of:
                    ifconfig
                    ping -c3 eth1_ip
                    route -n
                    • 7. Re: can not ssh to the system via one of two interfaces
                      946717
                      to answer your question:
                      Dude:
                      tcpdump did not cature anyting. No packets are coming into port 22.
                      to make the thing simpler, I completely disabled eth2, ssh works on this interface. I am using eth1(10.100.200.81). ping from outside to it is working fine.
                      Now, I find a weird situation: most of time ssh could not work, but, I did get a couple of time to get in via ssh from another system. then aftger a couple of mins, it kicked me off and show the following message on my putty screen.

                      # Write failed: Broken pipe




                      Billy, following is the outputs you need.

                      #route -n
                      Kernel IP routing table
                      Destination Gateway Genmask Flags Metric Ref Use Iface
                      0.0.0.0 10.100.200.1 0.0.0.0 UG 0 0 0 eth1
                      10.100.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
                      192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0



                      # ifconfig
                      eth1 Link encap:Ethernet HWaddr 00:17:A4:47:E1:78
                      inet addr:10.100.200.81 Bcast:10.100.200.255 Mask:255.255.255.0
                      inet6 addr: fe80::217:a4ff:fe47:e178/64 Scope:Link
                      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
                      RX packets:35010 errors:0 dropped:11908 overruns:0 frame:0
                      TX packets:3071 errors:0 dropped:0 overruns:0 carrier:0
                      collisions:0 txqueuelen:1000
                      RX bytes:23917565 (22.8 MiB) TX bytes:302187 (295.1 KiB)

                      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:20 errors:0 dropped:0 overruns:0 frame:0
                      TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
                      collisions:0 txqueuelen:0
                      RX bytes:1436 (1.4 KiB) TX bytes:1436 (1.4 KiB)

                      virbr0 Link encap:Ethernet HWaddr 52:54:00:EB:4C:06
                      inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
                      UP BROADCAST MULTICAST MTU:1500 Metric:1
                      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                      collisions:0 txqueuelen:0
                      RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)



                      # ping -c 3 10.100.200.81
                      PING 10.100.200.81 (10.100.200.81) 56(84) bytes of data.
                      64 bytes from 10.100.200.81: icmp_seq=1 ttl=63 time=0.237 ms
                      64 bytes from 10.100.200.81: icmp_seq=2 ttl=63 time=0.197 ms
                      64 bytes from 10.100.200.81: icmp_seq=3 ttl=63 time=0.244 ms

                      --- 10.100.200.81 ping statistics ---
                      3 packets transmitted, 3 received, 0% packet loss, time 2000ms
                      rtt min/avg/max/mdev = 0.197/0.226/0.244/0.020 ms
                      • 8. Re: can not ssh to the system via one of two interfaces
                        Dude!
                        You did not answer all questions. However, if you do not use virtualization and perhaps use the wrong network adapter, e.g. NAT, then you may have an issue with the network physical layer. A network device auto-negotiation vs. fixed speed mismatch usually manifests based on network traffic and can have similar symptoms like a bad cable or bad network switch or wrong device software. So in order to continue, you will need to provide a lot more details about your setup and hardware.
                        • 9. Re: can not ssh to the system via one of two interfaces
                          946717
                          it seems that I will get more chances to ssh in right after i run 'service restart network'. the following is the parton of /var/log/messages:



                          Mar 15 13:04:14 dw62nfs kernel: ADDRCONF(NETDEV_UP): eth1: link is not ready
                          Mar 15 13:04:15 dw62nfs ntpd[2533]: Deleting interface #9 eth1, fe80::217:a4ff:fe47:e178#123, interface stats: received=0, sent=0, dropped=0, active_time=356 secs
                          Mar 15 13:04:15 dw62nfs ntpd[2533]: Deleting interface #10 eth1, 10.100.200.81#123, interface stats: received=4, sent=6, dropped=0, active_time=356 secs
                          Mar 15 13:04:16 dw62nfs kernel: bnx2 0000:05:00.0: eth1: NIC Copper Link is Up, 1000 Mbps full duplex
                          Mar 15 13:04:16 dw62nfs kernel: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
                          Mar 15 13:04:18 dw62nfs avahi-daemon[1928]: Registering new address record for fe80::217:a4ff:fe47:e178 on eth1.*.
                          Mar 15 13:04:18 dw62nfs avahi-daemon[1928]: Joining mDNS multicast group on interface eth1.IPv4 with address 10.100.200.81.
                          Mar 15 13:04:18 dw62nfs avahi-daemon[1928]: New relevant interface eth1.IPv4 for mDNS.
                          Mar 15 13:04:18 dw62nfs avahi-daemon[1928]: Registering new address record for 10.100.200.81 on eth1.IPv4.
                          Mar 15 13:04:19 dw62nfs ntpd[2533]: Listening on interface #11 eth1, fe80::217:a4ff:fe47:e178#123 Enabled
                          Mar 15 13:04:19 dw62nfs ntpd[2533]: Listening on interface #12 eth1, 10.100.200.81#123 Enabled
                          Mar 15 13:04:40 dw62nfs avahi-daemon[1928]: Withdrawing address record for 10.100.200.81 on eth1.
                          Mar 15 13:04:40 dw62nfs avahi-daemon[1928]: Leaving mDNS multicast group on interface eth1.IPv4 with address 10.100.200.81.
                          Mar 15 13:04:40 dw62nfs avahi-daemon[1928]: Interface eth1.IPv4 no longer relevant for mDNS.
                          Mar 15 13:04:40 dw62nfs avahi-daemon[1928]: Withdrawing address record for fe80::217:a4ff:fe47:e178 on eth1.
                          Mar 15 13:04:41 dw62nfs kernel: bnx2 0000:05:00.0: eth1: using MSI
                          Mar 15 13:04:41 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:04:41 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:04:41 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:04:41 dw62nfs kernel: ADDRCONF(NETDEV_UP): eth1: link is not ready
                          Mar 15 13:04:42 dw62nfs ntpd[2533]: Deleting interface #11 eth1, fe80::217:a4ff:fe47:e178#123, interface stats: received=0, sent=0, dropped=0, active_time=23 secs
                          Mar 15 13:04:42 dw62nfs ntpd[2533]: Deleting interface #12 eth1, 10.100.200.81#123, interface stats: received=0, sent=0, dropped=0, active_time=23 secs
                          Mar 15 13:04:44 dw62nfs kernel: bnx2 0000:05:00.0: eth1: NIC Copper Link is Up, 1000 Mbps full duplex
                          Mar 15 13:04:44 dw62nfs kernel: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
                          Mar 15 13:04:45 dw62nfs avahi-daemon[1928]: Joining mDNS multicast group on interface eth1.IPv4 with address 10.100.200.81.
                          Mar 15 13:04:45 dw62nfs avahi-daemon[1928]: New relevant interface eth1.IPv4 for mDNS.
                          Mar 15 13:04:45 dw62nfs avahi-daemon[1928]: Registering new address record for 10.100.200.81 on eth1.IPv4.
                          Mar 15 13:04:45 dw62nfs avahi-daemon[1928]: Registering new address record for fe80::217:a4ff:fe47:e178 on eth1.*.
                          Mar 15 13:04:47 dw62nfs ntpd[2533]: Listening on interface #13 eth1, fe80::217:a4ff:fe47:e178#123 Enabled
                          Mar 15 13:04:47 dw62nfs ntpd[2533]: Listening on interface #14 eth1, 10.100.200.81#123 Enabled
                          Mar 15 13:27:59 dw62nfs kernel: device eth1 entered promiscuous mode
                          Mar 15 13:28:05 dw62nfs kernel: device eth1 left promiscuous mode
                          Mar 15 13:31:31 dw62nfs avahi-daemon[1928]: Withdrawing address record for 10.100.200.81 on eth1.
                          Mar 15 13:31:31 dw62nfs avahi-daemon[1928]: Leaving mDNS multicast group on interface eth1.IPv4 with address 10.100.200.81.
                          Mar 15 13:31:31 dw62nfs avahi-daemon[1928]: Interface eth1.IPv4 no longer relevant for mDNS.
                          Mar 15 13:31:31 dw62nfs avahi-daemon[1928]: Withdrawing address record for fe80::217:a4ff:fe47:e178 on eth1.
                          Mar 15 13:31:32 dw62nfs kernel: bnx2 0000:05:00.0: eth1: using MSI
                          Mar 15 13:31:32 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:31:32 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:31:32 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:31:32 dw62nfs kernel: ADDRCONF(NETDEV_UP): eth1: link is not ready
                          Mar 15 13:31:33 dw62nfs ntpd[2533]: Deleting interface #13 eth1, fe80::217:a4ff:fe47:e178#123, interface stats: received=0, sent=0, dropped=0, active_time=1606 secs
                          Mar 15 13:31:33 dw62nfs ntpd[2533]: Deleting interface #14 eth1, 10.100.200.81#123, interface stats: received=11, sent=25, dropped=0, active_time=1606 secs
                          Mar 15 13:31:34 dw62nfs kernel: bnx2 0000:05:00.0: eth1: NIC Copper Link is Up, 1000 Mbps full duplex
                          Mar 15 13:31:34 dw62nfs kernel: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
                          Mar 15 13:31:36 dw62nfs avahi-daemon[1928]: Joining mDNS multicast group on interface eth1.IPv4 with address 10.100.200.81.
                          Mar 15 13:31:36 dw62nfs avahi-daemon[1928]: New relevant interface eth1.IPv4 for mDNS.
                          Mar 15 13:31:36 dw62nfs avahi-daemon[1928]: Registering new address record for 10.100.200.81 on eth1.IPv4.
                          Mar 15 13:31:36 dw62nfs avahi-daemon[1928]: Registering new address record for fe80::217:a4ff:fe47:e178 on eth1.*.
                          Mar 15 13:31:38 dw62nfs ntpd[2533]: Listening on interface #15 eth1, fe80::217:a4ff:fe47:e178#123 Enabled
                          Mar 15 13:31:38 dw62nfs ntpd[2533]: Listening on interface #16 eth1, 10.100.200.81#123 Enabled
                          Mar 15 13:31:47 dw62nfs avahi-daemon[1928]: Withdrawing address record for 10.100.200.81 on eth1.
                          Mar 15 13:31:47 dw62nfs avahi-daemon[1928]: Leaving mDNS multicast group on interface eth1.IPv4 with address 10.100.200.81.
                          Mar 15 13:31:47 dw62nfs avahi-daemon[1928]: Interface eth1.IPv4 no longer relevant for mDNS.
                          Mar 15 13:31:47 dw62nfs avahi-daemon[1928]: Withdrawing address record for fe80::217:a4ff:fe47:e178 on eth1.
                          Mar 15 13:31:48 dw62nfs kernel: bnx2 0000:05:00.0: eth1: using MSI
                          Mar 15 13:31:48 dw62nfs kernel: ADDRCONF(NETDEV_UP): eth1: link is not ready
                          Mar 15 13:31:48 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:31:48 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:31:48 dw62nfs lldpad[1854]: evb_ifdown:port eth1 remove failed
                          Mar 15 13:31:49 dw62nfs ntpd[2533]: Deleting interface #15 eth1, fe80::217:a4ff:fe47:e178#123, interface stats: received=0, sent=0, dropped=0, active_time=11 secs
                          Mar 15 13:31:49 dw62nfs ntpd[2533]: Deleting interface #16 eth1, 10.100.200.81#123, interface stats: received=0, sent=1, dropped=0, active_time=11 secs
                          Mar 15 13:31:50 dw62nfs kernel: bnx2 0000:05:00.0: eth1: NIC Copper Link is Up, 1000 Mbps full duplex
                          Mar 15 13:31:50 dw62nfs kernel: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
                          Mar 15 13:31:52 dw62nfs avahi-daemon[1928]: Registering new address record for fe80::217:a4ff:fe47:e178 on eth1.*.
                          Mar 15 13:31:52 dw62nfs avahi-daemon[1928]: Joining mDNS multicast group on interface eth1.IPv4 with address 10.100.200.81.
                          Mar 15 13:31:52 dw62nfs avahi-daemon[1928]: New relevant interface eth1.IPv4 for mDNS.
                          Mar 15 13:31:52 dw62nfs avahi-daemon[1928]: Registering new address record for 10.100.200.81 on eth1.IPv4.
                          Mar 15 13:31:53 dw62nfs ntpd[2533]: Listening on interface #17 eth1, fe80::217:a4ff:fe47:e178#123 Enabled
                          Mar 15 13:31:53 dw62nfs ntpd[2533]: Listening on interface #18 eth1, 10.100.200.81#123 Enabled

                          Edited by: 943714 on Mar 15, 2013 10:43 AM
                          • 10. Re: can not ssh to the system via one of two interfaces
                            Dude!
                            If you device goes offline and a restart fixes it for a short period of time then it could be due to an an IP address conflict with another device on your network (DHCP) or a network/wiring loop, or bad NIC/firmware, etc.
                            • 11. Re: can not ssh to the system via one of two interfaces
                              946717
                              it indeed had a IP conflit. Thank you, Dude!