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
Get your IP address from command line using
#linux #sysadmin #curl #ifconfig #ip #ip_address #ipv4
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
#python #ipaddress #ipv4 #IPv4Network
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