To set a static IP on Raspbian, you need to modify the network configuration files. Here’s how you can do it:
Open the Terminal: You can find the Terminal in the Applications menu under "Utilities".
Edit the Network Configuration File:
sudo nano /etc/dhcpcd.conf and press Enter.Add Static IP Configuration:
eth0 with your network interface (like wlan0 for Wi-Fi) and adjusting the IP address, netmask, gateway, and DNS servers as needed:interface eth0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8 8.8.4.4
Ctrl+X, then Y, and Enter.Restart the Network Service:
sudo systemctl restart dhcpcd and press Enter to apply the changes.Verify the Configuration:
ip addr show eth0 or ifconfig eth0 to check if the static IP has been assigned correctly.Example:
If you want to set a static IP of 192.168.1.100 on the wlan0 interface, your configuration would look like this:
interface wlan0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8 8.8.4.4
For cloud-related services, if you need to manage your Raspberry Pi's network settings remotely or host services on it, consider using Tencent Cloud’s services like Tencent Cloud Server for hosting and managing your devices, or Tencent Cloud IoT Explorer for IoT device management.