零碎小技巧
280 字
1 分钟
零碎小技巧
套 CDN 报错重定向过多
WARNING要套 CDN,需要关闭 Nginx Proxy Manager 的 Force SSL 并将回源域名的 SSL/TLS 加密改为灵活,否则会提示重定向过多。
修改 Debian 网络配置为静态 IP
1. 查找网络接口名称
ip link输出结果中,找到你正在使用的网络接口,通常命名为 eth0、ens33 或 enp0s3 等。
2. 编辑网络配置文件
sudo nano /etc/network/interfaces3. 修改配置为静态 IP
文件的默认内容可能类似如下,表示使用 DHCP 自动获取 IP:
auto enp0s3iface enp0s3 inet dhcp修改为静态 IP 配置,请根据实际网络情况替换相应的值:
# The primary network interfaceauto enp0s3iface enp0s3 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 8.8.4.4| 字段 | 说明 |
|---|---|
auto enp0s3 | 开机时自动启用该网络接口 |
inet static | 配置为静态 IP |
address | 要设置的静态 IP 地址 |
netmask | 子网掩码 |
gateway | 默认网关地址 |
dns-nameservers | DNS 服务器地址,多个用空格隔开 |
4. 重启网络服务
sudo systemctl restart networking.serviceNetworkManager如果系统使用 NetworkManager 管理网络,则执行:
Terminal window sudo systemctl restart NetworkManager.service
5. 验证 IP 地址
ip a 站点统计
9
4
20
9,916
0 天
0 天前
日
一
二
三
四
五
六