Cannot access dockers through mapped ports on RancherOS

I must be doing something really dumb, or missing something painfully simple; but I have RancherOS deployed to bare metal with a single private IP address. I can SSH into the machine from another machine in the network without any issue.

However, I cannot seem to access any docker container through its mapped ports, and I have no idea why. below is the cloud-config.yml I used to deploy the host (except for ssh keys).

Any help on what stupid mistake I’m making is greatly appreciated.

#cloud-config
hostname: bilbo
console: ubuntu
rancher:
  resize_device: /dev/sda
  network:
      dns:
      nameservers:
        - 192.168.1.1
        - 8.8.8.8
        - 8.8.4.4
      interfaces:
          eth0:
              address: 192.168.1.13/24
              gateway: 192.168.1.1
              mtu: 1500
              dhcp: false
ssh_authorized_keys:
  - ssh-rsa <redacted>

Assuming you did map the outside port (i.e. -p 8080:8080) you can check if the appropriate iptables rules are created using iptables -L -n -t nat | grep 8080.

I’ve seen this a lot on environments with wrongly configured MTU.

Thanks Superseb; I’m pretty sure the rules show up in IPTables I’ll double-check tonight and post a screenshot if I can.

the MTU is a possibility, since frankly I don’t understand it and I just copied the example on that one. I’ve seen some guides to determine the correct value so I’ll run through that and see what happens.

Turns out I was just being dumb; its not that I can’t access any containers, but the test container I made I forgot to map the ports. The Rancher container I’m TRYING to run though isn’t working but looking closely it seems to be failing and rebooting; but I’ll start a new thread for that.

1 Like