get ip address

get ip address for linux, read network device through socket.