Score:0

Proxmox VE - problems in setting private network

sn flag

I have recently bought a test dedicated server from to test proxmox. The installation went smoothly; however, I get stuck in the network configurations.

My Use case-

I want to create 8 LXC containers and run our 6 microservices, Nginx and Mysql server on them. I want to get internet traffic to nginx server and rest it should connect over private network. So I need to create a private network and is where I am stuck. And to inform that I not networking expert, just know basics whom tutorial always helped, but not this time. I have done changes in /etc/network/interfaces, as per the section ‘Masquerading (NAT) with iptables’ of proxmox wiki’s Networking Configurations article

This is the configuration in my /etc/network/interfaces

auto enp41s0
iface enp41s0 inet static
        address 65.XXX.YYY.181/26
        gateway 65.XXX.YYY.129
        up route add -net 65.XXX.YYY.128 netmask 255.255.255.192 gw 65.XXX.YYY.129 dev enp41s0
# route 65.XXX.YYY.128/26 via 65.XXX.YYY.129

iface vmbr0 inet static
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        address 10.10.10.1/24
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/26' -o enp41s0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/26' -o enp41s0 -j MASQUERADE

Restarting networking after these changes does not throw any errors.

This is the error in proxmox admin panel, when I try to start the newly created LXC container

run_buffer: 314 Script exited with status 25
lxc_create_network_priv: 3068 No such device - Failed to create network device
lxc_spawn: 1786 Failed to create the network
__lxc_start: 1999 Failed to spawn container "101"
TASK ERROR: startup for container '101' failed
Score:0
sn flag

To create a private network and have it NAT to the public interface, add the following configurations to the /etc/network/interfaces (keep the backup of original)

Updated the network bridge vmbr0 and allowed it to use internet traffic Created new network bridge vmbr1 and used for internal networking between containers

auto lo
iface lo inet loopback
iface lo inet6 loopback
auto enp41s0
iface enp41s0 inet manual (prev value static)

Commented this line
#       up route add -net 65.XXX.XXX.128 netmask 255.255.255.192 gw 65.XXX.XXX.129 dev enp41s0

Bridge that handles internet traffic

iface vmbr0 inet static
address 65.XXX.XXX.181/26
gateway 65.XXX.XXX.129
bridge-ports enp41s0
bridge-stp off
bridge-fd 0

Bridge that is used by the internal running services

auto vmbr1
iface vmbr1 inet static
address 10.10.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
#Bridge network to NAT to vmbr1, uses 10.10.10.0/24 network
#
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE

And thankfully I am able to use all microservices , efficiently.

Hope this helps to someone

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.