Skip to content

Instantly share code, notes, and snippets.

Last active Jul 17, 2021
What would you like to do?
VPS Proxmox


  • Make a VPS instance. This shouldn have atleast 2 cores and 4gb RAM, 8GB is recomended.
  • Get the public IP/mask and gateway, as well as the MAC address of the interface, if you have private networking, get that info too.
  • Log into control panel of the VPS and find the where the ISO can be set chose proxmox.
  • Reboot the VPS and make a VNC connection via the control panel.
  • Install proxmox with all defualt settings, when it requests netowking info, use the public info from above.
  • When you are in proxmox, perform a update and get everthing upto date.
  • Add a ubuntu 20.04 template for LXC use.
  • Make a LXC container called router.
  • In the router container, enable IP forwarding:
    sysctl -w net.ipv4.ip_forward=1


  • Internal IP network,
    • Proxmox vmbr0
    • Router, LXC 100 net1 eth1
    • Proxy, LXC 101, net0 eth0
    • Any other IP in 10.1.x.x is fine to use for containers.
arch: amd64
cores: 3
hostname: router
memory: 1024
net1: name=eth1,bridge=vmbr0,firewall=1,hwaddr=BE:34:4D:15:AC:37,ip=,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-100-disk-1,size=8G
swap: 0
tty: 3
unprivileged: 1 phys up ens3 eth0

Enable forwarding

sysctl -w net.ipv4.ip_forward=1

netplan YAML, /etc/netplan/99-wan.yaml

  version: 2
  renderer: networkd
          addresses: [,]

IP table rules

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to
iptables -A FORWARD -p tcp -d --dport 80 -j ACCEPT

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j DNAT --to
iptables -A FORWARD -p tcp -d --dport 443 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment