独立服务器proxmox单IP桥接 自动获取IP配置

参考网址:

[Debian 搭建自己的DNS服务器,编译安装 dnsmasq 最新版 | 趣域网域名百科 (quyu.net)](https://www.quyu.net/info/1451.html)
[Hackintosh on KVM (附 Proxmox VE NAT 配置) - evi0s' Blog](https://evi0s.com/2020/03/07/hackintosh-on-kvm-with-pve-nat-configuration/)
[dabian直接网络安装proxmox](/e69bd2cfe0b64d4392e2c42bfd618a3e)

一、编辑 /etc/network/interfaces

iface eno1 inet manual
#eno1为公网网卡名称,全局替换

auto vmbr0
iface vmbr0 inet static
        address  公网IP
        netmask  24
        gateway  网关
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0

auto vmbr1
iface vmbr1 inet static
        address 192.168.101.1
        netmask  24
        bridge_ports none
        bridge_stp off
        bridge_fd 0

        post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '192.168.101.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.101.0/24' -o vmbr0 -j MASQUERADE

二、刷新网络配置(此处最好重启看下会不会 失联)

三、配置dnsmasq

apt-get install make gcc xz-utils -y
apt install dnsmasq

配置dnsmasq配置文件

/etc/dnsmasq.conf

interface=vmbr1
listen-address=192.168.101.1,127.0.0.1
dhcp-range=192.168.101.100,192.168.101.200,72h
dhcp-option=3,192.168.101.1
dhcp-option=option:dns-server,114.114.114.114

重启服务让配置生效

systemctl restart dnsmasq

四、创建虚拟机网卡选择vmbr1


欢迎指出任何有错误或不够清晰的表达,可以在下面评论区评论。

×

喜欢就点赞,疼爱就打赏

//