R
R
rodion-dev2015-03-05 22:34:40
linux
rodion-dev, 2015-03-05 22:34:40

How to protect against traffic leaks when vpn breaks in ubuntu?

Hello.
tell me how to protect against traffic leaks when vpn breaks in ubuntu?
if now the Internet is not through open vpn, then no traffic of any type should go to the vpn network
, it can be different, besides, the input ips often change, and the connection is via a domain,
so you won’t be able to register ip vpn. you need the port.
such rules were tried, they do not work, it is not possible to connect to vpn with them.
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -o wlan0 -p udp --dport 1194 -j ACCEPT
iptables -A INPUT -i tun0 -j ACCEPT
iptables -A OUTPUT -o tun0 -j ACCEPT
iptables -A FORWARD -o tun0 -j ACCEPT
iptables -A INPUT -s 0.0.0.0/0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -d 0.0 .0.0/0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p udp ! --dport 1194 -o wlan0 -j DROP
iptables -A INPUT -p udp ! --sport 1194 -i wlan0 -j DROP

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rodion-dev, 2015-03-06
@rodion-dev

does anyone have any ideas?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question