Sem acesso à Internet quando conectado ao meu servidor OpenVPN no AWS EC2 Ubuntu

0

Depois de conectar minhas máquinas Linux ao meu servidor VPN do Ubuntu 16.04 na instância do AWS ec2, perco conexão com a Internet, mas consigo executar ping no servidor VPN.

conf servidor:

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
client-config-dir ccd
route 10.8.0.0 255.255.255.252
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
client-to-client
keepalive 10 120
tls-auth ta.key 0 # This file is secret
key-direction 0
cipher AES-128-CBC   # AES
auth SHA256
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3

configuração do cliente:

client
dev tun
proto udp
remote myserver 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
remote-cert-tls server
cipher AES-128-CBC
auth SHA256
key-direction 1
comp-lzo
verb 3
Cerificates...

ccd / client:

ifconfig-push 10.8.0.26 255.255.255.0

route -n quando conectado à vpn:

route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.8.0.1        128.0.0.0       UG    0      0        0 tun0
0.0.0.0         172.29.25.1     0.0.0.0         UG    100    0        0 eth0
10.8.0.0        0.0.0.0         255.255.255.0   U     0      0        0 tun0
vpnserverIP   172.29.25.1     255.255.255.255 UGH   0      0        0 eth0
128.0.0.0       10.8.0.1        128.0.0.0       UG    0      0        0 tun0
172.29.25.0     0.0.0.0         255.255.255.0   U     100    0        0 eth0

ifconfig tun0 :

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
    inet 10.8.0.26  netmask 255.255.255.0  destination 10.8.0.26
    inet6 fe80::c922:ab77:1b0c:5095  prefixlen 64  scopeid 0x20<link>
    unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 1039  bytes 129116 (126.0 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
por Russ 13.07.2017 / 23:08

1 resposta

0

Finalmente encontrei uma solução quando definia meu pi como um roteador wifi, sabia que havia um problema de firewall, então essas linhas solucionaram problemas de tráfego:

-A POSTROUTING -s 10.8.0.0/16 -o eth0 -j MASQUERADE -A FRENTE -i eth0 -o tun0 -m estado - estado RELACIONADO, ESTABELECIDO -j ACEITAR -A FORWARD -i tun0 -o eth0 -j ACEITAR

se usar o ufw, transfira as regras de acordo!

    
por Russ 08.08.2017 / 23:25