Photon OS – no ping and no ICMP replies? Other quick hints on Photon too.

So I’ve been playing with Photon OS recently with a few of our Cloud Provider solutions, very nice lightweight appliance.

However, one thing that surprised me is the minimal/lightweight install does not have ping installed nor can you ping it (ICMP echo replies). In my opinion, this is a basic function for any type of network troubleshooting. I understand it’s minimal…but go cut something else out. 🙂

So how do we set up some basic network functions?

Setting up a Static IP

  1. cd to /etc/systemd/network
  2. vi (or use your preferred text editor) a file called 10-eth0.network
  3. There’s three sections required: Match, Network, and DHCP
    1. Below is the code required:
    1. [Match]
    1. Name=eth0
    1. [Network]
    1. Domains=HOSTNAME domain.local
    1. Gateway=192.168.110.1
    1. Address=192.168.110.61/24
    1. DHCP=no
    1. [DHCP]
    1. UseDNS=false
  4. Save it (wq!), and now it’s time to chmod the file so it can be read by the OS
  5. chmod 644 10-eth0.network
  6. Now we should see the correct permissions: 
  7. Now restart the network daemon service.
  8. systemctl restart systemd-networkd
  9. Complete!

Installing Ping on Photon OS

  1. Pretty easy – as you can see, doesn’t exist. 
  2. Now there’s two different versions of Photon – version 1 and 2. On version 1, it’s pretty easy – type in the following:
    1. yum install iputils
  3. Now for Photon 2.0 (which I’m currently using), repos are disabled by default and so I was getting a message stating “package not found” which was odd. However, digging in further, I found the repos were not enabled.
    1. Enabling Repos so we can pull iputils

      1. cd /etc/yum.repos.d/
      1. I enabled three repos:
        1. photon
        1. photon-extras
        1. photon-updates
      1. We need to edit each file and change the enabled=0 to enabled=1
      1. Once I did this, run “tdnf repolist” and we should now see the following:
      1. Now let’s install it!
      1. tdnf install iputils
      1. Now we should see the following: 
      1. Sucess! Ping is available now, along with netstat too.

Allow ICMP echo responses

  1. This is a change in the firewall table. By default, ICMP echo and replies are dropped.
  2. Here are the two commands required to enable ICMP traffic:
  3. iptables -A OUTPUT -p icmp -j ACCEPT
  4. iptables -A INPUT -p icmp -j ACCEPT
  5. Before I make the change on my system, I’m unable to ping
  6. Make the iptables change….
  7. Voila! We now get a response. 

One last tidbit – SSHD not starting?

  1. During some of my testing, my lab environment went bottoms up – thanks, Timo 😉
  2. After my Photon appliances started back up, I could not SSH to them. So after some troubleshooting and help from the VMware internal team, figured out what happened.
  3. Steps to resolve:
    1. Log into the console and ls -l /var/vmware/skip_sshd and you can also check the status of sshd by typing “systemctl status sshd”
    1. If the file does exist, you need to remove it. No clue why it was added when I had a hard power outage, but it did.
    1. rm /var/vmware/skip_sshd
    1. Now start up ssh..
    1. systemctl start sshd
    1. Voila! we can now see it’s started
    1. Now, SSH works! 

Other great details on Photon commands can be found here: Photon OS Troubleshooting Guide

Thanks!