Skip to main content

Static IP Configuration

Purposes and Advantages of Static IP

Static IP configuration ensures that a device maintains a fixed address on the network, providing stable and reliable network connectivity for various application scenarios.

Main Application Scenarios

  1. Ensuring Device Accessibility

    • Devices always maintain the same IP address, making remote access and control easier
    • Suitable for scenarios requiring fixed addresses, such as web servers, MQTT communication, PLC control, etc.
  2. Simplifying Network Management

    • Fixed IPs are required for devices such as cameras, sensors, and controllers in LAN or industrial networks
    • Facilitates stable connections for other systems and services
  3. Adapting to Special Network Environments

    • Static IP must be used in environments without DHCP service (e.g., industrial control, edge computing)
    • Avoids reliance on dynamic address allocation
  4. Improving Development and Debugging Efficiency

    • Fixed IP addresses make it easier to locate and connect to devices quickly
    • Simplifies repetitive testing processes
  5. Supporting Device Discovery Mechanisms

    • Static IP ensures devices respond as expected when accessing predefined IP ranges

Comparison of Static IP Advantages

AdvantageDescription
Stable and ReliableThe IP address remains unchanged, ensuring stable communication for long-running devices
Friendly for Headless EnvironmentsSuitable for use in embedded devices without a graphical interface
Convenient for Remote MaintenanceMore efficient when connecting via SSH, Web, API, etc.
Adaptable to Closed NetworksStatic IP is required in industrial networks or private networks without DHCP
Supports AutomationDeployment, monitoring, and update scripts rely on consistent IP addresses to run

System-side Configuration

IP Address Selection Recommendations
  • Avoid using IP addresses close to boundary values such as 0, 1, 254, 255
  • Using 192.168.1.254 may result in conflicts with other applications, causing unstable connections
  • It is recommended to use IP addresses in the middle range, such as 192.168.1.100 - 192.168.1.200

Configuration Steps

  1. Connect to the System Terminal

    • Use SSH to connect to the device
  2. Check Network Interfaces

    • Run the command: ip link show
    • Record the network interface name, such as eth0, end0
  3. Edit the Network Configuration File

    • Run the command: nano /etc/systemd/network/end0.network
    • Note: Replace end0 in the filename with the actual network interface name
  4. Configure Static IP Parameters

    • Modify the file content as follows (adjust according to the actual network environment):
    [Match]
    # Match the network interface name; modify as needed
    Name=end0

    [Network]
    # Set the static IP address and subnet mask
    # /24 indicates a subnet mask of 255.255.255.0
    Address=192.168.1.100/24
    # Set the default gateway address
    Gateway=192.168.1.1
    # Set the DNS servers
    DNS=8.8.8.8
    DNS=114.114.114.114
  5. Save and Apply the Configuration

    • Press Ctrl + S to save the file
    • Press Ctrl + X to exit the editor
    • Restart the network service with the command: systemctl restart systemd-networkd
  6. Verify the Configuration

    • Run the command: ip a
    • Confirm that the displayed IP address matches the configured one

PC-side Configuration

To ensure the PC can communicate properly with devices configured with static IPs, corresponding network configurations must be made on the PC.

Network Parameter Settings

ParameterConfiguration RequirementsDescription
Local IP192.168.1.xxxMust be in the same subnet as the device IP
Gateway192.168.1.1Must match the gateway set on the device
Subnet Mask255.255.255.0Corresponds to the /24 configuration of the device IP
DNS Server8.8.8.8, 114.114.114.114Use common public DNS services

Configuration Methods

Windows System

  1. Open "Network and Sharing Center"
  2. Click "Change adapter settings"
  3. Right-click the currently used network connection and select "Properties"
  4. Double-click "Internet Protocol Version 4 (TCP/IPv4)"
  5. Select "Use the following IP address" and fill in the corresponding parameters

macOS System

  1. Open "System Preferences" → "Network"
  2. Select the currently used network connection
  3. Click "Advanced" → "TCP/IP"
  4. Set "IPv4" to "Manual"
  5. Fill in the corresponding IP address, subnet mask, and router address

Connectivity Test

After configuration, it is recommended to perform a connectivity test:

# Run the ping command on the PC to test connectivity
ping 192.168.1.100

# If replies are received, the network configuration is successful
Troubleshooting

If the device cannot be pinged, please check:

  • Whether the network cable is properly connected
  • Whether the firewall is blocking communication
  • Whether the IP addresses are in the same subnet
  • Whether the subnet mask and gateway configuration are correct
Loading...
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
- 3D Mellow -
Loading...