Link Detection
Interface Details
Every operating system has a different way of giving you information about the network interfaces. Here are some samples of what might work depending on your operating system.
Windows
wmic
wmic nicconfig where "IPEnabled=true" get IPAddress, IPSubnet
Powershell
Get-NetIPAddress | Where-Object { $_.IPAddress -notlike '::*' }
Get-NetAdapter
netsh
netsh interface ip show config
netsh interface show interface
ipconfig (windows)
C:\>ipconfig /all
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek USB GbE Family Controller
Physical Address. . . . . . . . . : C8-F7-50-C2-4A-1F
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::6440:8906:1317:6f83%19(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.20(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Tuesday, September 21, 2021 7:36:38 PM
Lease Expires . . . . . . . . . . : Sunday, October 3, 2021 7:36:51 AM
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 255601712
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-2A-16-88-9C-B6-D0-C4-62-EB
DNS Servers . . . . . . . . . . . : 208.67.222.222
8.8.8.8
NetBIOS over Tcpip. . . . . . . . : Enabled
Wireless LAN adapter Wi-Fi:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : local.tld
Description . . . . . . . . . . . : Killer Wireless-n/a/ac 1535 Wireless Network Adapter
Physical Address. . . . . . . . . : 9C-B6-D0-C4-62-EB
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Linux
ip addr eth0
5: eth0@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:13:c8:5b brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 100.115.92.202/28 brd 100.115.92.207 scope global eth0
valid_lft forever preferred_lft forever
ifconfig -a
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.201 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::730b:b89a:7199:8851 prefixlen 64 scopeid 0x20<link>
ether b4:a9:fc:e5:b7:0b txqueuelen 1000 (Ethernet)
RX packets 4593373 bytes 3906568360 (3.9 GB)
RX errors 0 dropped 127 overruns 0 frame 0
TX packets 4742930 bytes 646304458 (646.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ethtool enp1s0
Settings for enp1s0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Cannot get wake-on-lan settings: Operation not permitted
Link detected: yes
Vendor
show interfaces
show interfaces status
L1: Link Lights
Some network cards are configured to tell you quite a bit of details about their connection. If Link is not Up, or there are errors, it’s worth nothing the lights and their flashing sequence, if any.
There are many ways vendors represent what the meaning of red,amber,green can be. Reviewing them can provide detailed information - for example (just an example):
Status Lights
LED Behavior | Meaning |
---|---|
Off | No power or is in a boot up |
Solid Green | Card has valid IP settings |
Solid Orange | Card does not have valid IP settings |
Flashing Green | Card does not have valid IP settings |
Flashing Orange | Making BootP requests |
Alternating Slow | Carc is making DHCP request |
Alternating Fast | Card is booting |
Link Lights
LED Behavior | Meaning |
---|---|
Off | No power or no network cable or switch is off |
Solid Green | On network that is rated at xxMbps |
Solid Orange | On network that is rated at xxxMbps |
Flashing Green | Receiving data at xxMbps |
Flashing Orange | Receiving data at XXXMbps |