1. install python dev
sudo apt-get install python-dev
2.download src code and install
https://pypi.python.org/pypi/netifaces/
2.get ip,mac,netmask,gateway
import netifaces
netifaces.interfaces()
netifaces.gateways()
https://pypi.python.org/pypi/netifaces