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
-
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.
-
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
-
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
-
Improving Development and Debugging Efficiency
- Fixed IP simplifies device location and connection
- Streamlines repetitive testing processes
-
Supporting Device Discovery Mechanisms
- Static IP ensures devices respond as expected when accessed within a predefined IP range
Static IP Advantages Comparison
| Advantage | Description |
|---|---|
| ✅ Stable and Reliable | IP address remains unchanged, ensuring stable communication for long-running devices |
| ✅ Friendly for Headless Environments | Suitable for embedded devices without a graphical interface |
| ✅ Convenient for Remote Maintenance | More efficient when connecting via SSH, Web, API, etc. |
| ✅ Compatible with Closed Networks | Static IP is required in industrial or private networks where DHCP is unavailable |
| ✅ Supports Automation | Deployment, monitoring, and update scripts rely on consistent IP addresses |
System Configuration
- Avoid using IP addresses near boundary values such as
0,1,254,255 - Using
192.168.1.254may 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
-
Connect to the System Terminal
- Use SSH to connect to the device
-
Check Network Interfaces
- Execute command:
ip link show - Note the network interface name, such as
eth0,end0

- Execute command:
-
Edit Network Configuration File
- Execute command:
nano /etc/systemd/network/end0.network - Note: Replace
end0in the filename with the actual network interface name

- Execute command:
-
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
-
Save and Apply Configuration
- Press
Ctrl + Sto save the file - Press
Ctrl + Xto exit the editor - Execute command to restart the network service:
systemctl restart systemd-networkd
- Press
-
Verify Configuration
- Execute command:
ip a - Confirm that the displayed IP address matches the configured one

- Execute command:
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
| Parameter | Configuration Requirement | Description |
|---|---|---|
| Local IP | 192.168.1.xxx | Must be in the same subnet as the device |
| Gateway | 192.168.1.1 | Must match the gateway set on the device |
| Subnet Mask | 255.255.255.0 | Corresponds to the /24 configuration of the device's IP |
| DNS Server | 8.8.8.8, 114.114.114.114 | Use common public DNS services |
Configuration Methods
Windows System
- Open "Network and Sharing Center"
- Click on "Change adapter settings"
- Right-click the currently used network connection and select "Properties"
- Double-click "Internet Protocol Version 4 (TCP/IPv4)"
- Select "Use the following IP address" and enter the corresponding parameters
macOS System
- Open "System Preferences" → "Network"
- Select the currently used network connection
- Click "Advanced" → "TCP/IP"
- Set "IPv4" to "Manual"
- 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
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