Debian

Debian网卡固定ip,pve虚拟机固定ip

10-15 22:56

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:

auto lo

iface lo inet loopback


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

        gateway 10.168.1.1

        bridge-ports enp1s0

        bridge-stp off

        bridge-fd 0


重启网络:

#方式一

/etc/init.d/networking restart


#方式二

systemctl restart networking

若重启网络后,网卡获取不到ip,可尝试重启系统


微信小程序
大潇博客 版权所有 Copyright ©2016~2025
京ICP备17004217号-6  合作QQ:284710375
天玺科技