RancherOS Networking

Hi All,

First I would like to appreciate its a very great work.

How could I can assign my routeable ip address to the docker0 interface of rancheros so that the containers I create can access directly without port forwarding to the base host.

For example If I would like to host multiple apache for the customer and want to access directly of my network routeable ip address,

docker0 is a bridge interface.

If you’re interested in routing to a container using the host’s ip address, then you should start the container in host networking mode. In this mode, the container inherits the host’s networking stack. You can specify it under the “networking” tab while starting a new container using rancher UI.

This options really didn’t help me out since it will refer to the base host of the ip address.

I really want real network routeable IP address to my container.

For example:

My RancherOS eth0 192.168.100.2 Netmask 255.255.255.0 GW 192.168.100.1

Now I want docker0 to be 192.168.100.3 I tried with below command.

sudo ros config set user_docker.extra_args [–fixed-cidr,192.168.100.0/24]
sudo ros config set network.interfaces.docker0.address 192.168.100.3/24
sudo ros config set network.interfaces.docker0.bridge true

After I reboot the machine and I could not able to access it docker interface or could not able to ping from the network.

      In that case How do I perform the same scenario in RancherOS

https://jpetazzo.github.io/2013/10/16/configure-docker-bridge-network/

ip link set dev docker0 down
ip link add br0 type bridge
ip addr add 192.168.101.10/24 dev br0
ip link set br0 up
docker -d -b br0

How to set bridge mode on RancherOS.

If I follow the same the behaviour is strange.

The simple thing each container should get ip address from my route ip address

Any solution to use a host bridge interface instead of the default docker0 with RancherOS?

Any solution to use a host bridge interface instead of the default docker0 with RancherOS?

docker network with macvlan driver is the solution :wink: Use host interface via docker macvlan network works fine. With and without using a vlan tag.

how can i add a service to a macvlan in the rancher gui?

You should ask this in the Rancher forums. This issue just applies to RancherOS.