Steven Alexander
Steven Alexander

Reputation: 11

Unable to connect to LXC plex container in Proxmox through public IP address

I have a cloud server running Proxmox with a LXC plex container connected to vmbr1 with IP address 10.0.0.2/24. I'm trying to connect to the Plex GUI through http://:32400/web but I can't even ping the VM at 10.0.0.2 from the Proxmox shell. My interfaces configuration is below. Do i have it configured incorrectly?

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eno0
iface eno0 inet static
    address <Public IP>
    netmask <Public IP netmask>
    gateway <Public IP gateway>

    # Enable IP Forwarding
    post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    post-down echo 0 > /proc/sys/net/ipv4/ip_forward

    # NAT Configuration
    post-up iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
    post-up iptables -A INPUT -p tcp -m tcp --dport 8006 -j ACCEPT
    post-up iptables -A INPUT -s 10.0.0.0/24 -j ACCEPT
    post-up iptables -A INPUT -p tcp --dport 32400 -j ACCEPT
    post-up iptables -t nat -A PREROUTING -i eno0 -p tcp --dport 32400 -j DNAT --to-destination 10.0.0.2:32400
    post-up iptables -t nat -A POSTROUTING -o eno0 -s 10.0.0.0/24 -j SNAT --to-source <Public IP>
    post-up iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

    # Clean up rules on interface down
    post-down iptables -D INPUT -p tcp -m tcp --dport 22 -j ACCEPT
    post-down iptables -D INPUT -p tcp -m tcp --dport 8006 -j ACCEPT
    post-down iptables -D INPUT -s 10.0.0.0/24 -j ACCEPT
    post-down iptables -D INPUT -p tcp --dport 32400 -j ACCEPT
    post-down iptables -t nat -D PREROUTING -i eno0 -p tcp --dport 32400 -j DNAT --to-destination 10.0.0.2:32400
    post-down iptables -t nat -D POSTROUTING -o eno0 -s 10.0.0.0/24 -j SNAT --to-source <Public IP>
    post-down iptables -D INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

auto vmbr0
iface vmbr0 inet static
    address <Public IP>/27
    gateway <Public IP Gateway>
    bridge-ports eno0
    bridge-stp off
    bridge-fd 0

auto vmbr1
iface vmbr1 inet static
    address 10.0.0.1
    netmask 255.255.255.0
    bridge-ports none
    bridge-stp off
    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

Upvotes: 1

Views: 77

Answers (1)

T.I
T.I

Reputation: 21

Have you tried the ping without any IPTABLES rules in place, only vmbr1 selected and just the default NAT config in proxmox ?

What are you trying to do with the auto vmbr0 and vmbr1 rules ?

I did have a similar setup a while ago, however I don't remember using any firewall rules or similar. Selecting the bridge (vmbr1 in your case) along with DHCP routing in the Network section should do the job.

Upvotes: 0

Related Questions