Skip to content

Proxmox

Setting up Proxmox with Birdged Networking (NATed)

I installed Proxmox on my server through Online.net's management console. Instead of using Failover IPs, I used second bridge and private network (10.10.10.0/24), we could also use default KVM's NAT but it they doesn't work well with iptables.

Setting Hostname and Nginx

Before anything, setting hostname is important.

# nano /etc/hostname
abc

# nano /etc/hosts
x.x.x.x  abc.domain.com abc

# /etc/init.d/hostname.sh start

Test using hostname --fqdn.

Regnerate certificates and restart proxmox

# pvecm updatecerts 
# service pve-cluster restart
# service pveproxy restart

If you had added hosts already then move the CTs/VMs to the newly made folder: # mv /etc/pve/nodes/oldhostname/openvz/* /etc/pve/nodes/newhostname/openvz/

Use Nginx as a reverse proxy

Update /etc/default/pveproxy

# nano /etc/default/pveproxy
ALLOW_FROM="127.0.0.1"
DENY_FROM="all"
POLICY="allow"

Update /etc/nginx/conf.d/proxmox

# nano /etc/nginx/conf.d/proxmox
upstream proxmox { server 127.0.0.1:8006; }
    proxy_redirect off;
    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass https://proxmox;
    }

Further Info

https://pve.proxmox.com/wiki/Web_Interface_Via_Nginx_Proxy
https://pve.proxmox.com/pve-docs/pveproxy.8.html

Bridge Configuration

On Proxmox host

auto vmbr0
iface vmbr0 inet static
    address x.x.x.x         #External IP assigned by Online.net
    netmask 255.255.255.0
    gateway x.x.x.1         #Default gateway
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0

iface vmbr1 inet static
    address 10.10.10.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
        post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE

On KVM Guest:

Set the /etc/resolv.conf

nameserver 8.8.8.8

Set /etc/network/interfaces

auto eth0
iface eth0 inet static
   address 10.10.10.101     #Assigning IP manually
   netmask 255.255.255.0
   network 10.10.10.0
   broadcast 10.10.10.255
   gateway 10.10.10.1

And set the guest VM to use vmbr1 through Proxmox and restart networking. Solution found at LinuxProblem.org.

Bridge interface

To bringe down and delete bridge interface:

# ip link set br100 up
# ip link set br100 down
# brctl delbr br100

For Forwarding Ports

Troubleshooting Streisand inside Proxmox (KVM/QEMU).

References

Back to top