IP

Aus Doku-Wiki
Zur Navigation springenZur Suche springen

Infos rund um die IP

Dezimal IPadressen umrechnen

Ping

Der einfachste Helfer ist ping. Ping kann unter Linux und Windows die Dezimalzahl in eine IP umrechnen

ping 3250935297
PING 3250935297 (193.197.86.1) 56(84) bytes of data.

PerlScript

#!/bin/bash

case "$1" in

-o)
       perl -MSocket -le"print unpack q/N/, inet_aton q/$2/"
;;

-d)
       perl -MSocket -le"print inet_ntoa pack q/N/, $2"
;;

*)
       clear
       echo " "
       echo "Syntax: ip-convert [-i | -d] [IP | DEZ]"
       echo " "
       echo "          -d  2130706433  Eingabe als Dezimalzahl"
       echo "          -o  127.0.0.1   Eingabe als Oktet"
       echo " "
       echo "Beispiel:  ip-convert -o 127.0.0.1"
       echo "           ip-convert -d 2130706433"
       echo " "
;;
esac