Networking Flashcards

1
Q

Show devices set on a system

A

nmcli dev show

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Show network configuration settings on a system

A

nmcli con show

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Turn off the connection

A

nmcli con down “Wired conn” [name of conn, ex- eth0]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Delete connection

A

nmcli con del “wired conn” [name of connection, ex eth0]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Check status of network devices

A

nmcli dev status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Show specified network device details

A

nmcli dev show eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Add new connection

A

nmcli con add con-name “backup” type ethernet ip4 192.168.0.122/24 gw4 192.168.0.1 ifname eth0 auroconnect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Edit current connection

A

nmcli con edit (which will prompt you for each setting and here you can enter in
each item based on the list printed out)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Add dns value for specified connection

A

nmcli con mod eth0 ipv4.dns “192.168.0.2”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Show dns field for specified connection

A

nmcli -f ipv4.dns con show backup/eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Display ip-address info

A

ip addr show

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Display routing table

A

ip route show

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Add/delete ip-address to specified interface

A

ip addr add/del 192.168.0.100/24 dev eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Show ip-address for specified interface

A

ip addr show eth0

ip addr show dev eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Switch on/off ip link

A

ip link set eth0 up/down

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Add/delete route

A

ip route add/del default via 192.168.1.2 dev eth0

ip route add/del 10.10.0.0/16 via 192.168.1.2 dev eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Set host name for the system

A

hostnamectl set-hostname “CetnosWK”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Get hostname

A

hostname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Legacy networking tools- need to install package

A

yum install net-tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Legacy: ip info details of configured interfaces

A

ifconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Legacy: change ip adress

A
ifconfig eth0 192.168.0.3
ifconfig eth0 (to show it's been change)
22
Q

Legacy: turn on/off network interface

A

ifup/ifdown eth0

23
Q

Legacy: print routing table

print routing table with ip-addresses rather than names, so destination instead of default will be shown as 0.0.0.0

A

route

route -n

24
Q

Legacy: delete default route

A

route del default

25
Q

Legacy: add default route

A

route add default gw 192.168.0.1

26
Q

Legacy: add new route

A

route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.0.1 dev eth0

27
Q

Test availability of destination host
Test the same but with specified number of packets
Test the same using ipv4 proto
Test the same using ipv6 proto

A

ping 192.168.0.35
ping -c 10 192.168.0.35
ping -4 -c 10 198.168.0.35
ping -6 -c 10 ::1 or ping6 -c 10 ::1

28
Q

Display all hops a packet will traverse to get the destination
The same but instead of using icmp use tcp packets
The same but using ipv6 proto

A

traceroute google.com
traceroute -T 8.8.8.8
traceroute -6 ::1/ traceroute6 ::1

29
Q

Display all hops a packet will traverse to get the destination using UDP instead of icmp by default

A

tracepath google.com

30
Q

Display network connections and their state on the system (now deprecated and need to install net-tools to use this)

A

netstat

31
Q

Display network status and states listening on tcp, udp protos
Display the same and show process id listening on these ports
Display routing table
Display all listening and non-listening sockets , show numerical addr instead symbolic host

A

netstat -tul
netstat -tulp
netstat -r
netstat -an

32
Q

Modern tool to display network status and states

A

ss

P.S. (no support to show routing table i.e. -r switch)

33
Q

File contains host entries with ip-names mappings including where localhost IP is

A

/etc/hosts

34
Q

File contains hostname of the system

this file is updated by hostnamectl

A

/etc/hostname

35
Q

File contains DNS server ip

A

/etc/resolv.conf

36
Q

Database file of name switch service conf file, to determine the sources from which to obtain ns info in range of categories, and in what order

A

/etc/nsswitch.conf

example of output
hosts: files DNS
The first thing to check will be files (/etc/hosts, /etc/hostname), then DNS (/etc/resolv.conf)

37
Q

Simple DNS lookup

A

host (need to install bind-utils first)

host google.com

38
Q

DNS lookup including types of DNS records
Lookup using specified DNS server
Lookup for specific record type

A

dig google.com
dig @8.8.8.8 reddit.com
dig -t MX google.com
dig @8.8.8.8 -t any google.com

39
Q

Directly query /etc/nsswitch.conf for records

A

getent hosts

40
Q
Network bonding (teaming)
Network bridging
A
  1. Config that treats 2+ network interfaces as a single one
  2. Combines 2+ networks into a new logical network. Often used in virtualization, where the guest’s network communicates on the same network as the host system
  3. 1.install bridge-utils
    1. create bridge interface: brctl addbr br0
    1. add nic to bridge: brctl addif br0 veth0
  4. 4 check status: brctl show
41
Q

Bonding modes

A

Mode=1 active-backup
sets all nics to backup state while one remains active
Mode=2 XOR policy
selects nic based on XOR operation
Mode=4 IEEE 802.3ad policy
creates aggregation teaming
Mode=5 adaptive transmit load balancing policy
ensures outgoing traffic distribution according to the load of each nic

42
Q

List ethernet nics using pci

A

lspci | grep ethernet

43
Q

Network port scanner

A

nmap -p 1-1023 -sV -sS -T4 192.168.1.1
nmap -A -T4 scanme.nmap.org
sV -probe open ports for service/version info
sS- TCP SYN, sT- connect, sA- ACK, sW -window, sU- UDP scan, sF -FYN, T4 -for faster execution
-A-to check OS and version detection, open ports etc

44
Q

Utility for reading from and writing to network connections using TCP or UDP

A

netcat
on server (192.168.0.1) side: nc -l -p 1234
on client side: nc 192.168.0.1. 1234
on client side: nc -zv 192.168.0.1 20-80
z -report connection status (53- connection succeded, 24- connection refused etc)

45
Q

CLI component of wireshark

A

tshark

46
Q

Very common utility to sniff traffic similar to tshark

A

tcpdump

47
Q

Show arp table

A

arp -n (show in numeric instead of symbolic names)
arp -d address - delete entry
arp -s address hw_address -set up a new table entry

48
Q

Display bandwidth usage

A

iftop

iftop -i _if_name (listen on interface)

49
Q

Measurement tool for tcp/udp bandwidth performance

A

iperf3

50
Q

Network diagnostic tool, which
updates network status in real-time
Combines functionality of traceroute and ping

A

mtr google.com

mtr -r google.com -display only final report, will not be updated in real-time

51
Q

Whois lookup, requests whois directory service

A

whois google.com