Bobcares

Create Private Network Bridge on Proxmox VE 6 with NAT

by | May 14, 2021

Wondering how to Create Private Network Bridge on Proxmox? We can help you.

Proxmox is a great platform to create virtual machines and containers.

We can use it to easily migrate instances to other connected nodes.

As part of our Server Management Services, we assist our customers with several Promox queries.

Today, let us discuss Private Network Bridge on Proxmox VE 6 with NAT

 

Create Private Network Bridge on Proxmox

In Proxmox virtualization infrastructure, we can do the network configuration in two ways:

  • Via the CLI (manually editing network configuration files)
  • From an intuitive graphical user interface.

We can choose either method. However, the choice depends on our Linux administration expertise.

Create Virtual Network Bridge on Proxmox With NAT

For the CLI method, we edit /etc/network/interfaces configuration files directly:

$ sudo vim /etc/network/interfaces

We create a virtual network bridge based on the below network parameters:

  • Network: 192.168.48.0
  • Network mask: 255.255.255.0
  • Proxmox host IP: 192.168.48.1

Then we print current active network interfaces on the server:

$ sudo ip -f inet a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
inet 192.168.58.236/26 brd 195.201.58.255 scope global enp4s0
valid_lft forever preferred_lft forever

On the other hand, we create a virtual bridge named vmbr1:

auto vmbr1
iface vmbr1 inet static
address 192.168.48.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0

Here, we can see that there is no physical interface that links to the bridge.

Configure NAT (Masquerading)

Masquerading allows VMs in a private network to access the external networks. It is possible by using the host IP address for outgoing traffic.

iptables rewrite each outgoing packet to appear as originating from the host. In addition, it rewrites the responses accordingly to route to the original sender.

Moving ahead, we will modify the above network configurations to add routing for internet connectivity.

Since primary interface enp4s0 connects to the physical switch and has internet connectivity, we route traffic coming from vmbr1 through it.

auto vmbr1
iface vmbr1 inet static
address 192.168.48.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.48.0/24’ -o enp4s0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s ‘192.168.48.0/24’ -o enp4s0 -j MASQUERADE

Here, enp4s0 can replace with a VLAN interface or another Linux bridge.

Bring up the bridge interface

We can validate those network configurations by manually bringing up the bridge interface.

$ sudo ifup vmbr1
Waiting for vmbr1 to get ready (MAXWAIT is 2 seconds).

Then we check the bridge IP information:

$ ip address show dev vmbr1
3: vmbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 16:cf:7e:23:de:1e brd ff:ff:ff:ff:ff:ff
inet 192.168.48.1/24 brd 192.168.50.255 scope global vmbr1
valid_lft forever preferred_lft forever
inet6 fe80::14cf:7eff:fe23:de1e/64 scope link
valid_lft forever preferred_lft forever

From the output, we can see that the IP address on the vmbr1 is correct.

Then we should be able to restart the networking service without any failures:

$ sudo systemctl restart networking

Eventually, we confirm the status is active:

$ systemctl status networking.service
● networking.service – Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2021-05-07 19:27:34 CEST; 29s ago
Docs: man:interfaces(5)
Process: 27355 ExecStart=/sbin/ifup -a –read-environment (code=exited, status=0/SUCCESS)
Main PID: 27355 (code=exited, status=0/SUCCESS)

May 07 19:27:29 proxmox systemd[1]: Starting Raise network interfaces…
May 07 19:27:34 proxmox ifup[27355]: Waiting for DAD… Done
May 07 19:27:34 proxmox ifup[27355]: Waiting for vmbr1 to get ready (MAXWAIT is 2 seconds).
May 07 19:27:34 proxmox systemd[1]: Started Raise network interfaces.

Once we create a Virtual machine on the bridge, it will behave as if it directly connects to the physical network.

The network, in turn, sees each virtual machine as having its own MAC, even though there is only one network cable connecting all of these VMs to the network.

[Need help with the procedures? We are here for you]

 

Conclusion

In short, we saw an effective method our Support Techs employ to create a Private Network Bridge on Proxmox.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF