File README changed (mode: 100644) (index ef115c0..8669344) |
... |
... |
For iptables: |
49 |
49 |
-A INPUT -i ethX -m mark --mark 0x77777777 -j CONNMARK --save-mark |
-A INPUT -i ethX -m mark --mark 0x77777777 -j CONNMARK --save-mark |
50 |
50 |
# We need this rule again, to not hit again nf2fad. |
# We need this rule again, to not hit again nf2fad. |
51 |
51 |
-A INPUT -i ethX -m connmark --mark 0x77777777 -j ACCEPT |
-A INPUT -i ethX -m connmark --mark 0x77777777 -j ACCEPT |
52 |
|
# These are the control channels: |
|
|
52 |
|
# CONTROL_CHANNEL(S)_SECTION: These are the control channels: |
53 |
53 |
-A INPUT -i ethX -p icmp --icmp-type echo-request -j NFQUEUE --queue-num 4444 |
-A INPUT -i ethX -p icmp --icmp-type echo-request -j NFQUEUE --queue-num 4444 |
54 |
54 |
-A INPUT -i ethX -p udp --dport 1 -j NFQUEUE --queue-num 4444 |
-A INPUT -i ethX -p udp --dport 1 -j NFQUEUE --queue-num 4444 |
55 |
|
# Now, what ports to allow. |
|
|
55 |
|
# ALLOW_SECTION: Now, what ports to allow. |
56 |
56 |
# Next rule will pass port 22 (for example) to nf2fa and the connection will |
# Next rule will pass port 22 (for example) to nf2fa and the connection will |
57 |
57 |
# be marked if allowed. You may add here other ports as well. |
# be marked if allowed. You may add here other ports as well. |
58 |
58 |
-A INPUT -i ethX -p tcp --dport 22 -j NFQUEUE --queue-num 4444 |
-A INPUT -i ethX -p tcp --dport 22 -j NFQUEUE --queue-num 4444 |
59 |
59 |
|
|
60 |
60 |
For ip6tables: |
For ip6tables: |
61 |
|
<insert here the IPv4 rules till the control channels> |
|
|
61 |
|
<insert here the IPv4 rules till the control channel(s)> |
62 |
62 |
-A INPUT -i ethX -p ipv6-icmp --icmpv6-type echo-request -j NFQUEUE --queue-num 4444 |
-A INPUT -i ethX -p ipv6-icmp --icmpv6-type echo-request -j NFQUEUE --queue-num 4444 |
63 |
63 |
-A INPUT -i ethX -p udp --dport 1 -j NFQUEUE --queue-num 4444 |
-A INPUT -i ethX -p udp --dport 1 -j NFQUEUE --queue-num 4444 |
64 |
64 |
-A INPUT -i ethX -p tcp --dport 22 -j NFQUEUE --queue-num 4444 |
-A INPUT -i ethX -p tcp --dport 22 -j NFQUEUE --queue-num 4444 |
File nf2fad.c changed (mode: 100644) (index 3f0c6c1..5e6b364) |
... |
... |
int main(int argc, char *argv[]) |
1108 |
1108 |
if (ev.data.fd == fd1) { |
if (ev.data.fd == fd1) { |
1109 |
1109 |
ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); |
ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); |
1110 |
1110 |
if (ret == -1) { |
if (ret == -1) { |
1111 |
|
perror("mnl_socket_recvfrom"); |
|
|
1111 |
|
if (errno == ENOBUFS) { |
|
1112 |
|
fprintf(stderr, "Some packets were lost. Bad.\n"); |
|
1113 |
|
continue; |
|
1114 |
|
} |
|
1115 |
|
|
|
1116 |
|
perror("error receiving from nl fd"); |
1112 |
1117 |
return 1; |
return 1; |
1113 |
1118 |
} |
} |
1114 |
1119 |
|
|