IPTables and Netfilter Flashcards

1
Q

What are the five netfilter hooks?

A

NF_IP_ROUTING, NF_IP_LOCAL_IN, NF_IP_FORWARD, NF_IP_LOCAL_OUT, NF_IP_POST_ROUTING

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

what is PRE_ROUTING netfilter hook?

A

hook is triggered by any incoming traffic entering the network stack. This hook is processed before any routing decisions have been made.

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

what is LOCAL_IN netfilter hook

A

hook is triggered after an incoming packet has been routed if the destination is the local system

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

what is _FORWARD

A

hook is triggered after an incoming packet has been routed if the packet is to be forwarded to another host

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

what is LOCAL_OUT netfilter hook

A

triggered by any locally created outbound traffic as soon as it hits the network stack

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

what is POST_ROUTING netfilter hook

A

this hook is triggered by any outgoing for forwarded traffic after routing as taken place, before being sent out on wire

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

what determines the order of hook calls if multiple kooks are registered?

A

hooks are registered with a priority number.

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

What are the tables of IP tables

A

NAT, FILTER, MANGLE, RAW, SECURITY

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

What are the chains of each table

A

PREROUTING, INPUT, FORWARD, OUTPUT, POSTROUTING

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

what is the purpose of the filter table?

A

decide to allow packet to continue to destination or not

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

what is the purpose of the NAT table

A

used to implement network address translation. The source or destination is changed.

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

what is the purpose of the Mangle table

A

Used to alter the ip headers

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

what is the purpose of the raw table

A

to mark packets to avoid connection tracking

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

what are the two types of NAT

A

DNAT (destination) and SNAT (source)

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

Does NAT processing come before Filter?

A

DNAT does, but SNAT does not

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

T/F nat rules are created on the first packet and will be applied to the stream?

A

True

16
Q

T/F iptables is stateful

A

True

17
Q

T/F NAT rules applied to a stream will be applied to responses

A

Yes, response have the reverse NAT rules applied

18
Q

What chains are applied to incoming destined for host?

A

PREROUTING -> INPUT

18
Q

What chains are applied to incoming, meant for another host?

A

PREROUTING -> FORWARD -> POSTROUTING

19
Q

Locally Generated Packets

A

OUTPUT - > POSTROUTING

20
Q

What are targets and terminating vs nonterminating

A

when a packet meets a matching criteria. Terminating stops traversing the chain

21
Q

What is the matching portion of a rule

A

Rules can be created to match protocol type, destination and source address and port.

22
Q

Connections are tracked by netfilter’s connection tracking, what are the states?

A

new, established, related, invalid, untracked,

23
Q
A