Not sure I can do this - I'm logging into a router and viewing config files that have sequences of IP addresses intermingled with other data - the IPs are not sequential.
I'd like to capture the IPs to a file of just a list of the IPs, preferably sorted though I can sort the file later if needed. Also have a similar desire to grab lists of MAC addresses to files.
To complicate the IP scenario a little - the IPs are all in a similar sequence, i.e. 10.x.x.x, but there are also redundant entries of 10.x.x.1 which I don't care to see at all, especially multiple times. Once is ok. But if other addresses are duplicated I do want them to show more than once. It would be ideal to also pair the MAC address with the IP.
i.e. I see things like:
...
client.... 0090.xxxx.xxxx
IP 10.x.x.x 255.255.0.0
.... 10.x.x.1....
----MORE-------
and page through multiple pages of this. I'd like to have a script capture a parsed list to a text file in a format like
10.x.x.2
10.x.x.4
10.x.x.3
and sort that if possible, and better yet pair it with the MAC address from previous line, such as
00xx.xxxx.xx01 10.x.x.3
00xx.xxxx.xxc2 10.x.x.49
00xx.xxxx.xxe7 10.x.x.7
and sort that by MAC address or IP in different variations of the script.
Is this possible? If so, can you offer any suggestions or examples to get me started down the right path?
Thanks in advance for any help you can offer.
I'd like to capture the IPs to a file of just a list of the IPs, preferably sorted though I can sort the file later if needed. Also have a similar desire to grab lists of MAC addresses to files.
To complicate the IP scenario a little - the IPs are all in a similar sequence, i.e. 10.x.x.x, but there are also redundant entries of 10.x.x.1 which I don't care to see at all, especially multiple times. Once is ok. But if other addresses are duplicated I do want them to show more than once. It would be ideal to also pair the MAC address with the IP.
i.e. I see things like:
...
client.... 0090.xxxx.xxxx
IP 10.x.x.x 255.255.0.0
.... 10.x.x.1....
----MORE-------
and page through multiple pages of this. I'd like to have a script capture a parsed list to a text file in a format like
10.x.x.2
10.x.x.4
10.x.x.3
and sort that if possible, and better yet pair it with the MAC address from previous line, such as
00xx.xxxx.xx01 10.x.x.3
00xx.xxxx.xxc2 10.x.x.49
00xx.xxxx.xxe7 10.x.x.7
and sort that by MAC address or IP in different variations of the script.
Is this possible? If so, can you offer any suggestions or examples to get me started down the right path?
Thanks in advance for any help you can offer.