Skip to content

Instantly share code, notes, and snippets.

@githubutilities
Last active September 27, 2022 07:44
Show Gist options
  • Select an option

  • Save githubutilities/470929dca1d84066fa46 to your computer and use it in GitHub Desktop.

Select an option

Save githubutilities/470929dca1d84066fa46 to your computer and use it in GitHub Desktop.
Some Internet IP things

IP conflict symptom

  • No internet access, because the gateway detects that your mac address and ip address does not match what is stored
  • ping 127.0.0.1--OK
  • ping network-ip--For windows 7, this appear to be OK while for Mac OSX, ping: sendto: No route to host error log pops out
  • ping network-gateway--ping: sendto: No route to host
  • arp -a—-For windows 7, it may output history version of the arp table while for Mac OSX, it outputs nothing

arp table observation

arp table is your local map between ip and mac address. For Mac OSX, arp table will be deleted whenever you can your internet settings. For windows 7, it keeps the history version of arp table even if you don't have internet access.

  • arp -a--list all local cached arp table entries, use arp -na to speed it up
  • arp -d -a—clear all local cached arp table entries
  • the first arp table entry most likely is your gateway ip
  • arp table only works for mac addresses of LAN which means ARP request for IP not on the same network will not reply unless ARP masquerading is configured or VPN is used.

Find out Mac address of specific ip

  1. ping <wanted-ip>--this should cached the in local arp table
  2. arp <wanted-ip>

Ping log analysis

  • Remote host does not respond to your ICMP requests while it do repond to your ARP request which means your local link state and IP connectivity is good. Try disable remote host's firewall.
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
  • ping: sendto: No route to host means remote host does not reply your ARP request.
ping: sendto: No route to host
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down

here is some words by meraki: In this case try pinging another host on the LAN. If pinging different hosts on the LAN also results in "Host is down" it is a good chance your IP address is incorrectly configured or your uplink segment is good but the uplink segment connecting to the rest of the LAN is down. This issue could be caused by an administratively down upstream port, VLAN mismatch, or bad cabling upstream.

  • your local link is down
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host

Reference

Netstat Cheet Sheet

Routing table

# Print routing table
netstat -r
# Rrint routing table including protocol-cloned routes(all)
netstat -ra
# Print routing table including `mtu`(long)
netstat -rl

# Print status table
netstat -s

Mac Address analysis

According to wikipedia, an Organizationally Unique Identifier (OUI) is a 24-bit number that uniquely identifies a vendor, manufacturer, or other organization globally or worldwide. The first three octets of Mac Address is OUI.

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment