Networking - Command Line Network Utilities Flashcards
What operating system(s) is “ifdown <interface> used on and what does it do?</interface>
Linux
Stops a network interface
What does “hostname” do on Linux, what can it be used for, and what switches are useful to know?
Displays the current devices’ name. It can be used to temporarily or permanently change the hostname.
The switches are as follows:
-s displays the short version of the hostname.
-b forces the computer to use the default hostname of localhost.
-d displays the DNS domain name.
-f displays the FQDN of the device.
-i displays the current IP address.
What does “hostname” do on Windows?
Shows the current devices’ name
What does “ping” do on Linux, how does it work, and what switches can be used with it?
Ping sends an UDP echo request/reply packet to a remote host. A response from the remote host indicates that both hosts are correctly configured and a connection exists between them. In a Linux machine, ping keeps sending packets until the user manually stops the command (Ctrl + c).
Switches:
-c sets the number of UDP packets to be sent.
-i sets the interval between sent packets.
-f sends packets as quickly as the network allows.
-q displays only a summary of the ping results.
What does “ping” do on Windows, how does it work, and what switches can be used with it?
Ping sends an ICMP echo request/reply packet to a remote host. A response from the remote host indicates that both hosts are correctly configured and a connection exists between them. It sends 4 packets by default.
Switches:
-n specifies the number of ICMP packets sent.
-l sets the size of the packets.
-4 forces ping to use IPv4.
-6 forces ping to use IPv6.
-t sends continuous pings until manually stopped.
-a resolves the IP address to a hostname.
What operating system is “ip addr” used on and what parameters does it show you?
Linux
ip addr or ip addr show
Shows the addresses assigned to all the network interfaces.
Common ip addr show parameters include the following:
inet shows the IPv4 address with the subnet mask in CIDR notation.
brd - shows the broadcast address.
up or down - shows the interface status.
inet6 - shows the IPv6 IP address.
<interface> - show the networking information for the specified interface.
Example: ip addr show enp2s1
</interface>
What operating system is “ip” used on and what is it able to do. Also what utility did it replace?
It’s used on the Linux operating system and it replaced the “ifconfig” utility
It is used for:
Address—IP addresses and ranges.
Link—network adapter.
Route—the rules that manage the routing of traffic.
What operating system is “traceroute” used on and what does it do?
Linux
Used to test connectivity between two devices as well as showing the path between those devices. Responses from each hop on the route are measured three times to accurately report how long the packet takes to reach the specific host and then return.
What operating system is “tracert” used on and what does it do?
Windows
Used to test connectivity between two devices as well as showing the path between those devices. Responses from each hop on the route are measured three times to accurately report how long the packet takes to reach the specific host and then return.
What operating system is ipconfig used on and what switches are used most often with it?
Windows
ipconfig—shows the IP address, subnet mask, and default gateway
ipconfig /all—shows detailed IP configuration information including the MAC address, DHCP information, DNS server, and more.
ipconfig /release—clears the current IP configuration obtained from a DHCP server.
ipconfig /renew—attempts to request a new IP configuration from a DHCP server.
ipconfig /displaydns—displays the contents of the local DNS cache.
ipconfig /flushdns—clears the DNS cache.
What operating system(s) is “ifconfig” used on, what info does it show, and what switches are used with it?
ifconfig is used on Linux and macOS systems and displays the installed network interfaces and the current configuration settings for each interface, including the MAC address, IP address, broadcast address, and subnet address.
Use the ifconfig command as follows:
Use ifconfig -a to display all the interfaces which are currently available, even if the interface is down.
Use ifconfig [interface_name] down to disable the specified network interface.
Use ifconfig [interface_name] up to enable the specified network interface.
What operating system(s) is “ifup <interface>" used on and what does it do?</interface>
It’s used on Linux
Starts a network interface
What operating system(s) is ip link set <interface> down
ip link set <interface> up used on and what does it do?</interface></interface>
They are used on Linux
Starts and stops the specified interface
What operating system(s) is “pathping” used on and what does it do?
Windows
The pathping utility performs the same function as tracert, but also shows information such as the network latency and packet loss for each hop. This is useful for determining if a device in the path is slowing traffic or dropping packets.
What operating system(s) is netstat used on and what does it do?
Windows and Linux
1. Active TCP or UDP connections. 2. Open ports on the computer and the programs using those ports. 3. Local routing table.
What operating system(s) is “nslookup” used on and what does it do?
Windows
It looks up the IP address of a specified hostname. It also displays additional name resolution information, such as the DNS server used for the lookup request.
What operating system(s) is “dig” used on and what does it do?
Linux
It looks up the IP address of a specified hostname. It also displays additional name resolution information, such as the DNS server used for the lookup request. You can also use the dig command to modify DNS settings.
What operating system(s) is “net” used on and what does it do?
Windows
You can use the net utility in Windows to manage and modify almost any aspect of the network. You use the net utility in conjunction with a second command. Two commands commonly used with the net utility are:
use—configures or modifies a connection to a shared network resource, such as a shared folder. user—adds, removes, or modifies a user account.
In a Windows environment, if I wanted to see a device’s current IP configuration information for each network adapter, what utility would I use?
ipconfig
In a Windows environment, what command shows detailed IP configuration information including the MAC address, DHCP information, DNS server, and more.
ipconfig /all
In a Windows environment, what command clears the current IP configuration obtained from a DHCP server.
ipconfig /release
In a Windows environment, what command attempts to request a new IP configuration from a DHCP server.
ipconfig /renew