Single IP - LXC Ubuntu 22.04 - no Internet - SOLVED

Wolkegerm

New Member
Sep 5, 2024
15
1
3
Hi,

i am an absolute noob.
I have a server at "not true" IP: 188.88.88.88
There i installed Proxmox.
So there is a vmbr ens3 with CIDR 188.88.88.88/22 and Gateway 188.88.87.1

I created a container with Ubuntu 22.04 and i want this CT to be able to talk with the internet.
I cannot update / upgrade / install anything at this CT and I definitely need help.

1 need a step by step installation guide. Thx :)

King regards
Wolke

Wie gesagt: Hautproblem ist, dass ich den Container einfach nicht ins Netz bekomme. Sonst kann ich darauf ja nix machen :/

Antwort gern auch auf Deutsch ;)
Lg
 
Last edited:
Hi, du hast dem LXC eine richtige IP und auch einen funktionierenden DNS mitgegeben?
 
Hi,

i am an absolute noob.
I have a server at "not true" IP: 188.88.88.88
There i installed Proxmox.
So there is a vmbr ens3 with CIDR 188.88.88.88/22 and Gateway 188.88.87.1

I created a container with Ubuntu 22.04 and i want this CT to be able to talk with the internet.
I cannot update / upgrade / install anything at this CT and I definitely need help.

1 need a step by step installation guide. Thx :)

King regards
Wolke

Wie gesagt: Hautproblem ist, dass ich den Container einfach nicht ins Netz bekomme. Sonst kann ich darauf ja nix machen :/

Antwort gern auch auf Deutsch ;)
Lg
Poste evtl. mal deine Netzconfig vom PVE, vllt ist dir da was durchgerutscht.

Meine (einfache) Netzkonfig schaut wie folgt aus:


Code:
auto lo
iface lo inet loopback

iface enp0s31f6 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.10.0.12/24
        gateway 10.10.0.1
        bridge-ports enp0s31f6
        bridge-stp off
        bridge-fd 0


Mein LXC Container sieht dann Folgendermaßen aus:
1725572674590.png1725572871767.png

Ich hoffe das hilft dir mal so weiter, wenn nicht, meld dich gern.
Wie gesagt, super super simple, und auch nicht best practise :)
 
Poste evtl. mal deine Netzconfig vom PVE, vllt ist dir da was durchgerutscht.

Meine (einfache) Netzkonfig schaut wie folgt aus:


Code:
auto lo
iface lo inet loopback

iface enp0s31f6 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.10.0.12/24
        gateway 10.10.0.1
        bridge-ports enp0s31f6
        bridge-stp off
        bridge-fd 0


Mein LXC Container sieht dann Folgendermaßen aus:
View attachment 74311View attachment 74312

Ich hoffe das hilft dir mal so weiter, wenn nicht, meld dich gern.
Wie gesagt, super super simple, und auch nicht best practise :)
Du hast die Einstellung auf DHCP. Muss ich da nicht noch einen DHCP Server auf dem VPS installieren?
 
Versuche es mal mit -o vmbr0

Vor dem anwenden der Konfiguration wird es notwendig sein die NAT regeln zu flushen, da ansonsten die alte Regel bestehen bleibt:
Code:
iptables -t nat -F

Wenn die Firewall verwendet wird, dann sind noch folgende Befehle zusätzlich notwendig:
Code:
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
 
  • Like
Reactions: InZaneDanii
Habs mit Eurer Hilfe lösen können:

#https://blog.jenningsga.com/private-network-with-proxmox/

Code:
auto lo
iface lo inet loopback

iface ens3 inet manual

auto vmbr0
iface vmbr0 inet static
        address  188.68.49.187/22
        gateway 188.68.48.1
        netmask  255.255.255.0
        bridge-ports ens3
        bridge-stp off
        bridge-fd 0

auto vmbr1
#private sub network
iface vmbr1 inet static
        address  10.10.10.1/24
        netmask  255.255.255.0
        bridge_ports none
        bridge_stp off
        bridge_fd 0

        # Masquerading (NAT) with iptables
        # Masquerading allows guests having only a private IP address to access the network by using the host IP address for outgoing traffic. Each outgoing packet is rewritten by iptables to appear as originating from the host, and responses are rewritten accordingly to be routed to the original sender.
        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
        
        # https://pve.proxmox.com/wiki/Network_Configuration
        # In some masquerade setups with firewall enabled, conntrack zones might be needed for outgoing connections. Otherwise the firewall could block outgoing connections since they will prefer the POSTROUTING of the VM bridge (and not 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

Wichtige Hinweise von Euch waren die iptables vorallem mit vmbr0 und das Masquerading mit Firewall.
Der Knackpunkt war die Netmask, damit die Subnetze untereinander sprechen können.
 
  • Like
Reactions: InZaneDanii

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!