Configure Networking, Time Services Flashcards
What is the command to show all network interfaces?
ip addr
What is the command to show a specific network interface?
ip addr show {ifname}
What is the command to trace the route of a packet?
traceroute
tracepath
What is the command to show listening ports and established connections?
ss
netstat *older
How do you show statistics on a network interface?
ip -s link show {ifname}
Where are networking devices located on the system?
/sys/class/net
How do you see the state of network devices?
nmcli dev status
What is the NetworkManager command to show network configurations?
nmcli con show
What is the NetworkManager command to add a DHCP connection that autoconnects on reboot?
nmcli con add con-name {name} autoconnect yes type ethernet ifname {ifname}
Where are NetworkManager configurations located?
/etc/sysconfig/network-scripts/
*ifcfg- files are config files for network interfaces
What is the NetworkManager command to add a static IP connection that autoconnects on reboot?
nmcli con add con-name {name} autoconnect yes type ethernet ifname {ifname} ip4 {ip} gw4 {gateway}
What is the NetworkManager command to bring down a network connection?
nmcli con down {name}
What is the NetworkManager command to bring up a network connection?
nmcli con up {name}
How do you modify a connection using NetworkManager?
nmcli con mod {name}
*can also edit config files in /etc/sysconfig/network-scripts
How do you delete a NetworkManager connection?
nmcli con del {name}
Where are DNS servers located?
/etc/resolv.conf
nameserver {server1} {server2} {etc}
Where is the hosts file located?
/etc/hosts
*resolves names to ip manually
How can you make either the /etc/hosts file or /etc/resolv.conf authoritative?
Edit /etc/nsswitch.conf
hosts: files dns myhostname
Order in which names will be resolved
Where is the hostname of the system stored?
/etc/hostname
What is the command to change hostname?
hostname *not persistent
hostnamectl set-hostname *persistent
In /etc/resolve.conf what does search followed by a domain name do?
i.e search domain.com
When resolving a hostname the FQDN does not have to be specified for all search entries. The domain will be automatically appended.
How would you use NetworkManager to add a network interface specific DNS address?
nmcli con mod {name} ipv4.dns {ip}
+ipv4.dns {ip} *add additional
-ipv4.dns {ip} *remove nameserver
How do you resolve a hostname strictly internally?
getent host {name}
How do you get information about system time?
timedatectl
date
How do you set the timezone?
timezonectl set-timezone
How do you enable/disable NTP?
timezonectl set-ntp true
timezonectl set-ntp false
How do you set the time?
timedatectl set-time {time}
*first disable NTP
What is the service that configures NTP?
chronyd
ntpd *older
How do you see which servers are being used to sync by NTP?
chronyc sources -v
located at /etc/chrony.conf
How do you see advances NTP information?
chronyc tracking
*shows information such as update interval
speeds/slows system clock incrementally to correct time to avoid breaking applications