Debian固定IP:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens18
iface ens18 inet static
address 10.168.1.101
netmask 255.255.255.0
gateway 10.168.1.1
PVE虚拟机固定IP:
iface enp1s0 inet manual
auto vmbr0
#iface vmbr0 inet dhcp
iface vmbr0 inet static
#address 192.168.123.123/24
address 10.168.1.100/24
#gateway 192.168.123.1
bridge-ports enp1s0
bridge-stp off
bridge-fd 0
重启网络:
#方式一
/etc/init.d/networking restart
#方式二
systemctl restart networking
若重启网络后,网卡获取不到ip,可尝试重启系统
上一篇:Debian定时任务cron/crond/crontab使用方法和常见问题
下一篇:Debian11升级到Debain12