понедельник, 23 января 2017 г. 7:53:20 +08 от Eugene Prokopiev поступило следующее: > А покажите, пожалуйста, пример правил вида: запретить все, разрешить > только ssh из некоторых сетей. Когда-то я смотрел в сторону nft, но > документация/примеры были слишком невнятными, может чего поменялось с > тех пор?
У меня ссх только по ключу, так что нет нужды ограничивать вход лишь доверенными сетями. Полагаю, тех, у кого по паролю, от брутфорса может прикрыть фейл2бан - но бережёного... Вот весь список (сеты уже фейл2бан добавил): [root@gw ~]# nft list ruleset table ip filter { set sshd { type ipv4_addr flags timeout } set sshd-ddos { type ipv4_addr flags timeout } set recidive { type ipv4_addr flags timeout } chain input { type filter hook input priority 0; policy drop; ip saddr @recidive counter packets 0 bytes 0 reject tcp dport { ssh} ip saddr @sshd-ddos counter packets 0 bytes 0 reject tcp dport { ssh} ip saddr @sshd counter packets 0 bytes 0 reject ct state invalid counter packets 20 bytes 2507 drop ct state { related, established} accept ct state new udp dport { traceroute-33523, 44450-44500} log reject ct state new tcp dport ssh tcp flags & (syn | ack) == syn counter packets 1 bytes 52 accept icmp type echo-request limit rate 10/second burst 5 packets accept ip protocol icmp drop iif { lo, lan} accept iifname != "lo" ip daddr 127.0.0.0/8 counter packets 0 bytes 0 drop counter packets 273532 bytes 39473283 } chain forward { type filter hook forward priority 0; policy drop; ct state invalid counter packets 383 bytes 19676 drop ct state { related, established} accept ct state new oif lan tcp dport { ssh, 8006} tcp flags & (syn | ack) == syn counter packets 0 bytes 0 accept ct state new iif lan accept counter packets 0 bytes 0 } chain output { type filter hook output priority 0; policy accept; ct state invalid counter packets 0 bytes 0 drop counter packets 60175 bytes 14545915 } } table ip mangle { chain postrouting { type route hook output priority -150; policy accept; oif tv ip ttl 1 counter packets 927 bytes 29664 ip ttl 64 counter packets 60175 bytes 14545915 } } table ip nat { chain prerouting { type nat hook prerouting priority -150; policy accept; iif lan tcp dport http counter packets 3166 bytes 195720 redirect to squid oif lan tcp dport 8006 counter packets 0 bytes 0 dnat 192.168.6.254 oif lan tcp dport 2222 counter packets 0 bytes 0 dnat 192.168.6.1:ssh iif corp tcp dport 3389 counter packets 0 bytes 0 dnat 192.168.6.1 counter packets 318267 bytes 46154190 } chain postrouting { type nat hook postrouting priority -150; policy accept; oif abon counter packets 4914 bytes 307529 snat 81.163.105.10 oif corp counter packets 46299 bytes 2720103 snat 192.168.255.55 oif nf counter packets 0 bytes 0 snat 192.168.0.164 oif gjc counter packets 3 bytes 252 snat 172.17.0.55 oif tv counter packets 1 bytes 32 snat 10.88.81.5 counter packets 20 bytes 1328 } } -- Мимо крокодил. WBR, rednex CIO. Cell: +7(964)103-65-67 Viber = Cell JID = <mailto:> Skype = $local_part@<mailto:> _______________________________________________ Sysadmins mailing list Sysadmins@lists.altlinux.org https://lists.altlinux.org/mailman/listinfo/sysadmins