1

Obtener la dirección MAC e IP usando la terminal

Daniel
dabg_
4607

Para poder saber cual es la dirección MAC e IP de nuestro equipo, seguimos los siguientes pasos:

  • Abrimos la terminal.
@Nakajito ➜ /workspaces/bash (main) $ 
  • Escribimos el comando ~ifconfig~
@Nakajito ➜ /workspaces/bash (main) $ ifconfig
  • Nos mostrará la información del dispositivo de red que se encuentran conectados a la PC.
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 156.42.0.4  netmask 255.255.0.0broadcast 156.42.255.255
        ether 12:72:58:25:bf:f6  txqueuelen 0  (Ethernet)
        RX packets 0bytes 0 (0.0B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0bytes 0 (0.0B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 156.42.2.5  netmask 255.255.255.0broadcast 156.42.5.255
        inet6 fe80::6740:bdff:feaa:6056 prefixlen 64scopeid 0x20<link>
        ether 60:35:bc:ab:64:56  txqueuelen 1000  (Ethernet)
        RX packets 1565033bytes 2209967823 (2.2 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 163036bytes 101462119 (101.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1prefixlen 128scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 36731bytes 9208971 (9.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 36731bytes 9208971 (9.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  • Nos centramos en la información que muestra la dirección MAC e IP.
inet 156.42.0.4netmask 255.255.0.0broadcast 156.42.255.255
Escribe tu comentario
+ 2