Skip to content

Instantly share code, notes, and snippets.

@frbl
Created June 11, 2019 19:43
Show Gist options
  • Save frbl/0088379ae6bf9b15c8f93960dd232adc to your computer and use it in GitHub Desktop.
Save frbl/0088379ae6bf9b15c8f93960dd232adc to your computer and use it in GitHub Desktop.
Setting up proxmox

Bridging the internet

(source: https://cyberpersons.com/2016/07/27/setup-nat-proxmox/)

Step 1: Create a bridge

Login to your proxmox host ssh, and run:

vi /etc/network/interfaces

This is your network configuration file for proxmox, you might see one bridged interface already configured (bridged to your physical interface), paste following at the end of your configuration file

auto vmbr1
iface vmbr1 inet static
        address  192.168.1.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 '192.168.1.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE
  • vmbr1 : This is the bridge name for NAT.
  • vmbr0 : This is the interface that was already configured in your network file, adjust the name properly.
  • 192.168.1.0/24 : This will be the network we are going to use in our internal network, our usable ips in this network will be: 192.168.1.2-192.168.1.254
  • bridge_ports none : Bridge ports here is set to none, since we are not connecting to outside world directly.

You have successfully configured a NAT bridge.

Step 2: Bring up the NAT bridge

You can use this command to bring up the bridge you just created:

ifup vmbr2

Step 3: Configure Virtual Machine

As a final step configure your virtual machine to use IP address, since DHCP is not present you will have to manually set IP address. Depending upon your OS you can use following details:

- IP : 192.168.1.2
- Gateway : 192.168.1.1
- Netmask : 255.255.255.0

For further virtual machines you can use these ips:

192.168.1.3
192.168.1.4
..upto 254

For DNS you can use the cloudflare dns

1.1.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment