{"id":288379,"date":"2018-08-22T17:30:02","date_gmt":"2018-08-22T13:30:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=288379"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=288379","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 UFW \u0432 Ubuntu Server 16.04 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 BigBlueButton"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420973\/\" class=\"post__text post__text-html js-mediator-article\">UFW (Uncomplicated Firewall) \u2013 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 iptables, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0430. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 iptables \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439, \u043d\u043e \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u042f \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0432 \u044d\u0442\u043e\u043c \u0434\u0435\u043b\u0435.<br \/>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 iptables \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 ACCEPT \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<br \/>  <a name=\"habracut\"><\/a><br \/>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wf\/ie\/xt\/wfiextb29c6pm9uslq76-9cjdze.png\"><\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439. \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 ACCEPT.<br \/>  INPUT \u2013 \u0412\u0425\u041e\u0414\u042f\u0429\u0418\u0415 \u0421\u041e\u0415\u0414\u0418\u041d\u0415\u041d\u0418\u042f.<br \/>  OUTPUT \u2013 \u0418\u0421\u0425\u041e\u0414\u042f\u0429\u0418\u0415 \u0421\u041e\u0415\u0414\u0418\u041d\u0415\u041d\u0418\u042f.<br \/>  FORWARD \u2013 \u041c\u0410\u0420\u0428\u0420\u0423\u0422\u0418\u0417\u0410\u0426\u0418\u042f (\u041d\u0410\u041f\u0420\u0418\u041c\u0415\u0420, \u041d\u0415\u041e\u0411\u0425\u041e\u0414\u0418\u041c\u041e \u041f\u0420\u041e\u041f\u0418\u0421\u0410\u0422\u042c \u041c\u0410\u0420\u0428\u0420\u0423\u0422 \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443 \u0437\u0430 \u0448\u043b\u044e\u0437\u043e\u043c).<br \/>  \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c ufw \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>sudo ufw enable<\/code><br \/>  \u0418 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 iptables \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. <br \/>  \u0412\u043e\u0442 \u043a\u0430\u043a \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 BigBlueButton \u043f\u043e\u0441\u043b\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f ufw: <br \/>  <code>Chain INPUT (policy DROP)<br \/>  target prot opt source destination<br \/>  ufw-before-logging-input all -- anywhere anywhere<br \/>  ufw-before-input all -- anywhere anywhere<br \/>  ufw-after-input all -- anywhere anywhere<br \/>  ufw-after-logging-input all -- anywhere anywhere<br \/>  ufw-reject-input all -- anywhere anywhere<br \/>  ufw-track-input all -- anywhere anywhere<\/p>\n<p>  Chain FORWARD (policy DROP)<br \/>  target prot opt source destination<br \/>  ufw-before-logging-forward all -- anywhere anywhere<br \/>  ufw-before-forward all -- anywhere anywhere<br \/>  ufw-after-forward all -- anywhere anywhere<br \/>  ufw-after-logging-forward all -- anywhere anywhere<br \/>  ufw-reject-forward all -- anywhere anywhere<br \/>  ufw-track-forward all -- anywhere anywhere<\/p>\n<p>  Chain OUTPUT (policy ACCEPT)<br \/>  target prot opt source destination<br \/>  ufw-before-logging-output all -- anywhere anywhere<br \/>  ufw-before-output all -- anywhere anywhere<br \/>  ufw-after-output all -- anywhere anywhere<br \/>  ufw-after-logging-output all -- anywhere anywhere<br \/>  ufw-reject-output all -- anywhere anywhere<br \/>  ufw-track-output all -- anywhere anywhere<\/p>\n<p>  Chain ufw-after-forward (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-after-input (1 references)<br \/>  target prot opt source destination<br \/>  ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:netbios-ns<br \/>  ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:netbios-dgm<br \/>  ufw-skip-to-policy-input tcp -- anywhere anywhere tcp dpt:netbios-ssn<br \/>  ufw-skip-to-policy-input tcp -- anywhere anywhere tcp dpt:microsoft-ds<br \/>  ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:bootps<br \/>  ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:bootpc<br \/>  ufw-skip-to-policy-input all -- anywhere anywhere ADDRTYPE match dst-type BROADCAST<\/p>\n<p>  Chain ufw-after-logging-forward (1 references)<br \/>  target prot opt source destination<br \/>  LOG all -- anywhere anywhere limit: avg 3\/min burst 10 LOG level warning prefix \"[UFW BLOCK] \"<\/p>\n<p>  Chain ufw-after-logging-input (1 references)<br \/>  target prot opt source destination<br \/>  LOG all -- anywhere anywhere limit: avg 3\/min burst 10 LOG level warning prefix \"[UFW BLOCK] \"<\/p>\n<p>  Chain ufw-after-logging-output (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-after-output (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-before-forward (1 references)<br \/>  target prot opt source destination<br \/>  ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED<br \/>  ACCEPT icmp -- anywhere anywhere icmp destination-unreachable<br \/>  ACCEPT icmp -- anywhere anywhere icmp source-quench<br \/>  ACCEPT icmp -- anywhere anywhere icmp time-exceeded<br \/>  ACCEPT icmp -- anywhere anywhere icmp parameter-problem<br \/>  ACCEPT icmp -- anywhere anywhere icmp echo-request<br \/>  ufw-user-forward all -- anywhere anywhere<\/p>\n<p>  Chain ufw-before-input (1 references)<br \/>  target prot opt source destination<br \/>  ACCEPT all -- anywhere anywhere<br \/>  ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED<br \/>  ufw-logging-deny all -- anywhere anywhere ctstate INVALID<br \/>  DROP all -- anywhere anywhere ctstate INVALID<br \/>  ACCEPT icmp -- anywhere anywhere icmp destination-unreachable<br \/>  ACCEPT icmp -- anywhere anywhere icmp source-quench<br \/>  ACCEPT icmp -- anywhere anywhere icmp time-exceeded<br \/>  ACCEPT icmp -- anywhere anywhere icmp parameter-problem<br \/>  ACCEPT icmp -- anywhere anywhere icmp echo-request<br \/>  ACCEPT udp -- anywhere anywhere udp spt:bootps dpt:bootpc<br \/>  ufw-not-local all -- anywhere anywhere<br \/>  ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns<br \/>  ACCEPT udp -- anywhere 239.255.255.250 udp dpt:1900<br \/>  ufw-user-input all -- anywhere anywhere<\/p>\n<p>  Chain ufw-before-logging-forward (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-before-logging-input (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-before-logging-output (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-before-output (1 references)<br \/>  target prot opt source destination<br \/>  ACCEPT all -- anywhere anywhere<br \/>  ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED<br \/>  ufw-user-output all -- anywhere anywhere<\/p>\n<p>  Chain ufw-logging-allow (0 references)<br \/>  target prot opt source destination<br \/>  LOG all -- anywhere anywhere limit: avg 3\/min burst 10 LOG level warning prefix \"[UFW ALLOW] \"<\/p>\n<p>  Chain ufw-logging-deny (2 references)<br \/>  target prot opt source destination<br \/>  RETURN all -- anywhere anywhere ctstate INVALID limit: avg 3\/min burst 10<br \/>  LOG all -- anywhere anywhere limit: avg 3\/min burst 10 LOG level warning prefix \"[UFW BLOCK] \"<\/p>\n<p>  Chain ufw-not-local (1 references)<br \/>  target prot opt source destination<br \/>  RETURN all -- anywhere anywhere ADDRTYPE match dst-type LOCAL<br \/>  RETURN all -- anywhere anywhere ADDRTYPE match dst-type MULTICAST<br \/>  RETURN all -- anywhere anywhere ADDRTYPE match dst-type BROADCAST<br \/>  ufw-logging-deny all -- anywhere anywhere limit: avg 3\/min burst 10<br \/>  DROP all -- anywhere anywhere<\/p>\n<p>  Chain ufw-reject-forward (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-reject-input (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-reject-output (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-skip-to-policy-forward (0 references)<br \/>  target prot opt source destination<br \/>  DROP all -- anywhere anywhere<\/p>\n<p>  Chain ufw-skip-to-policy-input (7 references)<br \/>  target prot opt source destination<br \/>  DROP all -- anywhere anywhere<\/p>\n<p>  Chain ufw-skip-to-policy-output (0 references)<br \/>  target prot opt source destination<br \/>  ACCEPT all -- anywhere anywhere<\/p>\n<p>  Chain ufw-track-forward (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-track-input (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-track-output (1 references)<br \/>  target prot opt source destination<br \/>  ACCEPT tcp -- anywhere anywhere ctstate NEW<br \/>  ACCEPT udp -- anywhere anywhere ctstate NEW<\/p>\n<p>  Chain ufw-user-forward (1 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-user-input (1 references)<br \/>  target prot opt source destination<br \/>  <b>ACCEPT tcp -- anywhere anywhere tcp dpt:ssh<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:ssh<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:1935<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:1935<br \/>  ACCEPT udp -- anywhere anywhere multiport dports 16384:32768<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:https<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:https<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:http<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:http<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:5090<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:5090<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:sip<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:sip<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:5066<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:5066<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:tproxy<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:8081<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:8082<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:8082<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:3000<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:3000<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:2855<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:2855<br \/>  ACCEPT tcp -- anywhere anywhere tcp dpt:2856<br \/>  ACCEPT udp -- anywhere anywhere udp dpt:2856<\/b><\/p>\n<p>  Chain ufw-user-limit (0 references)<br \/>  target prot opt source destination<br \/>  LOG all -- anywhere anywhere limit: avg 3\/min burst 5 LOG level warning prefix \"[UFW LIMIT BLOCK] \"<br \/>  REJECT all -- anywhere anywhere reject-with icmp-port-unreachable<\/p>\n<p>  Chain ufw-user-limit-accept (0 references)<br \/>  target prot opt source destination<br \/>  ACCEPT all -- anywhere anywhere<\/p>\n<p>  Chain ufw-user-logging-forward (0 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-user-logging-input (0 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-user-logging-output (0 references)<br \/>  target prot opt source destination<\/p>\n<p>  Chain ufw-user-output (1 references)<br \/>  target prot opt source destination<\/code><\/p>\n<p>  \u0412\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u2013 \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e\u043d\u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<br \/>  \u0414\u043b\u044f \u043f\u043e\u0440\u0442\u0430:<br \/>  <code>sudo ufw allow ssh<\/code> (\u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043f\u043e\u0440\u0442\u0430)<br \/>  <code>sudo ufw allow 22<\/code> (\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430)<br \/>  <code>sudo ufw allow 80\/udp <\/code>(\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e\u0440\u0442\u0430 \u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 tcp \u0438\u043b\u0438 udp)<br \/>  \u0414\u043b\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u043f\u043e\u0440\u0442\u043e\u0432:<br \/>  <code>sudo ufw allow 16384:32768\/udp<\/code><br \/>  \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b: <br \/>  <code>sudo ufw delete allow 80<\/code><\/p>\n<p>  <b>\u0412\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 ufw \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 bbb.<\/b><\/p>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u0440\u0442\u044b \u0441\u043b\u0443\u0448\u0430\u044e\u0442:<br \/>  <code>netstat -ntlp | grep LISTEN<\/code><\/p>\n<p>  <code>tcp 0 0 xxx.xxx.xxx.x:5090 0.0.0.0:* LISTEN 1258\/freeswitch<br \/>  tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN 1720\/soffice.bin<br \/>  <b>tcp 0 0 xxx.xxx.xxx.x:5060 0.0.0.0:* LISTEN 1258\/freeswitch<\/b><br \/>  tcp 0 0 127.0.0.1:8101 0.0.0.0:* LISTEN 1766\/soffice.bin<br \/>  tcp 0 0 127.0.0.1:8102 0.0.0.0:* LISTEN 1811\/soffice.bin<br \/>  tcp 0 0 127.0.0.1:8103 0.0.0.0:* LISTEN 1856\/soffice.bin<br \/>  <b>tcp 0 0 xxx.xxx.xxx.x:2855 0.0.0.0:* LISTEN 1258\/freeswitch<\/b><br \/>  tcp 0 0 127.0.0.1:8104 0.0.0.0:* LISTEN 1902\/soffice.bin<br \/>  <b>tcp 0 0 xxx.xxx.xxx.x:2856 0.0.0.0:* LISTEN 1258\/freeswitch<\/b><br \/>  tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 1186\/mongod<br \/>  <b>tcp 0 0 xxx.xxx.xxx.x:5066 0.0.0.0:* LISTEN 1258\/freeswitch<\/b><br \/>  tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1227\/redis-server 1<br \/>  tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1359\/nginx -g daemo<br \/>  <b>tcp 0 0 xxx.xxx.xxx.x:8081 0.0.0.0:* LISTEN 1258\/freeswitch<\/b><br \/>  <b>tcp 0 0 xxx.xxx.xxx.x:8082 0.0.0.0:* LISTEN 1258\/freeswitch<\/b><br \/>  <b>tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1176\/sshd<\/b><br \/>  <b>tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 1195\/node<\/b><br \/>  tcp6 0 0 ::1:5090 :::* LISTEN 1258\/freeswitch<br \/>  tcp6 0 0 ::1:5060 :::* LISTEN 1258\/freeswitch<br \/>  tcp6 0 0 127.0.0.1:8005 :::* LISTEN 1341\/java<br \/>  tcp6 0 0 :::5070 :::* LISTEN 1461\/java<br \/>  tcp6 0 0 :::9999 :::* LISTEN 1461\/java<br \/>  tcp6 0 0 :::1935 :::* LISTEN 1461\/java<br \/>  tcp6 0 0 :::8080 :::* LISTEN 1341\/java<br \/>  tcp6 0 0 :::80 :::* LISTEN 1359\/nginx -g daemo<br \/>  tcp6 0 0 ::1:8081 :::* LISTEN 1258\/freeswitch<br \/>  tcp6 0 0 ::1:8082 :::* LISTEN 1258\/freeswitch<br \/>  tcp6 0 0 :::8021 :::* LISTEN 1258\/freeswitch<br \/>  tcp6 0 0 :::22 :::* LISTEN 1176\/sshd<br \/>  tcp6 0 0 :::5080 :::* LISTEN 1461\/java<\/code><\/p>\n<p>  \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0441 xxx.xxx.xxx.x (xxx.xxx.xxx.x \u2013 ip-\u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430), \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 \u0432\u0441\u0435\u0445 \u0441\u0435\u0442\u0435\u0439 (0.0.0.0:*). \u0421\u0442\u0440\u043e\u0447\u043a\u0438 \u0441 127.0.0.1 \u043d\u0430\u0441 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0441\u0442\u043e\u0447\u043a\u0438 \u0441 0.0.0.0 \u0432 4 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 (\u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0436\u0438\u0440\u043d\u044b\u043c), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <br \/>  <code>tcp 0 0 <b>0.0.0.0:80<\/b> 0.0.0.0:* LISTEN 1359\/nginx -g daemo<\/code><br \/>  \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e 80 \u043f\u043e\u0440\u0442 \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0435\u0442\u0435\u0439.<br \/>  \u0418\u0442\u0430\u043a, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<br \/>  <code>sudo ufw allow 22<\/code> \u0434\u043b\u044f ssh<br \/>  <code>sudo ufw allow 80<\/code> \u0434\u043b\u044f \u0432\u0435\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u0430 nginx \u0438\u043b\u0438 apache<\/p>\n<p>  \u0426\u0435\u043b\u044b\u0439 \u0440\u044f\u0434 \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043b\u044f freeswitch:<br \/>  <code>sudo ufw allow 5060<br \/>  sudo ufw allow 5090<br \/>  sudo ufw allow 2855<br \/>  sudo ufw allow 2856<br \/>  sudo ufw allow 5066<br \/>  sudo ufw allow 8081<br \/>  sudo ufw allow 8082<\/code><\/p>\n<p>  \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 node:<br \/>  <code>sudo ufw allow 3000<\/code> <\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0440\u0442\u044b:<br \/>  <code>sudo ufw allow 16384:32768\/udp <\/code> \u2014 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b WebRTC<br \/>  <code>sudo ufw allow 443<\/code><br \/>  <code>sudo ufw allow 1935<\/code><\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 ufw \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 BigBlueButton 2.0 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c ssh \u0438\u043b\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u0442, \u0438\u043b\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0440\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0441\u0435\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f.<br \/>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432\u0430\u0448 \u0448\u043b\u044e\u0437 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043e\u0434\u0438\u043d \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 (\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c) 192.168.3.2, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 105.\u0445\u0445\u0445.\u0445\u0445\u0445.\u0445\u0445\u0445 (\u043a \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0443), \u0432\u043e\u0442 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 ufw \u0431\u0435\u0440\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 ip, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u044d\u0442\u043e\u0442 ip.<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0440\u0442 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 SSH \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u043b\u044e\u0431\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c: <br \/>  <code>vim \/etc\/ssh\/sshd_config<\/code><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 22 \u043f\u043e\u0440\u0442:<br \/>  <code>Sudo ufw delete allow 22 <\/code>\u2013 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f OpenSSH.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u0440\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0441\u0435\u0442\u0438 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f:<\/p>\n<p>  <code>sudo ufw allow from 105.\u0445\u0445\u0445.\u0445\u0445\u0445.\u0445\u0445\u0445\/26 to any port 4321<\/code><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c ssh \u0441\u0435\u0440\u0432\u0438\u0441:<br \/>  <code>\/etc\/init.d\/ssh restart<\/code><\/p>\n<p>  \u0418 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<br \/>  <code>netstat -ntlp | grep LISTEN<\/code><\/p>\n<p>  <code>tcp 0 0.0.0.0:4321 0.0.0.0:* listen 5676\/sshd<\/code><\/p>\n<p>  \u0430 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 ufw \u0443\u0432\u0438\u0434\u0438\u043c, \u043a\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0440\u0442\u0443:<br \/>  <code>ufw status<\/code><\/p>\n<p>  <code>4321 ALLOW 105.xxx.xxx.xxx\/26<\/code><\/p>\n<p>  \u0423\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0448\u0443 \u0412\u0430\u0441 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445: \u041a\u0430\u043a \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435, \u0432\u0441\u0435 \u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u0438\u043b\u0438 \u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0442\u043e-\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c?<\/p><\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/420973\/\"> https:\/\/habr.com\/post\/420973\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420973\/\" class=\"post__text post__text-html js-mediator-article\">UFW (Uncomplicated Firewall) \u2013 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 iptables, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0430. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 iptables \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439, \u043d\u043e \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u042f \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0432 \u044d\u0442\u043e\u043c \u0434\u0435\u043b\u0435.<br \/>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 iptables \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 ACCEPT \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-288379","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288379"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288379\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}