Shiva's Blog

IPv4 Troubleshooting Tools

ipconfig

ipconfig is the command used in windows operating systems to view the ip configuration. ipconfig is also used to troubleshoot issues related to automatically assignedipconfiguration. There are many use cases where ipconfig can be used to troubleshoot, which can also be views using ipconfig –help using a command prompt in windows operating systems. The following table displays the few of them:

Command Description
ipconfig Display the IP address, subnet mask, default gateway, for all network interfaces to which TCP/IP is bound
ipconfig /all Displays complete TCP/IP configuraiton parameters for each interface, including DHCP information and MAC address
ipconfig /renew Forces the DHCP client to renew the lease it has for the IP address
ipconfig /release Releases the IP address obtained from a DHCP server
ipconfig /displaydns Displays dns resolver cache
ipconfig /flushdns Clears the DNS resolver cache
ipconfig /registerdns Resisters the host with a DNS server

ifconfig and ip

ifconfig is a part of legacy net-tools package and is deprecated on most of the linux systems. ifconfig can still be used to report the network interface configuration.

net-tools has been replace by the iproute2 package.

basic ip commands

ip addr show (ip a s) -> displays the ip addresses for all the interface in the network ip addr show dev eth0 (ip a s eth0) -> displays the ip configuration for the device eth0 ip link -> displays the status of the interface ip -s link -> reports interface statistics ip link set eth0 up|down -> can enable or disable the interface status ip addr add|delete -> add ip address or delete IP address from the interface

all these commands are not presistent and apply only to the running configuration and will be removed after reboot.

ip r -> displays the ip routes ip route add {network} via {ipaddress} -> add ip route

arp

The address resolution protocol is used by the host to determine which MAC address is associated with an IP address on the local network.

in linux, the ip neigh command shows entries in the local ARP cache

ping

TTL or the time to live ip header field is reduced by one every time a packet is forwarded by a router (referred to as hop). The TTL output field in the ping command shows the value of the counter when the packet arrived at its destination.

If the ping are unseuccessful,

Ping switches




reference: comptia network plus (certmaster)