Static IP Configuration
Starting from FlyOS-Fast v1.3.9, the wired Ethernet port supports automatic detection of direct PC connections or routers. If the device's Ethernet port is directly connected to a PC, wait approximately 15 seconds and access the device via 10.10.10.1 or local.klipper.cn; manual static IP configuration is generally not required for direct connection scenarios.
Purpose and Advantages of Static IP
Static IP configuration ensures the device has a fixed address on the network, providing stable and reliable network connectivity for various application scenarios.
Main Application Scenarios
-
Ensuring Stable Device Accessibility
- The device consistently maintains the same IP address, facilitating remote access and control
- Suitable for scenarios requiring fixed addresses such as web servers, MQTT communication, and PLC control
-
Simplifying Network Management
- In LAN or industrial networks, devices such as cameras, sensors, and controllers require fixed IPs
- Facilitates stable connections for other systems and services
-
Adapting to Special Network Environments
- Static IPs are mandatory in environments without DHCP services (e.g., industrial control, edge computing)
- Avoids reliance on dynamic address allocation
-
Enhancing Development and Debugging Efficiency
- Fixed IPs enable quick device identification and connection
- Simplifies repetitive testing procedures
-
Supporting Device Discovery Mechanisms
- When accessing devices via preset IP ranges, static IPs ensure the device responds as expected
Comparison of Static IP Advantages
| Advantage | Description |
|---|---|
| Stable and Reliable | Fixed IP addresses ensure stable communication for long-running devices |
| Headless Environment Friendly | Suitable for embedded devices and other environments without graphical interfaces |
| Convenient Remote Maintenance | More efficient when connecting via SSH, Web, API, etc. |
| Closed Network Adaptation | Static IPs are required in industrial or private networks without DHCP |
| Automation Support | Deployment, monitoring, and update scripts rely on consistent IPs to function properly |
System-Side Configuration
- Avoid using IP addresses near boundary values such as
0,1,254, and255 - Addresses like
192.168.1.254may be occupied by other applications, leading to 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
-
Connect to the System Terminal
- Use SSH to connect to the device system
-
View Network Interfaces
- Execute the command:
ip link show - Note the network interface name, such as
eth0orend0
Loading... - Execute the command:
-
Edit the Network Configuration File
- Execute the command:
nano /etc/systemd/network/end0.network - Note: The
end0in the filename must be replaced with the actual network interface name
Loading... - Execute the 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 the actual situationName=end0[Network]# Set the static IP address and subnet mask# /24 indicates a subnet mask of 255.255.255.0Address=192.168.1.100/24# Set the default gateway addressGateway=192.168.1.1# Set DNS serversDNS=8.8.8.8DNS=114.114.114.114Loading... -
Save and Apply the Configuration
- Press
Ctrl + Sto save the file - Press
Ctrl + Xto exit the editor - Execute the command to restart the network service:
systemctl restart systemd-networkd
- Press
-
Verify the Configuration Result
- Execute the command:
ip a - Confirm that the displayed IP address matches the configuration
Loading... - Execute the command:
PC-Side Configuration
To ensure proper communication between the PC and the device configured with a static IP, corresponding network configuration is required on the PC side.
Network Parameter Settings
| Parameter | Configuration Requirement | Description |
|---|---|---|
| Local IP | 192.168.1.xxx | Must be on the same subnet as the device IP |
| Gateway | 192.168.1.1 | Must match the gateway configured on the device |
| Subnet Mask | 255.255.255.0 | Corresponds to the device IP's /24 configuration |
| 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 "Change adapter settings"
- Right-click the active network connection and select "Properties"
- Double-click "Internet Protocol Version 4 (TCP/IPv4)"
- Select "Use the following IP address" and fill in the corresponding parameters
macOS System
- Open "System Preferences" → "Network"
- Select the active network connection
- Click "Advanced" → "TCP/IP"
- Configure "IPv4" as "Manual"
- Fill in the corresponding IP address, subnet mask, and router address
Connectivity Test
After configuration, it is recommended to perform a connectivity test:
# Execute the ping command on the PC to test connectivity
ping 192.168.1.100
# If replies are received, the network configuration was successful
If the device cannot be pinged, check:
- Whether the Ethernet cable connection is normal
- Whether firewall settings are blocking communication
- Whether the IP addresses are on the same subnet
- Whether the subnet mask and gateway configurations are correct