sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n
http://www.cyberciti.biz/faq/unix-linux-shell-script-sorting-ip-addresses/