0

This might be a centos issue. I have few hosts(ubuntu 16 and centos7) in subnet 10.1.10.1 while the client machine is in 10.1.1.1. The networking seems to fine. I can ping and ssh into all ubuntu hosts from client machine but not to centos machines. I have disabled SE and centos machine is listening on port 22. sshd_config has all addressfamily uncommented

ssh -v -v -v user@10.1.10.151
  openSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 19: Applying options for *
  debug2: resolving "10.1.10.151" port 22
  debug2: ssh_connect_direct: needpriv 0
  debug1: Connecting to 10.1.10.* [10.1.10.151] port 22.
  ssh: connect to host 10.1.10.151 port 22: Connection timed out

Ping is also a not working. Firewalld is disabled on centos.

I can ssh into ubuntu host in the same subnet as centos and then ssh from that ubuntu host into centos machine without a problem.

I am not sure what is blocking it.

 Output:
 ifconfig -a 
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 10.1.10.151  netmask 255.0.0.0  broadcast 10.255.255.255
    inet6 fe80::7845:daff:fed6:5170  prefixlen 64  scopeid 0x20<link>
    ether 7a:45:da:d6:51:70  txqueuelen 1000  (Ethernet)
    RX packets 7661  bytes 221816 (216.6 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 91  bytes 9471 (9.2 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1  (Local Loopback)
    RX packets 17  bytes 1496 (1.4 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 17  bytes 1496 (1.4 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Jauyzed
  • 111
  • 5
  • Please include the output of `ifconfig -a` from your CentOS system – JohnA Apr 01 '18 at 23:22
  • @JohnA Added the output – Jauyzed Apr 01 '18 at 23:32
  • 1
    Are your networks actually subnetted as in your first comment, from the output of ifconfig -a it seems you have a giant 10.x.x.x subnet. if they are subnetted make sure the netmask and routes are good. – Flash Apr 01 '18 at 23:56
  • You can try running `tcdump -nnn port 22` on both systems and watch for traffic. You should see a SYN `[S]` leave one node and arrive on the other node, then see a SYN-ACK `[S.]` from that node back to the original node. If you don't see the first SYN on the 10.1.10.151 machine, something along the network path is dropping the packets, or the routes/subnetting is messed up (maybe even arp issues) – Andrew Apr 02 '18 at 00:09
  • 1
    @Flash Yes the network is subnetted. I think you might have resolved my issue by pointing subnet thing. I added NETMASK with 255.255.255.0 in the network conf script. Its working like a charm – Jauyzed Apr 02 '18 at 00:54

1 Answers1

1

ifcfg-eth0 file was missing a parameter NETMASK. I added the parameter and setting it to 255.255.255.0.

NETMASK=255.255.255.0

    ifconfig output
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 10.1.10.151  netmask 255.255.255.0  broadcast 10.1.10.255
    inet6 fe80::7845:daff:fed6:5170  prefixlen 64  scopeid 0x20<link>
    ether 7a:45:da:d6:51:70  txqueuelen 1000  (Ethernet)
    RX packets 18456  bytes 556226 (543.1 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 360  bytes 56514 (55.1 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Now ssh and ping works. Thanks all for the comments and suggestions

Jauyzed
  • 111
  • 5