On 16.02.2011 13:44, [email protected] wrote:

> On one machine I do a
>
> "up ip addr add x.x.x.x/y dev eth0:1"
>
> in my /etc/network/interfaces after bringing up eth0 with the first, also 
> static, ip (because - well I like to have a second address for some services 
> there).
>
> Now in my cfengine I would need to access the "first" address on eth0, or at 
> least (even better) being able to distinguish between multiple ip addresses 
> on one interface...
>
> sys.ipv4 results in the address of eth0:1 though and getindices("sys.ipv4")
> only shows me "eth0"

Actually sys.ipv4 array is kind of simplistic, given there might be 
several IPv4 (not even mentioning IPv6 situation) addresses on single 
interface (think Zeroconf 169.254.0.0/16).

ethX:Y notation is mostly a syntactic sugar kept around in Linux to 
avoid breaking old userspace tools/scripts, 'ip a s' will give actual 
results.

Unfortunately I don't have any good solution yet. Maybe deprecating 
sys.ipv4 and introducing another (adequate) variable? We'll see.

-- 
Mikhail Gusarov
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to