IP router ********* Il est très rare de ne pas connaître son Ip public mais ca peut arriver, donc voici un petit script qui permet de la trouver. Le script utilise le site (http://www.monip.org/) où on récupère un fichier index.html qui contient notre adresse Ip public. Puis un petit coup de regex (expressions régulières) et le tour est joué Ce script a été testé sous Debian Etch. .. code-block:: bash #!/bin/bash wget http://www.monip.org/ 2> /dev/null echo "Mon adresse ip public est :" perl -ne 'print "$1\n" if m/((\d{1,3}\.){3}\d{1,3})/' < index.html rm index.html une autre façon via un script python .. code-block:: python import xml.dom.minidom import urllib ipxml = xml.dom.minidom.parse(urllib.urlopen('http://www.showmyip.com/xml/')) myIP = ipxml.getElementsByTagName('ip')[0].childNodes[0].nodeValue print myIP