How do I get my Proxmox VM to access the internet without a public IP address

22,581

Solution 1

You have to use NAT (network address translation/masquerading) to provide private IPv4 addresses for your virtual machines. The Proxmox wiki has instructions on how to set this up.

Or you can just go get IPv6; your ISP will probably be more than happy to give it to you (if they have it yet).

Solution 2

I followed the advice of micael hampton and was able to fix it by:

1: copy /etc/network/interfaces' to/etc/network/interfaces.new'

2: add the following code to my local ip interface at vmbr0:1

post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up   iptables -t nat -A POSTROUTING -s '192.168.100.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.100.0/24' -o vmbr0
Share:
22,581

Related videos on Youtube

DiverseAndRemote.com
Author by

DiverseAndRemote.com

#SOreadytohelp .

Updated on September 18, 2022

Comments

  • DiverseAndRemote.com
    DiverseAndRemote.com about 1 year

    I would like to create a proxmox vm and have that vm be able to ping/access external websites without having to assign a public ip to it. How do I do this?

    The VM is running centos 6

    • Deb
      Deb about 11 years
      This is w-a-y too general to be answered. On what are you running (or intend to run) the VM? What kind of Internet access does whatever it is have access to?
    • Paul
      Paul about 11 years
      A public IP is all that normal external websites will talk to. Even if you share it with thousands of other devices through address translation, your VM will need to appear at a public IP.
    • DiverseAndRemote.com
      DiverseAndRemote.com about 11 years
      @sysadmin1138 The VM is running centos 6
  • Michael Hampton
    Michael Hampton about 11 years
    Be sure to ask your ISP or hosting provider for IPv6. :)