doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Problems with OpenVPN on RasPi

Wed Jun 19, 2013 1:32 am

I've installed OpenVPN on my RasPi and it's connected via ethernet to my router. The RasPi has a static IP of 10.2.1.50. OpenVPN generates an IP network of 10.8.1.0/24 taking 10.8.1.1 for itself.

My laptop has Win7 64 bit. OpenVPN assigns it an IP of 10.8.1.6. But when I do an IPCONFIG /all on the laptop, default gateway (for the OpenVPN connection) is blank.

I'm beyond frustrated and now I'm here to BEG for help.

I've read the following blog entry several times over because his setup is the closest to mine of any that I've seen.

http://blog.remibergsma.com/2013/01/27/ ... pberry-pi/

The OpenVPN config file on the server:

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 9999

# 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.1.0 255.255.255.0
#server 10.173.167.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 /var/lib/openvpn/RasPiHomeNAS-donireland.com/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"

# 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"
push "redirect-gateway def1"

# 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 97.64.183.164"
;push "dhcp-option DNS 97.64.209.37"
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.8.4"

# 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 /var/log/openvpn/RasPiHomeNAS-donireland.com/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 /var/log/openvpn/RasPiHomeNAS-donireland.com/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

# Advanced clients configurations
client-config-dir /etc/openvpn/config/RasPiHomeNAS-donireland.com/clients-configs
push "route 10.2.1.0 255.255.255.0"; Allow access to local network.
The OpenVPN config file on the client:

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
pull

# 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 RasPiHome.donireland.com 9999
#remote 10.2.1.50 9999

# 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
Output from Route>routes.txt on the RasPi:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.2.1.1        0.0.0.0         UG    0      0        0 eth0
10.2.1.0        *               255.255.255.0   U     0      0        0 eth0
10.8.1.0        10.8.1.2        255.255.255.0   UG    0      0        0 tun0
10.8.1.0        10.2.1.1        255.255.255.0   UG    0      0        0 eth0
10.8.1.2        *               255.255.255.255 UH    0      0        0 tun0
iptables on the RasPi:

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




john564
Posts: 87
Joined: Tue Oct 30, 2012 7:05 am

Re: Problems with OpenVPN on RasPi

Wed Jun 19, 2013 10:15 am

OPENVPN working fine on raspberry pi, ipconfig /all shows default gateway blank, but no issue, it still works.

What is your symptom, cannot surf or cannot connect?
do you have log of openvpn connection

