sudo iptables -I OUTPUT -j DROP
sudo iptables -I OUTPUT -d 123.123.123.123 -j ACCEPT
sudo iptables -I OUTPUT -p udp --dport 53 -j ACCEPT
sudo iptables -I OUTPUT -p udp --sport 53 -j ACCEPT
sudo iptables -I OUTPUT -o tun0 -j ACCEPT
alex@alex-ubuntu:~$ sudo iptables -L -n -v
Chain INPUT (policy ACCEPT 613 packets, 273K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
273 49582 ACCEPT all -- * tun0 0.0.0.0/0 0.0.0.0/0
49 5860 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp spt:53
59 4355 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:53
300 76908 ACCEPT all -- * * 0.0.0.0/0 123.123.123.123
132 13444 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
https://www.digitalocean.com/community/tutorials/h...
https://www.8host.com/blog/sozdanie-intraseti-s-po...