Skip to content

Instantly share code, notes, and snippets.

@spencerwi
Created January 19, 2015 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spencerwi/ccbd32e4afa2fac23383 to your computer and use it in GitHub Desktop.
Save spencerwi/ccbd32e4afa2fac23383 to your computer and use it in GitHub Desktop.
Quick util to print out the IP addresses on a machine. Requires Quicklisp.
(ql:quickload :ip-interfaces)
(defun ip-as-string (interface)
(format nil "~{~A~^~.~}" (map 'list (lambda (x) x) (ip-interfaces:ip-interface-address interface))))
(defun print-interface-ip (interface)
(format t "~A: ~A~%" (ip-interfaces:ip-interface-name interface) (ip-as-string interface)))
(loop for interface in (ip-interfaces:get-ip-interfaces)
do (print-interface-ip interface))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment