首页 > 技术分享 > Debian
收藏

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

10/15 22:33
大潇博客 原创文章,转载请标明出处

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,可尝试重启系统


打赏

阅读排行

大家都在搜

博客维护不易,感谢你的肯定
扫码打赏,建议金额1-10元
  • 15601023311