I'm trying to create a docker server using rancher on local network ( with many machines, some linux, some windows ). I had installed rancher-server, created a host, added an API to test and created a load balancer to registry this API. Locally, works fine, i can acess the API container like : "http://test.172.17.0.4.xip.io:3000/", but in others machines in my network, i cant acess..
PS:test
-> API name172.17.0.4
-> Ip of HOST machine docker ( with rancher-agent )xip.io
-> public wildcard DNS ( see more in : http://xip.io/ )3000
-> API port mapped in load balancer
I'vd tryed to change network of the container in rancher UI, didn't work, i read some things about create a docker network, but i'm a bit confused, cuz docker create a defaut netdocker, docker0, is an bridge network.. I'm a little lay in network matters.
EDIT:
I created macvlan using docker network, and now i can ping to my container using others machines, but now, i my container dont have internet connection to download things.
docker network create -d macvlan --subnet=172.16.108.0/26 --gateway=172.16.108.1 -o macvlan_mode=bridge -o parent=enp1s0 rancher
and tried to run a container in this network
EDIT2:
This ifconfig
output
docker0: flags=4099 mtu 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:79:4f:fc:66 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp1s0: flags=4163 mtu 1500 inet 172.16.108.1 netmask 255.255.255.192 broadcast 172.16.108.63 inet6 fe80::593f:24d0:31f2:4fd8 prefixlen 64 scopeid 0x20 ether d0:94:66:a5:29:8f txqueuelen 1000 (Ethernet) RX packets 1251 bytes 1024069 (1000.0 KiB) RX errors 0 dropped 5 overruns 0 frame 0 TX packets 980 bytes 157904 (154.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Loopback Local) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
EDIT3:
I tried to specify the ip adress passing the flag --address when start rancher and/or the host, and the result are the same: unknown flag: --address
the commands i tried to do are:
docker run -d --restart=unless-stopped --address 172.16.108.63 -p 8080:8080 rancher/server
To start rancher server. I tried with macvlan too
docker run --privileged --name some-docker1 --address 172.16.108.63 -d docker:stable-dind
To start rancher machine ( to be the future host )
And i tried the same command above, but without the --address. Then, attached in shell of the container, i tried to create the host
docker run -e CATTLE_AGENT_IP="172.17.0.3" --rm --privileged --address 172.16.108.63 -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher ran
cher/agent:v1.2.11 http://172.17.0.2:8080/v1/scripts/3FA0E7B767770264BCAD:1546214400000:P9NfsauqyhZpoeIBgGyCZIHkKtE
The results are the same..
RESUME: I'm trying to create a rancher-server in my local network to access the applications in my load balancer from other machines in the same network.
ip addr
ofifconfig
if running a linux host and check for the IP address of the network interface. Something likeeth0
orens1
etc. – leodotcloud