How to Set a Static IP Address on the Gateway via SSH or Direct Access

This article outlines how to configure a static IP address on the gateway device either through SSH or by connecting directly with a monitor and keyboard.

Prerequisites

  • Access to the gateway via SSH, or physical access to the gateway with a monitor and keyboard

  • Preferred SSH client installed (e.g., PuTTY for Windows)

  • Static IP configuration details (IP address, gateway, DNS)


Method 1: Access via SSH

  1. Open your preferred SSH client (e.g., PuTTY).

  2. Connect to the gateway using its current IP address and port 22.

  3. Log in using the following default credentials:

    Username: user  
    Password: user
    

Method 2: Direct Access

  1. Connect a monitor and keyboard directly to the gateway, no password is needed in this approach.


Set the Static IP Address

  1. Once logged in, run the following command, replacing the IP, gateway, and DNS values with your desired configuration:

    nmcli connection modify "Wired connection 1" ipv4.method manual ipv4.addresses "192.168.0.105/24" ipv4.gateway "192.168.0.2" ipv4.dns "8.8.8.8 8.8.4.4"
    
    • ipv4.addresses: Replace with the static IP and subnet mask (e.g., 192.168.0.105/24)

    • ipv4.gateway: Replace with the correct gateway address (e.g., 192.168.0.2)

    • ipv4.dns: Use your preferred DNS servers (e.g., Google's 8.8.8.8 and 8.8.4.4)


Apply Changes

  1. Reboot the gateway to apply the new IP settings:

    sudo systemctl reboot
    

Notes

  • Ensure the chosen static IP address is outside the DHCP range to avoid conflicts.

  • If you're unable to connect after setting the static IP, verify the new IP and network settings match your local network.

Tags