Commit 89c92f0c authored by Arturo Borrero Gonzalez's avatar Arturo Borrero Gonzalez
Browse files

New upstream version 1.8.3

parent 0309474b
:PREROUTING,FORWARD,OUTPUT,POSTROUTING
*mangle
-j ECN;;FAIL
-p tcp -j ECN;;FAIL
-p tcp -j ECN --ecn-tcp-remove;=;OK
:INPUT,FORWARD,OUTPUT
-j LOG;-j LOG;OK
-j LOG --log-prefix "test: ";=;OK
-j LOG --log-prefix "test: " --log-level 1;=;OK
# iptables displays the log-level output using the number; not the string
-j LOG --log-prefix "test: " --log-level alert;-j LOG --log-prefix "test: " --log-level 1;OK
-j LOG --log-prefix "test: " --log-tcp-sequence;=;OK
-j LOG --log-prefix "test: " --log-tcp-options;=;OK
-j LOG --log-prefix "test: " --log-ip-options;=;OK
-j LOG --log-prefix "test: " --log-uid;=;OK
-j LOG --log-prefix "test: " --log-level bad;;FAIL
-j LOG --log-prefix;;FAIL
:POSTROUTING
*nat
-j MASQUERADE;=;OK
-j MASQUERADE --random;=;OK
-j MASQUERADE --random-fully;=;OK
-p tcp -j MASQUERADE --to-ports 1024;=;OK
-p udp -j MASQUERADE --to-ports 1024-65535;=;OK
-p udp -j MASQUERADE --to-ports 1024-65536;;FAIL
-p udp -j MASQUERADE --to-ports -1;;FAIL
:PREROUTING,INPUT,OUTPUT,POSTROUTING
*nat
-j NETMAP --to 1.2.3.0/24;=;OK
-j NETMAP --to 1.2.3.4;=;OK
:PREROUTING,OUTPUT
*nat
-p tcp -j REDIRECT --to-ports 42;=;OK
-p udp -j REDIRECT --to-ports 42-1234;=;OK
-p tcp -j REDIRECT --to-ports 42-1234 --random;=;OK
-j REDIRECT --to-ports 42;;FAIL
:INPUT,FORWARD,OUTPUT
-j REJECT;=;OK
-j REJECT --reject-with icmp-net-unreachable;=;OK
-j REJECT --reject-with icmp-host-unreachable;=;OK
-j REJECT --reject-with icmp-port-unreachable;=;OK
-j REJECT --reject-with icmp-proto-unreachable;=;OK
-j REJECT --reject-with icmp-net-prohibited;=;OK
-j REJECT --reject-with icmp-host-prohibited;=;OK
-j REJECT --reject-with icmp-admin-prohibited;=;OK
:POSTROUTING
*nat
-j SNAT --to-source 1.1.1.1;=;OK
-j SNAT --to-source 1.1.1.1-1.1.1.10;=;OK
-j SNAT --to-source 1.1.1.1:1025-65535;;FAIL
-j SNAT --to-source 1.1.1.1 --to-source 2.2.2.2;;FAIL
-p tcp -j SNAT --to-source 1.1.1.1:1025-65535;=;OK
-p tcp -j SNAT --to-source 1.1.1.1-1.1.1.10:1025-65535;=;OK
-p tcp -j SNAT --to-source 1.1.1.1-1.1.1.10:1025-65536;;FAIL
-p tcp -j SNAT --to-source 1.1.1.1-1.1.1.10:1025-65535 --to-source 2.2.2.2-2.2.2.20:1025-65535;;FAIL
-j SNAT;;FAIL
:PREROUTING,INPUT,FORWARD,OUTPUT,POSTROUTING
*mangle
-j TTL --ttl-set 42;=;OK
-j TTL --ttl-inc 1;=;OK
-j TTL --ttl-dec 1;=;OK
-j TTL --ttl-set 256;;FAIL
-j TTL --ttl-inc 0;;FAIL
-j TTL --ttl-dec 0;;FAIL
-j TTL --ttl-dec 1 --ttl-inc 1;;FAIL
-j TTL --ttl-set --ttl-inc 1;;FAIL
:INPUT,FORWARD,OUTPUT
-p ah -m ah --ahspi 0;=;OK
-p ah -m ah --ahspi 4294967295;=;OK
-p ah -m ah --ahspi 0:4294967295;-p ah -m ah;OK
-p ah -m ah ! --ahspi 0;=;OK
-p ah -m ah --ahspi -1;;FAIL
-p ah -m ah --ahspi 4294967296;;FAIL
-p ah -m ah --ahspi invalid;;FAIL
-p ah -m ah --ahspi 0:invalid;;FAIL
-m ah --ahspi 0;;FAIL
-m ah --ahspi;;FAIL
-m ah;;FAIL
-p ah -m ah;=;OK
......@@ -236,7 +236,7 @@ static unsigned int type_xlate_print(struct xt_xlate *xl, unsigned int icmptype,
if (icmp_codes[i].type == icmptype &&
icmp_codes[i].code_min == code_min &&
icmp_codes[i].code_max == code_max) {
xt_xlate_add(xl, icmp_codes[i].name);
xt_xlate_add(xl, "%s", icmp_codes[i].name);
return 1;
}
}
......
:INPUT,FORWARD,OUTPUT
-p icmp -m icmp --icmp-type any;=;OK
# output uses the number, better use the name?
# ERROR: cannot find: iptables -I INPUT -p icmp -m icmp --icmp-type echo-reply
# -p icmp -m icmp --icmp-type echo-reply;=;OK
# output uses the number, better use the name?
# ERROR: annot find: iptables -I INPUT -p icmp -m icmp --icmp-type destination-unreachable
# -p icmp -m icmp --icmp-type destination-unreachable;=;OK
# it does not acccept name/name, should we accept this?
# ERROR: cannot load: iptables -A INPUT -p icmp -m icmp --icmp-type destination-unreachable/network-unreachable
# -p icmp -m icmp --icmp-type destination-unreachable/network-unreachable;=;OK
-m icmp;;FAIL
# we accept "iptables -I INPUT -p tcp -m tcp", why not this below?
# ERROR: cannot load: iptables -A INPUT -p icmp -m icmp
# -p icmp -m icmp;=;OK
......@@ -5,3 +5,5 @@ setups involving dynamic routing protocols like BGP.
Matches a given realm number (and optionally mask). If not a number, value
can be a named realm from /etc/iproute2/rt_realms (mask can not be used in
that case).
Both value and mask are four byte unsigned integers and may be specified in
decimal, hex (by prefixing with "0x") or octal (if a leading zero is given).
:INPUT,FORWARD,OUTPUT
-m realm --realm 0x1/0x2a;=;OK
-m realm --realm 0x2a;=;OK
-m realm;;FAIL
:INPUT,FORWARD,OUTPUT
-m ttl --ttl-eq 0;=;OK
-m ttl --ttl-eq 255;=;OK
-m ttl ! --ttl-eq 0;=;OK
-m ttl ! --ttl-eq 255;=;OK
-m ttl --ttl-gt 0;=;OK
# not possible have anything greater than 255, TTL is 8-bit long
# ERROR: should fail: iptables -A INPUT -m ttl --ttl-gt 255
## -m ttl --ttl-gt 255;;FAIL
# not possible have anything below 0
# ERROR: should fail: iptables -A INPUT -m ttl --ttl-lt 0
## -m ttl --ttl-lt 0;;FAIL
-m ttl --ttl-eq 256;;FAIL
-m ttl --ttl-eq -1;;FAIL
-m ttl;;FAIL
......@@ -3,12 +3,14 @@ It can be used to record accepted, dropped, and rejected packets. See
auditd(8) for additional details.
.TP
\fB\-\-type\fP {\fBaccept\fP|\fBdrop\fP|\fBreject\fP}
Set type of audit record.
Set type of audit record. Starting with linux-4.12, this option has no effect
on generated audit messages anymore. It is still accepted by iptables for
compatibility reasons, but ignored.
.PP
Example:
.IP
iptables \-N AUDIT_DROP
.IP
iptables \-A AUDIT_DROP \-j AUDIT \-\-type drop
iptables \-A AUDIT_DROP \-j AUDIT
.IP
iptables \-A AUDIT_DROP \-j DROP
:INPUT,FORWARD,OUTPUT
-j AUDIT --type accept;=;OK
-j AUDIT --type drop;=;OK
-j AUDIT --type reject;=;OK
-j AUDIT;;FAIL
-j AUDIT --type wrong;;FAIL
:PREROUTING,FORWARD,POSTROUTING
*mangle
-j CHECKSUM --checksum-fill;=;OK
-j CHECKSUM;;FAIL
......@@ -73,6 +73,24 @@ CLASSIFY_save(const void *ip, const struct xt_entry_target *target)
TC_H_MAJ(clinfo->priority)>>16, TC_H_MIN(clinfo->priority));
}
static void
CLASSIFY_arp_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_classify_target_info *clinfo =
(const struct xt_classify_target_info *)target->data;
printf(" --set-class %x:%x",
TC_H_MAJ(clinfo->priority)>>16, TC_H_MIN(clinfo->priority));
}
static void
CLASSIFY_arp_print(const void *ip,
const struct xt_entry_target *target,
int numeric)
{
CLASSIFY_arp_save(ip, target);
}
static int CLASSIFY_xlate(struct xt_xlate *xl,
const struct xt_xlate_tg_params *params)
{
......@@ -98,21 +116,36 @@ static int CLASSIFY_xlate(struct xt_xlate *xl,
return 1;
}
static struct xtables_target classify_target = {
.family = NFPROTO_UNSPEC,
.name = "CLASSIFY",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.help = CLASSIFY_help,
.print = CLASSIFY_print,
.save = CLASSIFY_save,
.x6_parse = CLASSIFY_parse,
.x6_options = CLASSIFY_opts,
.xlate = CLASSIFY_xlate,
static struct xtables_target classify_tg_reg[] = {
{
.family = NFPROTO_UNSPEC,
.name = "CLASSIFY",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.help = CLASSIFY_help,
.print = CLASSIFY_print,
.save = CLASSIFY_save,
.x6_parse = CLASSIFY_parse,
.x6_options = CLASSIFY_opts,
.xlate = CLASSIFY_xlate,
},
{
.family = NFPROTO_ARP,
.name = "CLASSIFY",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.help = CLASSIFY_help,
.print = CLASSIFY_arp_print,
.save = CLASSIFY_arp_save,
.x6_parse = CLASSIFY_parse,
.x6_options = CLASSIFY_opts,
.xlate = CLASSIFY_xlate,
}
};
void _init(void)
{
xtables_register_target(&classify_target);
xtables_register_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg));
}
:FORWARD,OUTPUT,POSTROUTING
*mangle
-j CLASSIFY --set-class 0000:ffff;=;OK
# maximum handle accepted by tc is 0xffff
# ERROR : should fail: iptables -A FORWARD -t mangle -j CLASSIFY --set-class 0000:ffffffff
# -j CLASSIFY --set-class 0000:ffffffff;;FAIL
# ERROR: should fail: iptables -A FORWARD -t mangle -j CLASSIFY --set-class 1:-1
# -j CLASSIFY --set-class 1:-1;;FAIL
-j CLASSIFY;;FAIL
:PREROUTING,FORWARD,OUTPUT,POSTROUTING
*mangle
-j CONNMARK --restore-mark;=;OK
-j CONNMARK --save-mark;=;OK
-j CONNMARK --save-mark --nfmask 0xfffffff --ctmask 0xffffffff;-j CONNMARK --save-mark;OK
-j CONNMARK --restore-mark --nfmask 0xfffffff --ctmask 0xffffffff;-j CONNMARK --restore-mark;OK
-j CONNMARK;;FAIL
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment