Skip to main content

Static IP Configuration

Uses 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.

Key Application Scenarios

  1. Ensuring Device Availability

    • Device always maintains 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 IP addresses are required for devices like cameras, sensors, controllers, etc., in local or industrial networks
    • Facilitates stable connections from 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 dependency on dynamic address allocation
  4. Improving Development and Debugging Efficiency

    • Fixed IP simplifies device location and connection
    • Streamlines repetitive testing processes
  5. Supporting Device Discovery Mechanisms

    • Static IP ensures devices respond as expected when accessed within a predefined IP range

Static IP Advantages Comparison

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

System Configuration

IP Address Selection Recommendations
  • Avoid using IP addresses near boundary values such as 0, 1, 254, 255
  • Using 192.168.1.254 may lead to conflicts with other applications, causing unstable connections
  • It is recommended to use IP addresses from 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

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

    • Execute 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 according to actual situation
    Name=end0

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

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

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

PC Configuration

To ensure proper communication between the PC and the device configured with a static IP, corresponding network settings need to be made on the PC side.

Network Parameter Settings

ParameterConfiguration RequirementDescription
Local IP192.168.1.xxxMust be in the same subnet as the device
Gateway192.168.1.1Must match the gateway set on the device
Subnet Mask255.255.255.0Corresponds to the /24 configuration of the device's 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 on "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 enter 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. Enter the corresponding IP address, subnet mask, and router address

Connectivity Test

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

# Execute 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 connection is normal
  • 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...