Version: Sep 29, 2025

Setting a Static IP Address on Ubuntu Server

1. Identify Network Interface Details

2. Access Netplan Configuration

3. Back Up the Original Configuration

4. Edit the Configuration File

5. Apply Configuration

6. Verify Configuration

7. Troubleshooting

8. Restart Network Services

9. Optional: Enable forwarding

On node 1

echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
On MacOS workstation - temporary
sudo route -n add 10.10.10.0/24 192.168.1.50
On MacOS workstation - permanent

Create a file

sudo nano /Library/LaunchDaemons/com.local.staticroutes.plist

Add:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key><string>com.local.staticroutes</string>
    <key>ProgramArguments</key>
    <array>
      <string>/sbin/route</string>
      <string>-n</string>
      <string>add</string>
      <string>10.10.10.0/24</string>
      <string>192.168.2.50</string>
    </array>
    <key>RunAtLoad</key><true/>
  </dict>
</plist>

Then load it:

sudo launchctl load /Library/LaunchDaemons/com.local.staticroutes.plist

Now it’ll reapply at every boot.

Test it

You should be able to ping the private network, assuming we made node 1 second NIC 10.10.10.1 and node 2 10.10.10.2

ping 10.10.10.2