A
A
AkZwork2017-07-15 18:30:54
openvpn
AkZwork, 2017-07-15 18:30:54

Why does traffic still go through the regular Internet?

Did according to the instructions:

0. sudo su
1. nano /etc/iptables.sh

Содержимое файла:
***
#!/bin/bash
# Очищаем правила iptables
iptables -F
iptables -F -t nat
iptables -F -t mangle
iptables -X
iptables -t nat -X
iptables -t mangle -X
# Устанавливаем правила по умолчанию (запретить любой трафик)
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
# Разрешаем локальный трафик для loopback
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Пропускать все инициированные соединения, а также дочерние от них
iptables -A INPUT -p all -m state —state ESTABLISHED,RELATED -j ACCEPT
# Отбрасывать пакеты, которые не могут быть идентифицированы
iptables -A INPUT -m state —state INVALID -j DROP 
iptables -A OUTPUT -o tun0 -j ACCEPT
iptables -A OUTPUT -p udp -d [здесь мой VPN IP]/32 —dport 1194 -j ACCEPT
# Сохраняем правила
/sbin/iptables-save > /etc/iptables_rules
***

2. chmod 0740 iptables.sh

3. sh /etc/iptables.sh

4. nano /etc/network/interfaces
добавить строчку: post-up iptables-restore < /etc/iptables_rules

5. 
echo «#disable ipv6» | tee -a /etc/sysctl.conf
echo «net.ipv6.conf.all.disable_ipv6 = 1» | tee -a /etc/sysctl.conf
echo «net.ipv6.conf.default.disable_ipv6 = 1» | tee -a /etc/sysctl.conf
echo «net.ipv6.conf.lo.disable_ipv6 = 1» | tee -a /etc/sysctl.conf
sysctl -p

However, traffic when Openvpn breaks still goes through the regular Internet. What's the matter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Vasiliev, 2017-07-20
@qmax

In order for traffic to go where it is needed, it is necessary to configure the routing table and not the firewall.
Or formulate questions more clearly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question