How can I confirm internet traffic goes via VPN?
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
How can I confirm internet traffic goes via VPN?
When I configure my client to connect to the server remotely, it connects. But I can't tell if my internet traffic is actually going through the VPN. How can I confirm or deny that?
When I travel with my laptop, I'd like to have all internet traffic go through my OpenVPN.
When I travel with my laptop, I'd like to have all internet traffic go through my OpenVPN.
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: How can I confirm internet traffic goes via VPN?
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
But that's the same. I'm doing the work of developing it at home.
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
Ok. I took my laptop to a local place that has free WiFi.
OpenVPN shows that it connected to my server. The server has this in the config file:
But when I use my browser to connect to the internet with the VPN connection active, I'm able to browse without a problem but the IP address is NOT that of my server's outside IP address.
I've been reading more about this and it's my understanding that if I am going to try and force all traffic to use the VPN, then I need IPTABLES rules on the server. But it seems to me that even if I don't have those set up yet (I'm still trying to learn how to set those up properly) if the computer tries unsuccessfull to send data through the VPN, the browser would tell me it coulnd't contact the server.
It seems like this is a two pronged problem: 1) getting the laptop to use the VPN for its traffic and 2) getting the server to understand what to do with the data that it receives.
OpenVPN shows that it connected to my server. The server has this in the config file:
Code: Select all
#push "redirect-gateway def1 bypass-dhcp"
push "redirect-gateway def1"
I've been reading more about this and it's my understanding that if I am going to try and force all traffic to use the VPN, then I need IPTABLES rules on the server. But it seems to me that even if I don't have those set up yet (I'm still trying to learn how to set those up properly) if the computer tries unsuccessfull to send data through the VPN, the browser would tell me it coulnd't contact the server.
It seems like this is a two pronged problem: 1) getting the laptop to use the VPN for its traffic and 2) getting the server to understand what to do with the data that it receives.
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: How can I confirm internet traffic goes via VPN?
please post configs for both ends
Michael.
Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
From the config file on the server (which is a Raspberry Pi running Raspian connected via ethernet to my DLink WRT54GS router which is in turn connected to my cable modem):
From the config file on the client (which is a Win7 64 bit laptop):
And from the server's iptables:
Code: Select all
port 9999
proto udp
dev tun
ca /etc/openvpn/config/RasPiHomeNAS-domainname.com/ca.crt
cert /etc/openvpn/config/RasPiHomeNAS-domainname.com/RasPiHomeNAS.domainname.com.crt
key /etc/openvpn/config/RasPiHomeNAS-domainname.com/RasPiHomeNAS.domainname.com.key
dh /etc/openvpn/config/RasPiHomeNAS-domainname.com/dh1024.pem
server 10.8.1.0 255.255.255.0
ifconfig-pool-persist /var/lib/openvpn/RasPiHomeNAS-domainname.com/ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
tls-auth /etc/openvpn/config/RasPiHomeNAS-domainname.com/ta.key 0
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/RasPiHomeNAS-domainname.com/openvpn-status.log
log-append /var/log/openvpn/RasPiHomeNAS-domainname.com/openvpn.log
verb 3
crl-verify /etc/openvpn/config/RasPiHomeNAS-domainname.com/crl.pem
client-config-dir /etc/openvpn/config/RasPiHomeNAS-domainname.com/clients-configs
push "route 10.2.1.0 255.255.255.0"; Allow access to local network.
Code: Select all
client
dev tun
proto udp
remote RasPiHome.domainname.com 9999
resolv-retry infinite
nobind
persist-key
persist-tun
ca "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-domainname.com\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-domainname.com\\PC6.RasPiHomeNAS-domainname.com.crt"
key "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-domainname.com\\PC6.RasPiHomeNAS-domainname.com.key"
ns-cert-type server
tls-auth "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-domainname.com\\ta.key" 1
comp-lzo
verb 3
Code: Select all
*filter
# Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 -j REJECT
# Accept all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow all outbound traffic - you can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT
# Allow OpenVPN Internet Usage
-A INPUT -p udp -m udp --dport 9999 -j ACCEPT
-A FORWARD -s 10.8.1.0/24 -j ACCEPT
# Allow Samba Connections
-A INPUT -p udp -m udp --dport 137 -j ACCEPT
-A INPUT -p udp -m udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
# Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL).
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# Allow SSH connections
#
# The -dport number should be the same port number you set in sshd_config
#
-A INPUT -p tcp -m state --state NEW --dport 9922 -j ACCEPT
# Allow ping
-A INPUT -p icmp -j ACCEPT
# Log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
# Drop all other inbound - default deny unless explicitly allowed policy
-A INPUT -j DROP
-A FORWARD -j DROP
COMMIT
*nat
-A POSTROUTING -s 10.8.1.0/24 -o eth0 -j MASQUERADE
COMMIT
Last edited by doni49 on Mon Jun 17, 2013 11:40 pm, edited 1 time in total.
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
Also the OpenVPN server's IP address (the one created by OpenVPN itself) is 10.8.1.1. The client has been assigned an IP address of 10.8.1.6. I've noticed that IPCONFIG shows the client's "Default Gateway" is 10.8.1.5. Shouldn't this be 10.8.1.1 (the OpenVPN server)?
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
I just realized I made an incorrect statement in my last post.
Here's what IPCONFIG tells me about the TAP connection:
Here's what IPCONFIG tells me about the TAP connection:
It's the DHCP server that is 10.8.1.5. The default gateway is BLANK.Ethernet adapter Local Area Connection 2:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Windows Adapter V9
Physical Address. . . . . . . . . : 00-FF-AC-8D-91-6C
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::5d6c:3f00:39f8:b5d2%19(Preferred)
IPv4 Address. . . . . . . . . . . : 10.8.1.6(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.252
Lease Obtained. . . . . . . . . . : Monday, June 17, 2013 8:58:00 PM
Lease Expires . . . . . . . . . . : Tuesday, June 17, 2014 8:58:00 PM
Default Gateway . . . . . . . . . :
DHCP Server . . . . . . . . . . . : 10.8.1.5
DHCPv6 IAID . . . . . . . . . . . : 318832556
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-18-37-E6-1D-E8-11-32-C9-12-36
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
This morning, I realized that in one of my earlier posts in this thread, I said something that is no longer true.
It seems that the laptop IS at least attempting to route its traffic through the VPN connection. If the VPN is active, then I'm unable to browse the internet. As soon as I disconnect the VPN, I'm able to browse the internet again.
But I don't know if the issue is with my iptables entries or because the default gateway is blank (or a combination of both).
It seems that the laptop IS at least attempting to route its traffic through the VPN connection. If the VPN is active, then I'm unable to browse the internet. As soon as I disconnect the VPN, I'm able to browse the internet again.
But I don't know if the issue is with my iptables entries or because the default gateway is blank (or a combination of both).
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
The author of the the blog post at the following link has described my setup pretty well. But I followed his steps with no success (I was already almost there).
http://blog.remibergsma.com/2013/01/27/ ... pberry-pi/
My router's IP is 10.2.1.1. The RasPi (openvpn server) is 10.2.1.50 eth0 and 10.8.1.1 on tun0.
So I added a route to the RasPi:
I've confirmed that it's NOT a problem with a DNS server because I tried pinging the IP address for my own personal web site (shared hosting site). I get the ping replies if the OpenVPN connection is disconnected but don't if it's active.
http://blog.remibergsma.com/2013/01/27/ ... pberry-pi/
My router's IP is 10.2.1.1. The RasPi (openvpn server) is 10.2.1.50 eth0 and 10.8.1.1 on tun0.
So I added a route to the RasPi:
Code: Select all
route add -net 10.8.1.0/24 gw 10.2.1.1
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: How can I confirm internet traffic goes via VPN?
hello there,
some things to check:
on your pi:
is ip forwarding enabled?
can you post the output of: iptables -L -t nat -v
output of : netstat -nr
on your client:
please post the output of: netstat -nr
before & after vpn connects
please remove the static route you added by hand on your pi.
Michael.
some things to check:
on your pi:
is ip forwarding enabled?
can you post the output of: iptables -L -t nat -v
output of : netstat -nr
on your client:
please post the output of: netstat -nr
before & after vpn connects
please remove the static route you added by hand on your pi.
Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
RasPi Side netstat -nr:
RasPi Side iptables -L -t nat -v:Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.2.1.1 0.0.0.0 UG 0 0 0 eth0
10.2.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
Client Side netstat -nr (BEFORE VPN):Chain PREROUTING (policy ACCEPT 18 packets, 2824 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 3 packets, 152 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 8 packets, 590 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 8 packets, 590 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- any eth0 10.8.0.0/24 anywhere
Client Side After VPN Connection:C:\windows\system32>netstat -nr
===========================================================================
Interface List
19...00 ff ac 8d 91 6c ......TAP-Windows Adapter V9
14...e0 ca 94 2b 05 0e ......Bluetooth Device (Personal Area Network)
12...24 77 03 08 95 ac ......Intel(R) Centrino(R) Ultimate-N 6300 AGN
1...........................Software Loopback Interface 1
41...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
42...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
17...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
23...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #4
20...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #5
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.2.1.1 10.2.1.103 25
10.2.1.0 255.255.255.0 On-link 10.2.1.103 281
10.2.1.103 255.255.255.255 On-link 10.2.1.103 281
10.2.1.255 255.255.255.255 On-link 10.2.1.103 281
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 10.2.1.103 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 10.2.1.103 281
===========================================================================
Persistent Routes:
None
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
17 58 ::/0 On-link
1 306 ::1/128 On-link
17 58 2001::/32 On-link
17 306 2001:0:9d38:6ab8:10bb:1120:52e6:e7bd/128
On-link
12 281 fe80::/64 On-link
17 306 fe80::/64 On-link
17 306 fe80::10bb:1120:52e6:e7bd/128
On-link
12 281 fe80::98fd:eff7:eec:2bca/128
On-link
1 306 ff00::/8 On-link
17 306 ff00::/8 On-link
12 281 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
C:\windows\system32>
===========================================================================
Interface List
19...00 ff ac 8d 91 6c ......TAP-Windows Adapter V9
14...e0 ca 94 2b 05 0e ......Bluetooth Device (Personal Area Network)
12...24 77 03 08 95 ac ......Intel(R) Centrino(R) Ultimate-N 6300 AGN
1...........................Software Loopback Interface 1
41...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
42...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
17...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
23...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #4
20...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #5
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.2.1.1 10.2.1.103 25
0.0.0.0 128.0.0.0 10.8.0.5 10.8.0.6 30
10.2.1.0 255.255.255.0 On-link 10.2.1.103 281
10.2.1.0 255.255.255.0 10.8.0.5 10.8.0.6 30
10.2.1.1 255.255.255.255 10.2.1.1 10.2.1.103 25
10.2.1.50 255.255.255.255 10.2.1.1 10.2.1.103 25
10.2.1.103 255.255.255.255 On-link 10.2.1.103 281
10.2.1.255 255.255.255.255 On-link 10.2.1.103 281
10.8.0.1 255.255.255.255 10.8.0.5 10.8.0.6 30
10.8.0.4 255.255.255.252 On-link 10.8.0.6 286
10.8.0.6 255.255.255.255 On-link 10.8.0.6 286
10.8.0.7 255.255.255.255 On-link 10.8.0.6 286
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
128.0.0.0 128.0.0.0 10.8.0.5 10.8.0.6 30
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 10.2.1.103 281
224.0.0.0 240.0.0.0 On-link 10.8.0.6 286
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 10.2.1.103 281
255.255.255.255 255.255.255.255 On-link 10.8.0.6 286
===========================================================================
Persistent Routes:
None
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
1 306 ::1/128 On-link
12 281 fe80::/64 On-link
19 286 fe80::/64 On-link
19 286 fe80::5d6c:3f00:39f8:b5d2/128
On-link
12 281 fe80::98fd:eff7:eec:2bca/128
On-link
1 306 ff00::/8 On-link
12 281 ff00::/8 On-link
19 286 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: How can I confirm internet traffic goes via VPN?
hello there,
very nice output but you still dont answer one of my questions...
Michael.
very nice output but you still dont answer one of my questions...
which is the most important one...is ip forwarding enabled?

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
Sorry. Yes it is.
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: How can I confirm internet traffic goes via VPN?
hi there,
there is an inconsistencie on your above posts...
to be more specific:
&
so your vpn network is 10.8.1.0....
but later...
so your openvpn tun range is 10.8.0.0/24 or 10.8.1.0/24?
please ALWAYS post your CURRENT configs and logs...
Michael.
there is an inconsistencie on your above posts...
to be more specific:
Code: Select all
server 10.8.1.0 255.255.255.0
Code: Select all
-A POSTROUTING -s 10.8.1.0/24 -o eth0 -j MASQUERADE
but later...
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.2.1.1 0.0.0.0 UG 0 0 0 eth0
10.2.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
Chain POSTROUTING (policy ACCEPT 8 packets, 590 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- any eth0 10.8.0.0/24 anywhere
so your openvpn tun range is 10.8.0.0/24 or 10.8.1.0/24?
please ALWAYS post your CURRENT configs and logs...
Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
Yes. I've continued to try and troubleshoot this myself. I noticed that everything I was reading showed the VPN server IP as 10.8.0.1. So I changed mine to that and I went through and searched for every instance of 10.8.1.x that I could find. I did this because I thought MAYBE I had used the IP address as I read it.
I have not changed anything since I posted the tables last night--I put it away and went to bed.
Server config file:
Client Config:
Here's the log from my last attempt last night's connection (maybe it'll help):
I have not changed anything since I posted the tables last night--I put it away and went to bed.
Server config file:
Code: Select all
#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients <-> one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #
# single-machine <-> single-machine #
# configurations (See the Examples page #
# on the web site for more info). #
# #
# This config should work on Windows #
# or Linux/BSD systems. Remember on #
# Windows to quote pathnames and use #
# double backslashes, e.g.: #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
# #
# Comments are preceded with '#' or ';' #
#################################################
# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d
# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one. You will need to
# open up this port on your firewall.
port 1194
# TCP or UDP server?
;proto tcp
proto udp
# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one. On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap
# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key). Each client
# and the server must have their own cert and
# key file. The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys. Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca /etc/openvpn/config/RasPiHomeNAS-donireland.com/ca.crt
cert /etc/openvpn/config/RasPiHomeNAS-donireland.com/RasPiHomeNAS.donireland.com.crt
key /etc/openvpn/config/RasPiHomeNAS-donireland.com/RasPiHomeNAS.donireland.com.key
# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
dh /etc/openvpn/config/RasPiHomeNAS-donireland.com/dh1024.pem
# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0
# Maintain a record of client <-> virtual IP address
# associations in this file. If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt
# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface. Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0. Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients. Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses. You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge
# Push routes to the client to allow it
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
push "route 10.2.1.0 255.255.255.0"
# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).
# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
# iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN. This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.
# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
# ifconfig-push 10.9.0.1 10.9.0.2
# Suppose that you want to enable different
# firewall access policies for different groups
# of clients. There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
# group, and firewall the TUN/TAP interface
# for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
# modify the firewall in response to access
# from different clients. See man
# page for more info on learn-address script.
;learn-address ./script
# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
push "redirect-gateway def1 bypass-dhcp"
# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses. CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client
# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn
# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120
# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
# openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
tls-auth /etc/openvpn/config/RasPiHomeNAS-donireland.com/ta.key 0
# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC # Blowfish (default)
;cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES
# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo
# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100
# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nogroup
# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun
# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log
# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it. Use one
# or the other (but not both).
;log openvpn.log
;log-append openvpn.log
# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3
# Silence repeating messages. At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20
# Revoked certificate list
crl-verify /etc/openvpn/config/RasPiHomeNAS-donireland.com/crl.pem
Code: Select all
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
##############################################
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client
# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one. On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap
# Are we connecting to a TCP or
# UDP server? Use the same setting as
# on the server.
;proto tcp
proto udp
# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
;remote RasPiHomeNAS.donireland.com 1194
remote 10.2.1.50 1194
# Choose a random host from the remote
# list for load-balancing. Otherwise
# try hosts in the order specified.
;remote-random
# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite
# Most clients don't need to bind to
# a specific local port number.
nobind
# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nogroup
# Try to preserve some state across restarts.
persist-key
persist-tun
# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here. See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
# Wireless networks often produce a lot
# of duplicate packets. Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings
# SSL/TLS parms.
# See the server config file for more
# description. It's best to use
# a separate .crt/.key file pair
# for each client. A single ca
# file can be used for all clients.
ca "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-donireland.com\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-donireland.com\\PC6.RasPiHomeNAS-donireland.com.crt"
key "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-donireland.com\\PC6.RasPiHomeNAS-donireland.com.key"
# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server". This is an
# important precaution to protect against
# a potential attack discussed here:
# http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server". The build-key-server
# script in the easy-rsa folder will do this.
ns-cert-type server
# If a tls-auth key is used on the server
# then every client must also have the key.
tls-auth "C:\\Program Files\\OpenVPN\\config\\RasPiHomeNAS-donireland.com\\ta.key" 1
# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
;cipher x
# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
comp-lzo
# Set log file verbosity.
verb 3
# Silence repeating messages
;mute 20
Code: Select all
Thu Jun 20 21:10:16 2013 OpenVPN 2.3.2 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [eurephia] [IPv6] built on Jun 3 2013
Enter Management Password:
Thu Jun 20 21:10:16 2013 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Thu Jun 20 21:10:16 2013 Need hold release from management interface, waiting...
Thu Jun 20 21:10:16 2013 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Thu Jun 20 21:10:16 2013 MANAGEMENT: CMD 'state on'
Thu Jun 20 21:10:16 2013 MANAGEMENT: CMD 'log all on'
Thu Jun 20 21:10:16 2013 MANAGEMENT: CMD 'hold off'
Thu Jun 20 21:10:16 2013 MANAGEMENT: CMD 'hold release'
Thu Jun 20 21:10:17 2013 Control Channel Authentication: using 'C:\Program Files\OpenVPN\config\RasPiHomeNAS-donireland.com\ta.key' as a OpenVPN static key file
Thu Jun 20 21:10:17 2013 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Jun 20 21:10:17 2013 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Jun 20 21:10:17 2013 Socket Buffers: R=[8192->8192] S=[8192->8192]
Thu Jun 20 21:10:17 2013 UDPv4 link local: [undef]
Thu Jun 20 21:10:17 2013 UDPv4 link remote: [AF_INET]10.2.1.50:1194
Thu Jun 20 21:10:17 2013 MANAGEMENT: >STATE:1371780617,WAIT,,,
Thu Jun 20 21:10:17 2013 MANAGEMENT: >STATE:1371780617,AUTH,,,
Thu Jun 20 21:10:17 2013 TLS: Initial packet from [AF_INET]10.2.1.50:1194, sid=87b578c3 e035f2e4
Thu Jun 20 21:10:17 2013 VERIFY OK: depth=1, C=US, ST=MO, L=Jefferson City, O=biapy, OU=changeme, CN=RasPiHomeNAS.donireland.com, name=changeme, emailAddress=root@RasPiHomeNas
Thu Jun 20 21:10:17 2013 VERIFY OK: nsCertType=SERVER
Thu Jun 20 21:10:17 2013 VERIFY OK: depth=0, C=US, ST=MO, L=Jefferson City, O=biapy, OU=changeme, CN=RasPiHomeNAS.donireland.com, name=changeme, emailAddress=root@RasPiHomeNas
Thu Jun 20 21:10:17 2013 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Jun 20 21:10:17 2013 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Jun 20 21:10:17 2013 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Jun 20 21:10:17 2013 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Jun 20 21:10:17 2013 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Thu Jun 20 21:10:17 2013 [RasPiHomeNAS.donireland.com] Peer Connection Initiated with [AF_INET]10.2.1.50:1194
Thu Jun 20 21:10:18 2013 MANAGEMENT: >STATE:1371780618,GET_CONFIG,,,
Thu Jun 20 21:10:19 2013 SENT CONTROL [RasPiHomeNAS.donireland.com]: 'PUSH_REQUEST' (status=1)
Thu Jun 20 21:10:19 2013 PUSH: Received control message: 'PUSH_REPLY,route 10.2.1.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'
Thu Jun 20 21:10:19 2013 OPTIONS IMPORT: timers and/or timeouts modified
Thu Jun 20 21:10:19 2013 OPTIONS IMPORT: --ifconfig/up options modified
Thu Jun 20 21:10:19 2013 OPTIONS IMPORT: route options modified
Thu Jun 20 21:10:19 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Thu Jun 20 21:10:19 2013 MANAGEMENT: >STATE:1371780619,ASSIGN_IP,,10.8.0.6,
Thu Jun 20 21:10:19 2013 open_tun, tt->ipv6=0
Thu Jun 20 21:10:19 2013 TAP-WIN32 device [Local Area Connection 2] opened: \\.\Global\{AC8D916C-D035-4141-9441-027CA70E5C18}.tap
Thu Jun 20 21:10:19 2013 TAP-Windows Driver Version 9.9
Thu Jun 20 21:10:19 2013 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.6/255.255.255.252 on interface {AC8D916C-D035-4141-9441-027CA70E5C18} [DHCP-serv: 10.8.0.5, lease-time: 31536000]
Thu Jun 20 21:10:19 2013 Successful ARP Flush on interface [19] {AC8D916C-D035-4141-9441-027CA70E5C18}
Thu Jun 20 21:10:24 2013 TEST ROUTES: 3/3 succeeded len=2 ret=1 a=0 u/d=up
Thu Jun 20 21:10:24 2013 C:\windows\system32\route.exe ADD 10.2.1.50 MASK 255.255.255.255 10.2.1.1 IF 12
Thu Jun 20 21:10:24 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=25 and dwForwardType=4
Thu Jun 20 21:10:24 2013 Route addition via IPAPI succeeded [adaptive]
Thu Jun 20 21:10:24 2013 C:\windows\system32\route.exe ADD 10.2.1.1 MASK 255.255.255.255 10.2.1.1 IF 12
Thu Jun 20 21:10:24 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=25 and dwForwardType=4
Thu Jun 20 21:10:24 2013 Route addition via IPAPI succeeded [adaptive]
Thu Jun 20 21:10:24 2013 C:\windows\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 10.8.0.5
Thu Jun 20 21:10:24 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Thu Jun 20 21:10:24 2013 Route addition via IPAPI succeeded [adaptive]
Thu Jun 20 21:10:24 2013 C:\windows\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 10.8.0.5
Thu Jun 20 21:10:24 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Thu Jun 20 21:10:24 2013 Route addition via IPAPI succeeded [adaptive]
Thu Jun 20 21:10:24 2013 MANAGEMENT: >STATE:1371780624,ADD_ROUTES,,,
Thu Jun 20 21:10:24 2013 C:\windows\system32\route.exe ADD 10.2.1.0 MASK 255.255.255.0 10.8.0.5
Thu Jun 20 21:10:24 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Thu Jun 20 21:10:24 2013 Route addition via IPAPI succeeded [adaptive]
Thu Jun 20 21:10:24 2013 C:\windows\system32\route.exe ADD 10.8.0.1 MASK 255.255.255.255 10.8.0.5
Thu Jun 20 21:10:24 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Thu Jun 20 21:10:24 2013 Route addition via IPAPI succeeded [adaptive]
Thu Jun 20 21:10:24 2013 Initialization Sequence Completed
Thu Jun 20 21:10:24 2013 MANAGEMENT: >STATE:1371780624,CONNECTED,SUCCESS,10.8.0.6,10.2.1.50
Thu Jun 20 21:11:45 2013 C:\windows\system32\route.exe DELETE 10.8.0.1 MASK 255.255.255.255 10.8.0.5
Thu Jun 20 21:11:45 2013 Route deletion via IPAPI succeeded [adaptive]
Thu Jun 20 21:11:45 2013 C:\windows\system32\route.exe DELETE 10.2.1.0 MASK 255.255.255.0 10.8.0.5
Thu Jun 20 21:11:45 2013 Route deletion via IPAPI succeeded [adaptive]
Thu Jun 20 21:11:45 2013 C:\windows\system32\route.exe DELETE 10.2.1.50 MASK 255.255.255.255 10.2.1.1
Thu Jun 20 21:11:45 2013 Route deletion via IPAPI succeeded [adaptive]
Thu Jun 20 21:11:45 2013 C:\windows\system32\route.exe DELETE 10.2.1.1 MASK 255.255.255.255 10.2.1.1
Thu Jun 20 21:11:45 2013 Route deletion via IPAPI succeeded [adaptive]
Thu Jun 20 21:11:45 2013 C:\windows\system32\route.exe DELETE 0.0.0.0 MASK 128.0.0.0 10.8.0.5
Thu Jun 20 21:11:45 2013 Route deletion via IPAPI succeeded [adaptive]
Thu Jun 20 21:11:45 2013 C:\windows\system32\route.exe DELETE 128.0.0.0 MASK 128.0.0.0 10.8.0.5
Thu Jun 20 21:11:45 2013 Route deletion via IPAPI succeeded [adaptive]
Thu Jun 20 21:11:45 2013 Closing TUN/TAP interface
Thu Jun 20 21:11:45 2013 SIGTERM[hard,] received, process exiting
Thu Jun 20 21:11:45 2013 MANAGEMENT: >STATE:1371780705,EXITING,SIGTERM,,
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
You asked if port forwarding was enabled on the RasPi. I answered yes. I did so based the following line: net.ipv4.ip_forward=1. It's my understanding that as long as I have that in my /etc/sysctl.conf, then the answer is yes. (this was already set when I first loaded Raspian -- I didn't enable it).
Just in case that wasn't the correct answer, here's the contents of that file.
Just in case that wasn't the correct answer, here's the contents of that file.
Code: Select all
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additonal system variables
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
kernel.printk = 3 4 1 3
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
[color=#FF0000][b]net.ipv4.ip_forward=1[/b][/color]
# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1
###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
# rpi tweaks
vm.swappiness=1
vm.min_free_kbytes = 8192
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
Re: How can I confirm internet traffic goes via VPN?
I took my laptop to a local WiFi hotspot so that I could see what happens if I try it on a network other than my own.
(I promise I won't make any more config changes other than what I list here and they won't be major.)
I changed the client config file:
First I tried the first line to use the FQDN but OpenVPN told me that "although the name is valid, it couldn't be resolved". I ping'd it and got it's IP address and put that in the config file. OpenVPN accepted that. Not sure what that could be. I was previously able to connect from this WiFi Hotspot using that FQDN. But now it won't -- but will connect via the IP address associated with it?
Oh well -- back to the important part. I still can't browse to any internet sites and windows lists the VPN network as "No Network Access". I tried to ping several web sites but got no replies. I tried ping the IP address of my hosted website and it couldn't ping even with the IP address. Then on a whim, I tried pinging the external IP address for the home network (the one I'm connected to). I got a reply back from that ping.
(I promise I won't make any more config changes other than what I list here and they won't be major.)
I changed the client config file:
Code: Select all
;remote RasPiHomeNAS.donireland.com 1194
;remote 10.2.1.50 1194
remote 173.25.24.66 1194
Oh well -- back to the important part. I still can't browse to any internet sites and windows lists the VPN network as "No Network Access". I tried to ping several web sites but got no replies. I tried ping the IP address of my hosted website and it couldn't ping even with the IP address. Then on a whim, I tried pinging the external IP address for the home network (the one I'm connected to). I got a reply back from that ping.
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
PROGRESS!
Ok. I've had a little bit of progress but not much.
I connected to the VPN again. Then I tried pinging a couple of servers that I KNOW I've never been to (so that I knew the IP address wouldn't be cached).
It successfully retrieves the IP address from the DNS server (previously, I'd just get a message that the "Host was unreacheable"). I just don't get a reply back -- but getting the IP address is an improvement.
I did a tracert on one of those addresses (www.gerber.com -- I just saw one of their ads this morning so it's the first address that came to mind) and here's the result:
Thanks a LOT for all your efforts thus far!
I connected to the VPN again. Then I tried pinging a couple of servers that I KNOW I've never been to (so that I knew the IP address wouldn't be cached).
It successfully retrieves the IP address from the DNS server (previously, I'd just get a message that the "Host was unreacheable"). I just don't get a reply back -- but getting the IP address is an improvement.
I did a tracert on one of those addresses (www.gerber.com -- I just saw one of their ads this morning so it's the first address that came to mind) and here's the result:
It's getting to my RasPi and stopping.C:\windows\system32>tracert www.gerber.com
Tracing route to www.gerber.com [216.255.64.235]
over a maximum of 30 hops:
1 93 ms 93 ms 93 ms RASPIHOMENAS [10.8.0.1]
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 ^C
Thanks a LOT for all your efforts thus far!
-
- OpenVPN User
- Posts: 25
- Joined: Fri Jun 14, 2013 1:58 pm
SOLVED!
I finally found the right combination.
/etc/iptables.firewall.rules
The following line loads the rules file (below) into iptables:
sudo iptables-restore</etc/iptables.firewall.rules
I just came back from the WiFi hotspot where I was able to browse the internet using my VPN connection.
Thanks for all your efforts!
/etc/iptables.firewall.rules
The following line loads the rules file (below) into iptables:
sudo iptables-restore</etc/iptables.firewall.rules
Code: Select all
*filter
# Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 -j REJECT
# Accept all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow all outbound traffic - you can modify this to only allow certain traffic
-A OUTPUT -o tun0 -j ACCEPT
-A OUTPUT -o eth0 -j ACCEPT
# Allow OpenVPN Internet Usage
-A INPUT -p udp -m udp --dport 1194 -j ACCEPT
-I FORWARD -i tun0 -o eth0 -s 10.8.0.0/24 -m conntrack --ctstate NEW -j ACCEPT ;<====I added these two lines
-I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT ; <===========and tried connecting. It WORKED!
# Allow Samba Connections
-A INPUT -p udp -m udp --dport 137 -j ACCEPT
-A INPUT -p udp -m udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
# Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL).
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# Allow SSH connections
#
# The -dport number should be the same port number you set in sshd_config
#
-A INPUT -p tcp -m state --state NEW --dport 9922 -j ACCEPT
# Allow ping
-A INPUT -p icmp -j ACCEPT
# Log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
# Drop all other inbound - default deny unless explicitly allowed policy
-A INPUT -j DROP
-A FORWARD -j DROP
COMMIT
*nat
-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to 10.2.1.50
COMMIT
Thanks for all your efforts!