Я хотел назначить своему контейнеру на Proxmox отдельный публичный IP-адрес. Мой сетевой интерфейс выглядит так:
auto lo
iface lo inet loopback
auto ens3
iface ens3 inet manual
auto vmbr1
iface vmbr1 inet static
#Main public ip-address assigned to proxmox host
address 91.xxx.xxx.xxx
#Gateway from the SCP
netmask 255.255.252.0
gateway 91.xxx.xxx.1
bridge_ports ens3
bridge_stp off
bridge_fd 1
#Same as the gateway
pointopoint 91.xxx.xxx.1
#My additional ip-address
#Gateway is set to my Proxmox host public ip-address
up route add -net 188.xx.xx.xx.xxx netmask 255.255.255.255 gw 91.xxx.xxx.xxx vmbr1
#Used by my lxfc container on proxmox
auto vmbr2
iface vmbr2 inet static
address 192.168.0.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
#NAT
iptables -t nat -A POSTROUTING -s '192.168.0.1/24' -o vmbr1 -j MASQUERADE
iptables -t nat -D POSTROUTING -s '192.168.0.1/24' -o vmbr1 -j MASQUERADE
Мой контейнер настроен на:
IPv4: 192.168.0.2/24
GW: 192.168.0.1
Но когда я пытаюсь пинговать google.com, он говорит
ping: google.com: Temporary failure in name resolution