Open seanthegeek opened 7 years ago
hm everything looks fine, it works with curl --interface tun0 ipinfo.io/json
?
Hmmm
curl --interface tun0 ipinfo.io/json
Gives my actual IP info, not the one for the VPN
I wonder if my route-nopull
(ignore pushed gateways) VPN client config option is preventing tun0
from being routed properly? Without that option, all server traffic is routed through the VPN, which I do not want.
hm i have default options in .ovpns and they works fine
client
dev tun1
proto udp
remote REPOTE ADDRESS HERE 1194
resolv-retry infinite
nobind
persist-key
persist-tun
persist-remote-ip
;ca TUNNEL HERE
comp-lzo
verb 3
<ca>
ca here
</ca>
Ok, after a bit more research, trial, and error, I discovered that I had to remove the route-nopull
and add a route
command to the config for my local network in order to maintain local connectivity, and be able to access the server from my local network.
route 10.0.0.0 255.0.0.0 10.205.2.1 # Local network
route 192.168.100.0 255.255.255.0 192.168.200.1 # KVM virbr0 bridge
Now curl --interface tun0 ipinfo.io/json
and utils/vpncheck.py
each return the proper VPN IP information.
However, the VM still does not have access to the internet at all. The DNS request from a URL analysis is captured, but to reply is received.
Are you using the KVM backend?
weird, add print to router to see if all commands applied correctly, yes i'm use kvm
I'll check & unit test soon'ish if VPN is still working correctly etc :) Thanks for feedback.
@doomedraven I finally got around to doing more testing. Here is the output you asked for:
You are running a development version! Current stable is 2.0-rc1. INFO:cuckoo-rooter:Processing command: forward_drop
INFO:cuckoo-rooter:Processing command: forward_drop
INFO:cuckoo-rooter:Processing command: forward_drop
INFO:cuckoo-rooter:Processing command: nic_available tun0 INFO:cuckoo-rooter:Processing command: rt_available us.mullvad.net INFO:cuckoo-rooter:Processing command: nic_available tun0 INFO:cuckoo-rooter:Processing command: nic_available tun0 INFO:cuckoo-rooter:Processing command: disable_nat tun0 INFO:cuckoo-rooter:Processing command: rt_available us.mullvad.net INFO:cuckoo-rooter:Processing command: enable_nat tun0 INFO:cuckoo-rooter:Processing command: rt_available us.mullvad.net INFO:cuckoo-rooter:Processing command: disable_nat tun0 INFO:cuckoo-rooter:Processing command: flush_rttable us.mullvad.net INFO:cuckoo-rooter:Processing command: disable_nat tun0 INFO:cuckoo-rooter:Processing command: enable_nat tun0 INFO:cuckoo-rooter:Processing command: init_rttable us.mullvad.net tun0 INFO:cuckoo-rooter:Processing command: enable_nat tun0 INFO:cuckoo-rooter:Processing command: flush_rttable us.mullvad.net INFO:cuckoo-rooter:Processing command: flush_rttable us.mullvad.net INFO:cuckoo-rooter:Processing command: init_rttable us.mullvad.net tun0 INFO:cuckoo-rooter:Processing command: init_rttable us.mullvad.net tun0 INFO:cuckoo-rooter:Processing command: forward_drop
INFO:cuckoo-rooter:Processing command: nic_available tun0 INFO:cuckoo-rooter:Processing command: rt_available us.mullvad.net INFO:cuckoo-rooter:Processing command: disable_nat tun0 INFO:cuckoo-rooter:Processing command: enable_nat tun0 INFO:cuckoo-rooter:Processing command: flush_rttable us.mullvad.net INFO:cuckoo-rooter:Processing command: init_rttable us.mullvad.net tun0 INFO:cuckoo-rooter:Processing command: forward_drop
INFO:cuckoo-rooter:Processing command: nic_available tun0 INFO:cuckoo-rooter:Processing command: rt_available us.mullvad.net INFO:cuckoo-rooter:Processing command: disable_nat tun0 INFO:cuckoo-rooter:Processing command: enable_nat tun0 INFO:cuckoo-rooter:Processing command: flush_rttable us.mullvad.net INFO:cuckoo-rooter:Processing command: init_rttable us.mullvad.net tun0017-02-28 19:48:07,585 [lib.cuckoo.core.scheduler] INFO: Using "kvm" as machine manager 2017-02-28 19:48:07,720 [lib.cuckoo.core.scheduler] INFO: Loaded 1 machine/s INFO:cuckoo-rooter:Processing command: forward_disable virbr0 tun0 192.168.100.42 2017-02-28 19:48:07,736 [lib.cuckoo.core.scheduler] INFO: Waiting for analysis tasks. 2017-02-28 19:49:15,137 [lib.cuckoo.core.scheduler] INFO: Starting analysis of URL "http://whatismyipaddress.com/" (task #10, options "route=us,procmemdump=yes") 2017-02-28 19:49:15,170 [lib.cuckoo.core.scheduler] INFO: Task #10: acquired machine win7 (label=win7) 2017-02-28 19:49:15,179 [modules.auxiliary.sniffer] INFO: Started sniffer with PID 3889 (interface=virbr0, host=192.168.100.42, pcap=/opt/cuckoo/storage/analyses/10/dump.pcap) INFO:cuckoo-rooter:Processing command: nic_available tun0 INFO:cuckoo-rooter:Processing command: forward_enable virbr0 tun0 192.168.100.42 INFO:cuckoo-rooter:Processing command: srcroute_enable us.mullvad.net 192.168.100.42
Here is my vpn.conf
:
[vpn] enabled = yes
vpns = us
[us] name = us
description = United States
interface = tun0
rt_table = us.mullvad.net
I wasn't quite sure what is needed for the rt_table
. I've also tried setting that to tun0
with no change.
Anything jump out?
I'm going to have to take a quick look soon :-) Will keep you posted.. I think srcroute_enable
/_disable
are missing, but that's about all I can say right now. Also might be useful to clear pending iptables
rules after running that stuff for a while with interrupts etc (otherwise there might still be some rules left).
rt_table is correct in vpn.conf, rt_table should be the same as in /etc/iproute2/rt_tables
number:rt_table_name
check also ip route
you should see something like
X/24 dev tunX proto kernel scope link src X
I'm trying to get VPN routing working. I installed OpenVPN and resolvconf, configured and started an OpenVPN client connection at
/etc/openvpn/us.conf
:I configured Cuckoo's
kvm.conf
:I also added
42 tun0
to/etc/iproute2/rt_tables
, and startedrooter.py
, but the actions byrooter.py
do not do not redirect the VPN's traffic. What could be going wrong.