Linux Networking Flashcards

1
Q

Using tcpdump, how can you isolate a specific interface port and source ip?

A

tcpdump -i eth0 port 8080 src 10.0.0.1

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

Using tcpdump, how can you isolate a specific protocol?

A

tcpdump icmp

You can only isolate transport layer protocols like icmp, tcp, udp

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

How are the OSI and TCP/IP models composed and how do they compare?

A

OSI Model TCP/IP Protocols
Application Application http,smtp,telnet,ftp
Presentation Application http,smtp,telnet,ftp
Session Application http,smtp,telnet,ftp
Transport Transport tcp, udp
Network Internet arp, ip, igmp, icmp
Data Link Network Interface / Network Access Layer
Physical Network Interface / Network Access Layer
https://www.iperiusbackup.net/wp-content/uploads/2019/09/image4.jpg

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

What type of networks are there (not in terms of topology) and which devices can we find in each one?

A

LANs: switches, nic
WANs: routers, firewalls

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

What is ARP used for?

A

ARP (Address Resolution Protocol) is used to discover the link layer address (mac address) given a network layer address (ip)

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

What are some components of an IP header?

A

Version, header length, total length, identifier, flags, fragmentation offset, time to live, protocol, source address, destination address, header checksum

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

What is TTL?

A

Time to live is a number that represents the maximum number of routers a packet is allowed to pass trough before dying. It is helpfull in preventing a packet from being stuck in an infinite loop

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

Which command allows you to check the route a packet to a specific destination ip will follow?

A

traceroute (ip), -n flag removes wait time for dns resolutions

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

What commands allows you to see the route table?

A

route -n or ip route

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

What is the difference between static and dynamic routing?

A

Static routing is define manually for specific destinations, whilst dynamic ports are defined by algorithms that find the optimal path to specific destinations

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

What commands allow you to define a default gateway?

A

sudo ip route add default via (ip)
or
sudo route add default gw (ip)

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

How do you define default gateway in a permanent manner?

A
On ubuntu neplan yml file can be used (/etc/netplan/something.yaml) as follows:
network:
version: 2
renderer: networkd
ethernets:
enp2s0:
addresses: [192.168.1.10/24]
gateway4: 192.168.1.1
nameservers:
addresses: [1.1.1.1, 1.0.0.1]

And running sudo netplan apply followed by a reboot

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

What does a tcp header contain?

A
Source and destination ports
Sequence number
Acknowledgement number
flags
window size
checksum
options
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 3 states of a tcp connection that is being established, and how is each state reached?

A

SYN_SENT, SYN_RECEIVED, ESTABLISHED
syn_sent is reached when the first syn message is sent to the destination
syn_received is reached when the syn/ack is recieved from the target
established is reached when the final ack is sent to the target

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

How does a tcp connection termination work?

A

Tcp connection is terminated by the source sending a FIN signal and the destination responding with ACK, after which the same processed is repeated for the destination, so the destination sends a FIN signal and awaits and ack before setting the connection as terminated

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

Name 3 flags that can be set in a tcp connection?

A

SYN, ACK, FIN

17
Q

What command allows you to see active tcp connections?

A

netstat -t

18
Q

What is the purpose of the window size component of tcp header?

A

Window size determines the amount of segments that can be in flight without having been acknowledged

19
Q

How does mtls work?

A

Mutual tranaport layer security is a protocol that requires both client and server to have a certificate as oposed to tls where only the server has it. Comunicstions are then done with pub/private key pairs on both sides as well, meaning both client and server have their set of pub/private keys