March 2019
Beginner
490 pages
12h 40m
English
Now, we are going to discover some more information about the network interface and the gateway machine of your network.
In every LAN, a host is configured to act as a gateway, which talks to the outside world. To find the network address and the netmask, we can use a Python third-party library, netifaces. For example, you can call netifaces.gateways() to find the gateways that are configured to the outside world. Similarly, you can enumerate the network interfaces by calling netifaces.interfaces(). If you would like to know all the IP addresses of a particular interface, eth0, then you can call netifaces.ifaddresses('eth0').
The following code listing shows the way in which you can list all ...
Read now
Unlock full access