Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
Sometimes to know your IP address, you have to open a web browser and open a site that gives you the ip address of your system. But what if you are a sysadmin and you don't have access to a browser on Linux server? What if you don't wanna leave your terminal?

Get your IP address from command line using curl:
$ curl ifconfig.co
80.171.524.14

#linux #sysadmin #curl #ifconfig #ip #ip_address #ipv4
In order to expand a CIDR in python you can use ipaddress module as below:

import ipaddress
available_ips = [str(ip) for ip in ipaddress.IPv4Network('192.0.2.0/28')]


#python #ipaddress #ipv4 #IPv4Network