Accessing web service running inside container

tothp9910

New Member
Oct 5, 2023
1
1
1
Hello.

I've run into a problem with my container, namely that I cannot access the Apache2 service running inside it.

I'm running Proxmox on an ARM virtual machine that is being hosted under Oracle Cloud Infrastructure. I used these two tutorials (https://frank-ruan.com/2023/03/18/installing-proxmox-ve-on-oci/ and https://frank-ruan.com/2023/06/24/configuring-network-for-proxmox-ve-on-oci-arm/) to get it working as I know Proxmox doesn't officially support ARM. Everything works well, my container has internet access and I've succesfully installed Apache2 on it, however when I try to access it through the instance's public IP, I get the "ERR_CONNECTION_REFUSED" message in my browser.

My node /etc/network/interfaces looks like this:

Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s6
iface enp0s6 inet static
        address 10.0.0.179/24
        gateway 10.0.0.1

auto vmbr0
iface vmbr0 inet static
        address 10.10.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.10.0.0/24' -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.10.0.0/24' -j MASQUERADE
        post-up iptables -t nat -A PREROUTING -p tcp -d [the instance's public IP] --dport 8080 -j DNAT --to-destination 10.10.0.2:80
        post-down iptables -t nat -A PREROUTING -p tcp -d [the instance's public IP] --dport 8080 -j DNAT --to-destination 10.10.0.2:80

        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

I'm not sure if there are any other config files needed to troubleshoot this but if there are I'm happy to show them in the comments.

From my understanding based on the original tutorial I used and this wiki page (https://wiki.openvz.org/Using_NAT_for_container_with_private_IPs), as the container doesn't get its own public IP the masquerading allows it to use the instance's public IP to reach the internet, and I should be able to reach Apache by going to [the instance's public IP]:8080, however this doesn't seem to work.

If I install Apache on the node I can access it just fine so I know it's not a firewall issue.

I thought about using ip route to try and solve it but I'm not 100% sure how that would work.

If anyone has a solution or even just a hunch about how this could be solved I'd be glad to hear it as I need this for a project I'm working on and it feels like I've looked everywhere already, even e-mailing the tutorial's author so far I've gotten no answer.

Thanks in advance.
 
  • Like
Reactions: Jackman3005

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!