Skip to content

Tag: networking

How to get all ip ranges from asn?

I want to get all IP address ranges/blocks from as number. I can search throw google but need to write them manually. I want to get them all at once? Is this possible to get only ip address ranges from websites at once? Answer You can use whois servers instead of or any other websites like this. whois -h

How to check if the IP address that a socket is bound to is still one of the valid machine’s addresses?

Once I call socket(); bind() (with a specific IP address, not INADDR_ANY); listen(), there seems to be no way of determining if the IP address is still a valid address of one of the system’s interfaces. What I looked into using: Checking error with getsockopt(SO_ERROR); Using epoll()-ing on some EPOLLERR, EPOLL{,RD}HUP events; Hoping that accept() would return an error if

AWK to print subnet

My requirement is to print a subnet value to I tried as below but i got output like this How to get output using awk as below Answer Good attempt and you were close, try following. With OP’s approach we need to put [ and ] as field separator too, so that we could catch the exact needed