GithubHelp home page GithubHelp logo

proxmox-bridge-nat's Introduction

Virtual Network Setup Guide for Proxmox

This guide will walk you through the process of setting up a Linux bridge and configuring network settings using Proxmox WebUI.

Step 1: Create a Linux Bridge and Assign IP using Proxmox WebUI

Create a Linux bridge with the name vmbr1 and assign it the IP address 10.0.0.1/24.

Step 2: Edit /etc/network/interfaces

Edit the /etc/network/interfaces file and add the following lines under your virtual bridge vmbr1. Make sure to adjust the values according to your specific configuration:

post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
post-up   iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

The entire interface configuration should look like this:

auto lo
iface lo inet loopback

iface enp30s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.29.5/24
        gateway 192.168.29.1
        bridge-ports enp30s0
        bridge-stp off
        bridge-fd 0
auto vmbr1
iface vmbr1 inet static
        address 10.0.0.1/24
        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.0.0.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
        post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
        post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

Step 3: Enable IP Forwarding

Edit the file /etc/sysctl.conf and add or uncomment the following line to enable IP forwarding:

net.ipv4.ip_forward=1

Then, run the following command to apply the changes:

sysctl -p

Step 4: Save the IPTables Configuration Save the IPTables configuration by running the following commands:

iptables -t nat -A POSTROUTING -o vmbr0 -j MASQUERADE
iptables-save | tee /etc/iptables/rules.v4

Step 5: Reboot

Reboot your system to apply the changes. That's it! Your Linux bridge setup is now complete.

proxmox-bridge-nat's People

Contributors

mrankitvish avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.