Hi,
I have RPi running OpenVPN server and client, both in routing. While server is running fine when client is down, it stops working when the client is up. RPi itself has still access to the internet via the client VPN.
The configuration scheme:
Internet
|
ISP Router 192.168.1.1/24
|
eth0 RPi (192.168.1.17/24)
- tun0 OpenVPN server(192.168.2.0/24)
\ tun1 OpenVPN client(10.1.0.0/24)
I tried to add:
ip rule add from 192.168.1.17 lookup 10
ip route add default via 192.168.1.1 table 10
as well as
ip rule add from 192.168.1.17 table vpn priority 10
but with no luck. Any idea how to fix that?
Server config:
cd /etc/openvpn
local 192.168.1.17
proto udp
port 11940
verb 3
log-append /var/log/openvpn-server.log
status /var/log/openvpn-status-server.log
daemon
dev tun0
tun-mtu 1500
persist-tun
persist-key
server 192.168.2.0 255.255.255.0
ifconfig-pool-persist /etc/openvpn/ips.txt
push "dhcp-option DOMAIN home.local"
push "dhcp-option DNS 8.8.8.8"
push "sndbuf 0"
push "rcvbuf 0"
#push block-outside-dns
push "route 0.0.0.0 0.0.0.0 vpn_gateway"
cipher AES-256-CBC
auth-nocache
keepalive 10 120
ca /etc/openvpn/server/rpi-ca.crt
cert /etc/openvpn/server/rpi.crt
key /etc/openvpn/server/rpi.key
dh /etc/openvpn/server/dh4096.pem
duplicate-cn
sndbuf 0
rcvbuf 0
fast-io
mssfix 1360
Client
client
dev tun1
proto udp
remote remote.server 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/rpi-c.crt
key /etc/openvpn/rpi-c.key
cipher AES-256-CBC
verb 3
route-method exe
route-delay 2
redirect-gateway def1
log-append /var/log/openvpn.log
status /var/log/openvpn-status.log
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
tun-mtu 1500
mssfix 1360
fast-io
allow-pull-fqdn
route 1.2.4.5 255.255.255.255 net_gateway
route 5.6.7.8 255.255.255.255 net_gateway