Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 6 additions & 42 deletions src/ipv6ipt.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,52 +111,16 @@ int fs_ipt6_setup(void)
"--icmp-type", "11", "-j", "DROP", NULL},

/*
exclude special IPv6 addresses (from source)
exclude non-GUA IPv6 addresses (from source)
*/
{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "-s", "::/127",
"-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "-s",
"::ffff:0:0/96", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "-s",
"64:ff9b::/96", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "-s",
"64:ff9b:1::/48", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "-s",
"2002::/16", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "-s",
"fc00::/7", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "-s",
"fe80::/10", "-j", "RETURN", NULL},
{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_S", "!", "-s",
"2000::/3", "-j", "RETURN", NULL},

/*
exclude special IPv6 addresses (to destination)
exclude non-GUA IPv6 addresses (to destination)
*/
{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "-d", "::/127",
"-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "-d",
"::ffff:0:0/96", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "-d",
"64:ff9b::/96", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "-d",
"64:ff9b:1::/48", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "-d",
"2002::/16", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "-d",
"fc00::/7", "-j", "RETURN", NULL},

{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "-d",
"fe80::/10", "-j", "RETURN", NULL},
{"ip6tables", "-w", "-t", "mangle", "-A", "FAKESIP_D", "!", "-d",
"2000::/3", "-j", "RETURN", NULL},

/*
exclude marked packets
Expand Down
20 changes: 4 additions & 16 deletions src/ipv6nft.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,18 @@ int fs_nft6_setup(void)
*/
" icmp type time-exceeded counter drop;\n"
/*
exclude special IPv6 addresses (from source)
exclude non-GUA IPv6 addresses (from source)
*/
" ip6 saddr ::/127 return;\n"
" ip6 saddr ::ffff:0:0/96 return;\n"
" ip6 saddr 64:ff9b::/96 return;\n"
" ip6 saddr 64:ff9b:1::/48 return;\n"
" ip6 saddr 2002::/16 return;\n"
" ip6 saddr fc00::/7 return;\n"
" ip6 saddr fe80::/10 return;\n"
" ip6 saddr != 2000::/3 return;\n"
" }\n"
"\n"
" chain fs_postrouting {\n"
" type filter hook postrouting priority mangle - 5;\n"
" policy accept;\n"
/*
exclude special IPv6 addresses (to destination)
exclude non-GUA IPv6 addresses (to destination)
*/
" ip6 daddr ::/127 return;\n"
" ip6 daddr ::ffff:0:0/96 return;\n"
" ip6 daddr 64:ff9b::/96 return;\n"
" ip6 daddr 64:ff9b:1::/48 return;\n"
" ip6 daddr 2002::/16 return;\n"
" ip6 daddr fc00::/7 return;\n"
" ip6 daddr fe80::/10 return;\n"
" ip6 daddr != 2000::/3 return;\n"
" }\n"
"\n"
" chain fs_rules {\n"
Expand Down