I'm using windows 7 client and raspberry pi server.
guide http://tryapi.wordpress.com/2012/10/27/ ... pberry-pi/
ipconfig /all
:
Ethernet adapter Local Area Connection 3:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Win32 Adapter V9
Physical Address. . . . . . . . . : 00-FF-80-91-36-1D
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::f565:4f99:83bb:1977%24(Preferred)
IPv4 Address. . . . . . . . . . . : 10.8.0.6(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.252
Lease Obtained. . . . . . . . . . : Wednesday, June 19, 2013 6:02:51 PM
Lease Expires . . . . . . . . . . : Thursday, June 19, 2014 6:02:50 PM
Default Gateway . . . . . . . . . :
DHCP Server . . . . . . . . . . . : 10.8.0.5
DHCPv6 IAID . . . . . . . . . . . : 268500864
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-15-85-B2-0F-00-26-6C-65-95-B5

DNS Servers . . . . . . . . . . . : 208.67.222.222
208.67.220.220
NetBIOS over Tcpip. . . . . . . . : Enabled

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Wed Jun 19, 2013 10:49 am

john564 wrote:OPENVPN working fine on raspberry pi, and always has been, ipconfig /all shows default gateway blank, but no issue, it still works.

What is your symptom, cannot surf or cannot connect?
do you have log of openvpn connection

Also using windows 7 client and raspberry pi server.
guide http://tryapi.wordpress.com/2012/10/27/ ... pberry-pi/
Thanks for the reply. I only mentioned the empty default gateway because I thought MAYBE that was causing my problem. The client does make the OpenVPN connection. But if the VPN is active, then I can't browse the internet. I can't even ping servers that normally do reply to pings. I even tried pinging my router and that failed. As soon as I close the VPN connection, I can browse again as well as ping the servers/router that I was unable to ping just a few min ago.

This is a log of the connection I made this morning.

Code: Select all

Wed Jun 19 05:43:40 2013 OpenVPN 2.3.2 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [eurephia] [IPv6] built on Jun  3 2013
Enter Management Password:
Wed Jun 19 05:43:40 2013 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Wed Jun 19 05:43:40 2013 Need hold release from management interface, waiting...
Wed Jun 19 05:43:40 2013 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Wed Jun 19 05:43:40 2013 MANAGEMENT: CMD 'state on'
Wed Jun 19 05:43:40 2013 MANAGEMENT: CMD 'log all on'
Wed Jun 19 05:43:41 2013 MANAGEMENT: CMD 'hold off'
Wed Jun 19 05:43:41 2013 MANAGEMENT: CMD 'hold release'
Wed Jun 19 05:43:41 2013 Control Channel Authentication: using 'C:\Program Files\OpenVPN\config\RasPiHomeNAS-donireland.com\ta.key' as a OpenVPN static key file
Wed Jun 19 05:43:41 2013 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 19 05:43:41 2013 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 19 05:43:41 2013 Socket Buffers: R=[8192->8192] S=[8192->8192]
Wed Jun 19 05:43:41 2013 MANAGEMENT: >STATE:1371638621,RESOLVE,,,
Wed Jun 19 05:43:41 2013 UDPv4 link local: [undef]
Wed Jun 19 05:43:41 2013 UDPv4 link remote: [AF_INET]173.25.24.66:9999
Wed Jun 19 05:43:41 2013 MANAGEMENT: >STATE:1371638621,WAIT,,,
Wed Jun 19 05:43:41 2013 MANAGEMENT: >STATE:1371638621,AUTH,,,
Wed Jun 19 05:43:41 2013 TLS: Initial packet from [AF_INET]173.25.24.66:9999, sid=2d8e4fe0 c0090184
Wed Jun 19 05:43:41 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
Wed Jun 19 05:43:41 2013 VERIFY OK: nsCertType=SERVER
Wed Jun 19 05:43:41 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
Wed Jun 19 05:43:41 2013 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jun 19 05:43:41 2013 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 19 05:43:41 2013 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Wed Jun 19 05:43:41 2013 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 19 05:43:41 2013 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Wed Jun 19 05:43:41 2013 [RasPiHomeNAS.donireland.com] Peer Connection Initiated with [AF_INET]173.25.24.66:9999
Wed Jun 19 05:43:42 2013 MANAGEMENT: >STATE:1371638622,GET_CONFIG,,,
Wed Jun 19 05:43:44 2013 SENT CONTROL [RasPiHomeNAS.donireland.com]: 'PUSH_REQUEST' (status=1)
Wed Jun 19 05:43:44 2013 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.8.4,route 10.2.1.0 255.255.255.0,route 10.8.1.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.1.6 10.8.1.5'
Wed Jun 19 05:43:44 2013 OPTIONS IMPORT: timers and/or timeouts modified
Wed Jun 19 05:43:44 2013 OPTIONS IMPORT: --ifconfig/up options modified
Wed Jun 19 05:43:44 2013 OPTIONS IMPORT: route options modified
Wed Jun 19 05:43:44 2013 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed Jun 19 05:43:44 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Wed Jun 19 05:43:44 2013 MANAGEMENT: >STATE:1371638624,ASSIGN_IP,,10.8.1.6,
Wed Jun 19 05:43:44 2013 open_tun, tt->ipv6=0
Wed Jun 19 05:43:44 2013 TAP-WIN32 device [Local Area Connection 2] opened: \\.\Global\{AC8D916C-D035-4141-9441-027CA70E5C18}.tap
Wed Jun 19 05:43:44 2013 TAP-Windows Driver Version 9.9 
Wed Jun 19 05:43:44 2013 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.1.6/255.255.255.252 on interface {AC8D916C-D035-4141-9441-027CA70E5C18} [DHCP-serv: 10.8.1.5, lease-time: 31536000]
Wed Jun 19 05:43:44 2013 Successful ARP Flush on interface [19] {AC8D916C-D035-4141-9441-027CA70E5C18}
Wed Jun 19 05:43:49 2013 TEST ROUTES: 3/3 succeeded len=2 ret=1 a=0 u/d=up
Wed Jun 19 05:43:49 2013 C:\windows\system32\route.exe ADD 173.25.24.66 MASK 255.255.255.255 10.2.1.1
Wed Jun 19 05:43:49 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=25 and dwForwardType=4
Wed Jun 19 05:43:49 2013 Route addition via IPAPI succeeded [adaptive]
Wed Jun 19 05:43:49 2013 C:\windows\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 10.8.1.5
Wed Jun 19 05:43:49 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Wed Jun 19 05:43:49 2013 Route addition via IPAPI succeeded [adaptive]
Wed Jun 19 05:43:49 2013 C:\windows\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 10.8.1.5
Wed Jun 19 05:43:49 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Wed Jun 19 05:43:49 2013 Route addition via IPAPI succeeded [adaptive]
Wed Jun 19 05:43:49 2013 MANAGEMENT: >STATE:1371638629,ADD_ROUTES,,,
Wed Jun 19 05:43:49 2013 C:\windows\system32\route.exe ADD 10.2.1.0 MASK 255.255.255.0 10.8.1.5
Wed Jun 19 05:43:49 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Wed Jun 19 05:43:49 2013 Route addition via IPAPI succeeded [adaptive]
Wed Jun 19 05:43:49 2013 C:\windows\system32\route.exe ADD 10.8.1.1 MASK 255.255.255.255 10.8.1.5
Wed Jun 19 05:43:49 2013 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Wed Jun 19 05:43:49 2013 Route addition via IPAPI succeeded [adaptive]
Wed Jun 19 05:43:49 2013 Initialization Sequence Completed
Wed Jun 19 05:43:49 2013 MANAGEMENT: >STATE:1371638629,CONNECTED,SUCCESS,10.8.1.6,173.25.24.66
Wed Jun 19 05:44:31 2013 C:\windows\system32\route.exe DELETE 10.8.1.1 MASK 255.255.255.255 10.8.1.5
Wed Jun 19 05:44:31 2013 Route deletion via IPAPI succeeded [adaptive]
Wed Jun 19 05:44:31 2013 C:\windows\system32\route.exe DELETE 10.2.1.0 MASK 255.255.255.0 10.8.1.5
Wed Jun 19 05:44:31 2013 Route deletion via IPAPI succeeded [adaptive]
Wed Jun 19 05:44:31 2013 C:\windows\system32\route.exe DELETE 173.25.24.66 MASK 255.255.255.255 10.2.1.1
Wed Jun 19 05:44:31 2013 Route deletion via IPAPI succeeded [adaptive]
Wed Jun 19 05:44:31 2013 C:\windows\system32\route.exe DELETE 0.0.0.0 MASK 128.0.0.0 10.8.1.5
Wed Jun 19 05:44:31 2013 Route deletion via IPAPI succeeded [adaptive]
Wed Jun 19 05:44:31 2013 C:\windows\system32\route.exe DELETE 128.0.0.0 MASK 128.0.0.0 10.8.1.5
Wed Jun 19 05:44:31 2013 Route deletion via IPAPI succeeded [adaptive]
Wed Jun 19 05:44:31 2013 Closing TUN/TAP interface
Wed Jun 19 05:44:31 2013 SIGTERM[hard,] received, process exiting
Wed Jun 19 05:44:31 2013 MANAGEMENT: >STATE:1371638671,EXITING,SIGTERM,,

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Wed Jun 19, 2013 10:58 am

P.S. I'm doing the setup work at home. Which of course means that browsing to whatsmyip won't provide a valid test. But after I'm at least able to browse while the VPN is connected, I'll drive to a WiFi hotspot and test it there.

Oh I forgot to mention that when the VPN is active, I can ping both of the VPN server's IP addresses (eth0 & tun0) and get a reply. If I ping the router while the vpn is active, NO REPLY -- after the VPN disconnects, I get a reply.

john564
Posts: 87
Joined: Tue Oct 30, 2012 7:05 am

Re: Problems with OpenVPN on RasPi

Wed Jun 19, 2013 11:32 am

ok, its a test at home, for the test you need to change the client script to connect to your inside IP address from router 10.2.1.50
not your external address, which I see you have.

does not work when client and server where connected to same router and use external server IP address
change the client script to connect to the local IP of server e.g. 10.2.1.50
when you drive to the WiFi hotspot and test it there, you need to connect to external IP address

Ogoshi
Posts: 45
Joined: Wed Dec 28, 2011 5:13 pm
Location: Southend-on-Sea, Essex, England

Re: Problems with OpenVPN on RasPi

Wed Jun 19, 2013 1:07 pm

Sounds like the same problem I had when setting up. I could ping the VPN address, but nothing else on my LAN (router, other servers etc.). I then found this http://www.raspberrypi.org/phpBB3/viewt ... 36&t=21566

I hadn't made changes to the raspi firewall, from where it says "# uncomment to allow data redirect" to the end of the set up. Once I had done this, I could ping or access the internet and everything on my LAN.

Now I have issues with my router not forwarding the port to raspi during the day! Grr!

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Wed Jun 19, 2013 1:19 pm

john564 wrote:ok, its a test at home, for the test you need to change the client script to connect to your inside IP address from router 10.2.1.50
not your external address, which I see you have.
Thanks for the info. I'll try that when I get home. In the meantime.......

In Win7 Network and Connections, it tells what networks are connected. It says that the VPN is connected (lists it as LAN2), a PUBLIC network and NO INTERNET ACCESS. Does it say "NO INTERNET ACCESS" just because of the fact that it can't contact the router?

And when I finally get it working, shouldn't the VPN be listed as HOME network?

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Wed Jun 19, 2013 9:39 pm

I just got home and tried setting it to the local IP address (changed the *.ovpn client config file on the laptop). Still no internet connection. :(

Then I closed and restarted the openvpn software (thinking that maybe it didn't accept the change in address because it was already running Still no internet connection. :(

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Thu Jun 20, 2013 2:06 am

I've found and fixed one problem on my own. But it's STILL not working. I even went to a wifi hotspot today to test it.

If the VPN is active, I can't browse the internet. As soon as I disconnect the VPN, browsing works again.

Anyway -- my error was in misreading the following:
The solution? Make the Linux server or at least the router aware of the green network, and tell them where to send traffic to this network. This is done by adding a route like this:
1

route add -net 10.8.0.0/24 gw 10.5.5.5

Assuming the local network ip-address of the OpenVPN server is 10.5.5.5.
I don't know why, but I thought it said "assuming the local network ip-address of the ROUTER is 10.5.5.5". So I changed this to my ROUTER's IP Address (10.2.1.1). I've since changed this to my VPN server's IP (10.2.1.50).

This is making my head HURT!

Anyway, I've done some more reading and it was suggested to look at the results of 'netstat -rn'.

Following is the results of doing that on my Win7 client:
C:\windows\system32>netstat -rn
===========================================================================
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.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

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: Problems with OpenVPN on RasPi

Thu Jun 20, 2013 7:55 am

Hi Doni49,

I wrote a tutorial about the OpenVPN setup, maybe that points you in a new direction to solve your problems. If I understand it right, the VPN is working fine but the Pi isn't handling your traffic the way you want it to, so it's about forwarding and gateway settings then.
http://www.raspberrypi.org/phpBB3/viewt ... 36&t=20916

Cheers, Thijs

doni49 wrote:I've found and fixed one problem on my own. But it's STILL not working. I even went to a wifi hotspot today to test it.

If the VPN is active, I can't browse the internet. As soon as I disconnect the VPN, browsing works again.

Anyway -- my error was in misreading the following:
The solution? Make the Linux server or at least the router aware of the green network, and tell them where to send traffic to this network. This is done by adding a route like this:
1

route add -net 10.8.0.0/24 gw 10.5.5.5

Assuming the local network ip-address of the OpenVPN server is 10.5.5.5.
I don't know why, but I thought it said "assuming the local network ip-address of the ROUTER is 10.5.5.5". So I changed this to my ROUTER's IP Address (10.2.1.1). I've since changed this to my VPN server's IP (10.2.1.50).

This is making my head HURT!

Anyway, I've done some more reading and it was suggested to look at the results of 'netstat -rn'.

Following is the results of doing that on my Win7 client:
C:\windows\system32>netstat -rn
===========================================================================
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.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
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Thu Jun 20, 2013 1:08 pm

Thanks. I've read that - - in fact I read that as I did the initial setup & configuration of OpenVPN.

I think it's time to back up and start over.

Since I know the keys all work, I'll keep them but I'm going to start fresh with new configuration files. And start over with he iptable rules.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Fri Jun 21, 2013 12:17 pm

Starting over didn't help. :(

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Sat Jun 22, 2013 4:06 am

After a LOT of reading on IPTABLES, I updated my iptables with the following:

/etc/iptables.firewall.rules
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
#-A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
#-A INPUT -i tun0 -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 FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
#-A FORWARD -s 10.8.0.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.0.0/24 -o eth0 -j SNAT --to 10.2.1.50 
# -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
COMMIT

john564
Posts: 87
Joined: Tue Oct 30, 2012 7:05 am

Re: Problems with OpenVPN on RasPi

Sun Jun 23, 2013 1:18 am

your doing too much
For iptables I only do the following
there is nothing else


# check iptables is empty

Code: Select all

sudo iptables --list
# Make file for firewall setting

Code: Select all

sudo nano /usr/local/bin/firewall.sh

    #!/bin/bash
    iptables -t filter -F
    iptables -t nat -F
    iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
    iptables -A FORWARD -s "10.8.0.0/24" -j ACCEPT
    iptables -A FORWARD -j REJECT
    iptables -t nat -A POSTROUTING -s "10.8.0.0/24" -j MASQUERADE
# Nano editor TIP: CTRL+o writeout, in other words save the file
# CTRL+x exit


# run firewall

Code: Select all

sudo chmod +x /usr/local/bin/firewall.sh
sudo /usr/local/bin/firewall.sh
# check firewall

Code: Select all

sudo iptables --list
pi@raspberrypi ~ $ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- 10.8.0.0/24 anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# Finally uncomment to allow data redirect

Code: Select all

sudo nano /etc/sysctl.conf

    net.ipv4.ip_forward=1


wingloon
Posts: 4
Joined: Fri Jan 25, 2013 5:17 am

Re: Problems with OpenVPN on RasPi

Tue Jun 25, 2013 5:34 pm

Try include "route-method exe" in your OpenVPN .ovpn client config and run the OpenVPN GUI in Windows 7 as Administrator.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Problems with OpenVPN on RasPi

Tue Jun 25, 2013 7:11 pm

wingloon wrote:Try include "route-method exe" in your OpenVPN .ovpn client config and run the OpenVPN GUI in Windows 7 as Administrator.
What does that do? Now that I've got it working, I'm reluctant to make changes without first knowing exactly what the changes will do.

Thanks!

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: Problems with OpenVPN on RasPi

Tue Jun 25, 2013 8:53 pm

is the Raspberry Pi set to forward traffic?

in /etc/sysctl.conf un-comment net.ipv4.ip_forward=1 and run sysctl --load

wingloon
Posts: 4
Joined: Fri Jan 25, 2013 5:17 am

Re: Problems with OpenVPN on RasPi

Wed Jun 26, 2013 6:11 pm

doni49 wrote:
wingloon wrote:Try include "route-method exe" in your OpenVPN .ovpn client config and run the OpenVPN GUI in Windows 7 as Administrator.
What does that do? Now that I've got it working, I'm reluctant to make changes without first knowing exactly what the changes will do.

Thanks!
OpenVPN need administrator rights to run on Win 7 and need "route-method exe" for setting gateway. Thanks.

Nebraska_pi
Posts: 1
Joined: Fri Nov 13, 2015 4:05 pm

Re: Problems with OpenVPN on RasPi

Fri Nov 13, 2015 4:11 pm

I had a similar problem, the OpenVPN client on my Windows 10 laptop would turn green and connect to my Raspberry pi at home, however I could not ping or talk to any devices on my home LAN.

The solution that I found was to make sure that you are running the OpenVPN client (Windows Vista/7/10) as administrator. Right click on the OpenVPN GUI icon and select "Run as Administrator".

castletonroad
Posts: 135
Joined: Sat Jul 25, 2015 11:23 pm

Re: Problems with OpenVPN on RasPi

Fri Mar 25, 2016 2:43 am

john564 wrote:your doing too much
For iptables I only do the following
there is nothing else


# check iptables is empty

Code: Select all

sudo iptables --list
# Make file for firewall setting

Code: Select all

sudo nano /usr/local/bin/firewall.sh

    #!/bin/bash
    iptables -t filter -F
    iptables -t nat -F
    iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
    iptables -A FORWARD -s "10.8.0.0/24" -j ACCEPT
    iptables -A FORWARD -j REJECT
    iptables -t nat -A POSTROUTING -s "10.8.0.0/24" -j MASQUERADE
# Nano editor TIP: CTRL+o writeout, in other words save the file
# CTRL+x exit


# run firewall

Code: Select all

sudo chmod +x /usr/local/bin/firewall.sh
sudo /usr/local/bin/firewall.sh
# check firewall

Code: Select all

sudo iptables --list
pi@raspberrypi ~ $ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- 10.8.0.0/24 anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# Finally uncomment to allow data redirect

Code: Select all

sudo nano /etc/sysctl.conf

    net.ipv4.ip_forward=1

Thank you so much - populating /usr/local/bin/firewall.sh did this for me!
Raspberry Pi 4 Model B | Raspberry Pi 3 Model B | Raspberry Pi 2 Model B

Return to “Networking and servers”