1

I have configured my RPI3 B with debian 9 (stretch) as a openvpn client.

systemctl status openvpn
  ● openvpn.service - OpenVPN service
    Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset:
    Active: active (exited) since Tue 2019-08-20 17:23:13 CEST; 44min ago
    Process: 1485 ExecStart=/bin/true (code=exited, status=0/SUCCESS)  Main PID: 1485 (code=exited, status=0/SUCCESS)

ago 20 17:23:13 raspberrypi systemd[1]: Starting OpenVPN service...
ago 20 17:23:13 raspberrypi systemd[1]: Started OpenVPN service.

It then connects regularly via tun0. My raspberry must also function as a gateway to connect to the internet for some other LAN clients, but whe openvpn is active clients are out of the Internet, only when stopped, they come back online.

Thi is th result:

pi@raspberrypi:~ $ sudo /etc/init.d/openvpn stop
[ ok ] Stopping openvpn (via systemctl): openvpn.service.
pi@raspberrypi:~ $ ip route
default via 192.168.1.1 dev eth0 src 192.168.1.169 metric 202 
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.169 metric 202 
pi@raspberrypi:~ $ sudo /etc/init.d/openvpn start
[ ok ] Starting openvpn (via systemctl): openvpn.service.
pi@raspberrypi:~ $ ip route
default via 192.168.1.1 dev eth0 src 192.168.1.169 metric 202 
10.5.216.0/24 dev tun1 proto kernel scope link src 10.5.216.2XX 
10.32.216.0/24 dev tun0 proto kernel scope link src 10.32.216.117 
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.169 metric 202 
pi@raspberrypi:~ $ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:2f:c7:61 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.169/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe2f:c761/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b8:27:eb:7a:92:34 brd ff:ff:ff:ff:ff:ff
6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.32.216.1XX/24 brd 10.32.216.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::b420:bb4a:ba1e:88b9/64 scope link flags 800 
       valid_lft forever preferred_lft forever
7: tun1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.5.216.2XX/24 brd 10.5.216.255 scope global tun1
       valid_lft forever preferred_lft forever
    inet6 fe80::82ff:1083:9251:244f/64 scope link flags 800 
       valid_lft forever preferred_lft forever
  • That seems to be a routing problem. Can you please edit the question and add the ouptut of these commands: before OpenVPN is started ip route, after OpenVPN is started ip route and ip addr. – Ingo Aug 20 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.