ipshow - exibir informações de sua rede

Publicado por Luriel Santana (última atualização em 28/03/2020)

[ Hits: 2.113 ]

Homepage: luriel.casadopinguim.com.br

Download comando-ipshow.sh




Para rodar o comando basta salvar o script ipshow.sh e dar permissão de execução:

$ chmod +x ipshow.sh

  



Esconder código-fonte

#!/bin/bash
# Information: Script show information of network parametres
# Version: 0.0.3
# Date: 20200229
# Autors:
#       ASRD  - Alex Dias - alex@linux.ao
#       DAL     - Decio Lilunga - decio@linux.ao
#       LNS     - Luriel Santana - luriel@linux.ao

# Variable get
iface=`/sbin/ifconfig | grep mtu | tr -s " " | cut -d " " -f 1 | tr ":" " " | grep -v lo`

show_info()
{
nic=$1

ip=`/sbin/ifconfig ${nic}  |  awk '/inet/ {print}' | awk '{print $2}' | head -1`
ip6=`/sbin/ifconfig ${nic}  |  awk '/inet6/ {print}' | awk '{print $2}' | head -1`
mask=`/sbin/ifconfig ${nic}  |  awk '/inet/ {print}' | awk '{print $4}' | head -1`
gw=`/sbin/route -n | awk '/'${nic}'/ {print}' | awk '{print $2}' | head -1`
mac=`/sbin/ifconfig ${nic}  |  awk '/ether/ {print}' | awk '{print $2}' | head -1`

# Show Out put Information
echo "Interface: $nic"
echo "   v4  IP: $ip"
echo "       MK: $mask"
echo "       GW: $gw"
echo "       MC: $mac"
echo " "
echo "   v6  IP: $ip6"
}

# Loop show Information
for i in $iface
do
        show_info $i
        echo " "
done

Scripts recomendados

Comparar recursivamente duas pastas

Recriando /dev/null facilmente

Verifica espaço em disco

FIREWALL COM IPTABLES - PARA INTERNET DISCADA E ADSL

Limpar o cache da memória RAM apenas quando necessário


  

Comentários

Nenhum comentário foi encontrado.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts