CentOS7 Machine will not respond to ping or ssh

100

All the above checks are good, but one final check solved the problem. in the /etc/hosts and the /etc/sysconfig/network-scripts/ifcfg-en9p0 files, I had accidentally typed one digit off on the IPADDR for the machine. Stupid mistake. I put a 221 instead of a 121, and 221 was also the address of a machine that was in the tables but turned off. So that explains how I could get OUT but not IN.

So for a very secure machine, tell it it has the IP of a down'ed machine and tell your DNS server it has a different address. No one will be able to get in.

Share:
100

Related videos on Youtube

M. Suurland
Author by

M. Suurland

Updated on September 18, 2022

Comments

  • M. Suurland
    M. Suurland over 1 year

    I have two files. File X is:

    module A
        module B    
            XYZ = "5"    
            def testx
                puts "Test"
            end
        end
    end
    

    File Y is as follows:

    require_relative "./B/X"
    
    def test
     puts A::B::XYZ
     puts A::B.testx
    end
    

    I am trying to call testx of file X within Y, but it is not working. However, the call to constantXYZ is successful.

    What am I doing wrong?

    Update: File Y needs a class structure as @AlexN pointed out, and include module B, then testx can simply be called. File Y becomes as follows:

    require_relative "./B/X"
        module A
           class test
           include B        
           def        
              puts self.method("testx")
           end
        end
    end
    
    • Petr Gazarov
      Petr Gazarov about 8 years
      XYZ is called a constant, not a variable, fyi.
    • M. Suurland
      M. Suurland about 8 years
      @PetrGazarov thanks for the feedback, see the edit
    • Deathgrip
      Deathgrip almost 7 years
      Have you run tcpdump on the interface while trying to ping or ssh to this machine? Are you trying to access using its IP or hostname? Both?
    • billmenger
      billmenger almost 7 years
      I'll try that, and/or wireshark on the interface. It feels like the firewalld did not actually die, that is something else I will check. (by looking for the process).
    • Deathgrip
      Deathgrip almost 7 years
      Don't forget, the firewall will start on reboots unless you systemctl disable firewalld.
    • billmenger
      billmenger almost 7 years
      I have now verified that firewalld is not running after boot (disabled it and removed link). I installed iptables and set up default rules that would allow ssh and ping from anyone. selinux is disabled. tcpdump output from another workstation in the subnet shows ARP requests "IPv4 (len 4), Request who-has xxx tell yyy, length 46" when attempting to ping or ssh to the machine. GATEWAY, NETMASK, IPADDR all are good and consistent with the subnet. DNSMASQ is used to resolve names and seems to be working flawlessly. I am still stumped. Thanks @Deathgrip, appreciate the advice!
  • M. Suurland
    M. Suurland about 8 years
    I seem to solve it, I indeed needed to use a class structure in Y, and include model B, then I can just call testx
  • M. Suurland
    M. Suurland about 8 years
    Thank you for your answer, but I guess the "extend self" is then required in many classes (I have many classes like X) which makes the class solution less redundant, correct me if I am wrong :)
  • Cary Swoveland
    Cary Swoveland about 8 years
    The downvote is mine.True, this creates a class method testx, but it also creates an unwanted instance method with the same name. It's a bizarre alternative to simply creating a class method directly.
  • M. Suurland
    M. Suurland about 8 years
    @CarySwoveland Thanks for the comment/feedback