Allow specifying of HOST_IP
whs opened this issue · 4 comments
I'm running Rancher in vagrant environment. As vagrant has a hard requirement that the first NIC is NAT interface, the public interface will never be the first one.
I've seen a mention of HOST_IP
at https://github.com/y8/rancher-localroute/blob/master/iptables-poller#L116 . Is that implemented? I tried spawning a container with HOST_IP
env set but it still use the first interface address.
Hi.
Ooppsie, yeah, HOST_IP
is not implemented yet. But seems like it's also a good idea to make it possible to set the interface name?
Okay, we're bumped in few other related cases, so I'm going this way:
- You can explicitly set the
POLLER_HOST_IP
with 1 or more IP addresses separated by ','. - You can set an interface name with
POLLER_IFACE
, then all ip's available on this interface will be used to populate iptables, likePOLLER_IFACE=eth0
. - If this this variables are not set, then the first non
lo
interface will be used.
I'll push the updated version a bit later tomorrow.
Also, if no POLLER_HOST_IP
given, we should poll selected interface for IP changes as well.
Version 0.2.0 released, upgrade to the yopp/rancher-localroute:0.2.0
for the fix.
In your case just set the POLLER_IFACE
to the name of the Vargant interface.