Ubuntu LXC Port Forwarding

2012-06-28 20:37:00 +0000

So you have a service running in an LXC container behind a bridge, and you need ports forwarded for that service. In this case, we'll use Minecraft as an example, which runs on port 25565. Our container's IP is

sudo iptables -t nat -I PREROUTING -p tcp -d $PUBLICIP --dport 25565 -j DNAT --to
sudo iptables -A FORWARD -p tcp -d --dport 25565 -j ACCEPT
comments powered by Disqus