How To Manually Set The IP Address On Photon OS From Command Line

Blog Date: December 8th 2022.

Out in the field, I have had a Photon OS appliance like Site Recovery Manager, and vRealize Lifecycle Manager deploy without the proper networking configuration. For me, these appliances have been deployed to a network where the Gateway and DNS were reachable, but the appliance will sometimes complete its first boot without successfully configuring the network. Sometimes you can get out of this situation by simply redeploying the appliance. There are those other times where the appliance just refuses to configure the networking, so a manual approach is required.

DISCLAIMER: I have only done this process on VMware Photon OS based appliances that did not successfully complete their first boot. Your mileage may vary attempting this on an appliance that has successfully deployed.

As always – Take snapshots before proceeding.

Commands To Update Photon OS Network Configuration

Using the VMware console, we first need to check and see what interface is being used with this command:

# /opt/vmware/share/vami/vami_interfaces

Next we need to set the interface IP, NETMASK, and GATEWAY with this command:

# /opt/vmware/share/vami/vami_set_network <INTERFACE> STATICV4 <IP_ADDRESS> <NETMASK> <GATEWAY>

To set the domain suffix and DNS, use this command:

# /opt/vmware/share/vami/vami_set_dns -d <domain suffix> <DNS1> <DNS2>

Assuming no errors, reboot the appliance.

In the event those commands do not work because not all Photon Operating Systems are 100% alike, you can also try this method below:

Update Photon OS Network Configuration File:

Let’s first list the network configuration files. To do this, run the following command:

# ls /etc/systemd/network

In this example, we see one configuration file “”. We will use the next command to edit the file using vi and make the appropriate changes:

# vi /etc/systemd/network/

Once you are done making the necessary changes, do a “wq!” to save the changes and quit the editor.

Reboot the appliance for the changes to take affect.

An Engineer’s Guide To The Galaxy Using KeePass

If you’re like me, and have multiple cloud environments, and multiple servers to manage, the task can be quite daunting.  There are many paid for utilities out there that can help you with this task, but I’ve found that a utility called: KeePass Password Safe, does the job flawlessly if you are willing to do some custom configurations.  KeePass is not just for IT engineers, it’s free and open source so anyone can use it.  It really is the modern day Swiss Army knife for all geeks alike.


The Benefits

  • The database is encrypted using the most secure and best known algorithms AES and Twofish.
  • It is password protected, so assuming you are following password best practices, the KeePass database with your environment variables will remain secure if it is misplaced.
  • You can use KeePass from your local box, plus drop the same database file onto a jump server within your environment, to easily setup a secondary base of operations for yourself.
  • IT IS FREE. Open source too (OSI certified).

You Know You Want It


Now, there are many platforms that support KeePass, but this post will focus on Windows, as the majority of legacy IT departments are not too keen on running Linux or OSX in their environments, although those two platforms are quickly gaining traction in the modern era of hyper converged infrastructure.

The two key features I will focus on in this post are the abilities to use KeePass to open SSH and RDP sessions.  Assuming you already have KeePass installed, go into the Tools menu and then click Options


Now go to the Integration tab in the options window, and click the URL Overrides button


We will be creating two custom URL Override entries one for SSH (putty session) and the other for RDP (Microsoft Remote Desktop)

Click the Add button to get started:


Assuming you installed Putty to its default directory, you need to tell KeePass where to find the executable. You can call Scheme whatever you wish, but for simplicity ssh was chosen for this example.

Scheme: ssh
URL override: cmd://”C:\Program Files (x86)\PuTTY\PuTTY.exe” -ssh {URL:RMVSCM}

Click OK when finished.

Now for RDP sessions we will need to string together several commands in order to get the desired result. Here we are calling MSTSC (RDP) through the command prompt, configuring a timeout, and passing through credentials. You can call Scheme whatever you wish, but for simplicity rdp was chosen for this example.

Click Add button again

Scheme: rdp
URL override: cmd:// cmd /c “cmdkey /generic: TERMSRV/{URL:RMVSCM} /user:{USERNAME} /pass:{PASSWORD} && mstsc /v:{URL:RMVSCM} && timeout /t 5 /nobreak && /delete:TERMSRV/{URL:RMVSCM}”

Click OK when finished.

Now in KeePass when you create a new “entry”, you can enter a URL of rdp://ipaddress (or name of server) and KeePass will open a rdp session whenever you click on the link.  Likewise if you create a new “entry” for a putty session to a Linux box or network appliance, you can enter a URL of ssh://ipaddress and KeePass will open a putty session whenever you click on the URL link when you select your various entries.  In both cases you should specify a user account to use as RDP links especially need this to work.

There you have it.  Now you can build out the KeePass database with custom links to your various systems, to aid you in your quest in mastering your environment.