Cannot add a new custom host [noob]

I am using the rancher image on docker using ssh onto a local machine. On adding a new custom host, although the terminal command gets executed successfully, I still cannot see a host in the ui.

Terminal command:
INFO: Running Agent Registration Process, CATTLE_URL=http://192.168.0.245:8080/v1
INFO: Attempting to connect to: http://192.168.0.245:8080/v1
INFO: http://192.168.0.245:8080/v1 is accessible
INFO: Inspecting host capabilities
INFO: Boot2Docker: false
INFO: Host writable: true
INFO: Token: xxxxxxxx
INFO: Running registration
INFO: Printing Environment
INFO: ENV: CATTLE_ACCESS_KEY=9121D08FDAA582472494
INFO: ENV: CATTLE_AGENT_IP=172.17.0.1
INFO: ENV: CATTLE_HOME=/var/lib/cattle
INFO: ENV: CATTLE_REGISTRATION_ACCESS_KEY=registrationToken
INFO: ENV: CATTLE_REGISTRATION_SECRET_KEY=xxxxxxx
INFO: ENV: CATTLE_SECRET_KEY=xxxxxxx
INFO: ENV: CATTLE_URL=http://192.168.0.245:8080/v1
INFO: ENV: DETECTED_CATTLE_AGENT_IP=172.17.0.1
INFO: ENV: RANCHER_AGENT_IMAGE=rancher/agent:v1.2.9
INFO: Deleting container rancher-agent
INFO: Launched Rancher Agent: 82975eb8fc6d160f82044059ea1e4750437c8b89d15c5a5b6b51bf52cfb7cd3e

I tried looking at the network logs and found something fishy.

SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/veth9ffc129, iface: veth9ffc129)
SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/veth9ffc129, iface: veth9ffc129): no ifupdown configuration found.
/sys/devices/virtual/net/veth9ffc129: couldn’t determine device driver; ignoring…
SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/veth43019fe, iface: veth43019fe)
SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/veth43019fe, iface: veth43019fe): no ifupdown configuration found.
/sys/devices/virtual/net/veth43019fe: couldn’t determine device driver; ignoring…
SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/veth43019fe, iface: veth43019fe)
SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/veth6859145, iface: veth6859145)
SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/veth6859145, iface: veth6859145): no ifupdown configuration found.
/sys/devices/virtual/net/veth6859145: couldn’t determine device driver; ignoring…
SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/veth6ecf8a1, iface: veth6ecf8a1)
SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/veth6ecf8a1, iface: veth6ecf8a1): no ifupdown configuration found.
/sys/devices/virtual/net/veth6ecf8a1: couldn’t determine device driver; ignoring…
SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/veth6859145, iface: veth6859145)
SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/veth6859145, iface: veth6859145)
SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/veth6859145, iface: veth6859145): no ifupdown configuration found.
/sys/devices/virtual/net/veth6859145: couldn’t determine device driver; ignoring…
SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/veth6859145, iface: veth6859145)
SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/veth6ecf8a1, iface: veth6ecf8a1)
SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/veth43019fe, iface: veth43019fe)
SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/veth43019fe, iface: veth43019fe): no ifupdown configuration found.
/sys/devices/virtual/net/veth43019fe: couldn’t determine device driver; ignoring…
SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/veth9ffc129, iface: veth9ffc129)
SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/veth43019fe, iface: veth43019fe)

my ifconfig:
docker0 Link encap:Ethernet HWaddr 02:42:46:53:ba:9e
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
inet6 addr: fe80::42:46ff:fe53:ba9e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63280 errors:0 dropped:0 overruns:0 frame:0
TX packets:86371 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:39783195 (39.7 MB) TX bytes:21754149 (21.7 MB)

eth0 Link encap:Ethernet HWaddr fc:aa:14:ca:c3:b2
inet addr:192.168.0.245 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::feaa:14ff:feca:c3b2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4772885 errors:0 dropped:0 overruns:0 frame:0
TX packets:1196959 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2133670702 (2.1 GB) TX bytes:150488068 (150.4 MB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:193600 errors:0 dropped:0 overruns:0 frame:0
TX packets:193600 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24754141 (24.7 MB) TX bytes:24754141 (24.7 MB)

veth3206707 Link encap:Ethernet HWaddr 2a:d9:2a:3f:94:48
inet6 addr: fe80::28d9:2aff:fe3f:9448/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:2882 (2.8 KB)

veth30b9e58 Link encap:Ethernet HWaddr 86:58:42:1a:37:c2
inet6 addr: fe80::8458:42ff:fe1a:37c2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:364 errors:0 dropped:0 overruns:0 frame:0
TX packets:628 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:43392 (43.3 KB) TX bytes:154520 (154.5 KB)

veth3d08070 Link encap:Ethernet HWaddr b2:65:28:c6:6f:21
inet6 addr: fe80::b065:28ff:fec6:6f21/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:2255 errors:0 dropped:0 overruns:0 frame:0
TX packets:2507 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2772554 (2.7 MB) TX bytes:3095821 (3.0 MB)

vetha8128c2 Link encap:Ethernet HWaddr 6a:0f:7f:ce:98:83
inet6 addr: fe80::680f:7fff:fece:9883/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:1633 errors:0 dropped:0 overruns:0 frame:0
TX packets:1836 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:108743 (108.7 KB) TX bytes:3041980 (3.0 MB)

vetha8a70bd Link encap:Ethernet HWaddr b6:be:d7:de:12:b0
inet6 addr: fe80::b4be:d7ff:fede:12b0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:367 errors:0 dropped:0 overruns:0 frame:0
TX packets:628 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:43574 (43.5 KB) TX bytes:154574 (154.5 KB)

vethb3769a9 Link encap:Ethernet HWaddr ba:fb:9d:d2:9c:09
inet6 addr: fe80::b8fb:9dff:fed2:9c09/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:45172 errors:0 dropped:0 overruns:0 frame:0
TX packets:64154 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27046990 (27.0 MB) TX bytes:7297179 (7.2 MB)

vethcc8eed2 Link encap:Ethernet HWaddr a6:d0:76:83:ec:2e
inet6 addr: fe80::a4d0:76ff:fe83:ec2e/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:1538 errors:0 dropped:0 overruns:0 frame:0
TX packets:1765 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:101248 (101.2 KB) TX bytes:2942204 (2.9 MB)

I tried using the dockerIP, and the eth0IP when creating a custom host.

Any help will be greatly appreciated.

Thanks.

It looks like this might be the problem. On your host, you are using a 172.17 address, but your Rancher server is using a 192.168 network. What is the docker run command you are using on the host? Do you specify the CATTLE_IP option as the 192 IP?

the docker command to run the server:
sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server

and to run the host (on the same machine as the server):
sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.9 http://192.168.0.245:8080/v1/scripts/D4F0919FFDBE5BD81B10:1514678400000:2QwlDn0meNJruDZfIw8BLtH8aY