Setting a New Static IP Address

Open the dhcpcd configuration file:

sudo vi /etc/dhcpcd.conf

Set the static IP address: At the end of the file, add the following lines, replacing the example network information with your own:

interface eth0
static ip_address=192.168.1.XX/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

Here, 192.168.1.XX is the new IP address you wish to assign to your server. Ensure this IP address is not already in use within your local network.

sudo sync;sudo /sbin/shutdown -r now

留下评论

通过 WordPress.com 设计一个这样的站点
从这里开始