|
From: <ca...@gm...> - 2011-05-19 17:01:04
|
Hello, At my site I can find the vlan information in the port field of device_ip table. Given an IP address I can get the VLAN info as follows: p (node_ip) -> mac (node) -> switch (device_ip) -> port My desire is to correlate subnets with vlans. I've experimented, as follows, but the "least" function doesn't give me 1 IP in the net. select net as "Subnet", power(2, (32-masklen(net))) as "Subnet size", ip as "One IP in range" from subnets, node_ip where least(ip <<= net) group by net,ip order by 2 desc, net; If anyone knows how to extract just 1 IP from a subnet in this query I'd very much appreciate it! Thanks! |