Skip to content

Instantly share code, notes, and snippets.

@kapouer
Created December 14, 2021 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kapouer/3cef3b2dbb22469398a764e99ea7e4d2 to your computer and use it in GitHub Desktop.
Save kapouer/3cef3b2dbb22469398a764e99ea7e4d2 to your computer and use it in GitHub Desktop.
table inet filter {
chain input {
type filter hook input priority filter; policy drop;
iif "lo" accept
ct state established,related accept
tcp dport { 22, 44 } ct state new accept comment "ssh on default and inhouse ports"
ip daddr 212.83.181.20 tcp dport { 80, 443, 7700-7706 } accept comment "ws4.nsocket.com"
ip6 nexthdr ipv6-icmp icmpv6 type { nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert } accept comment "IPv6 connectivity"
}
chain forward {
type filter hook forward priority filter; policy accept;
}
chain output {
type filter hook output priority filter; policy accept;
}
}
table inet nat {
chain nsocket {
type nat hook prerouting priority dstnat;
ip daddr 212.83.181.20 tcp dport 443 dnat ip to 212.83.181.20:jhash ip saddr mod 6 map { 0 : 7700, 1 : 7701, 2 : 7702, 3 : 7703, 4 : 7704, 5 : 7705 } comment "ws2 https"
ip daddr 212.83.181.20 tcp dport 80 dnat ip to 212.83.181.20:jhash ip saddr mod 1 map { 0 : 7706 } comment "ws4 https"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment